masrud / octane-benchmark

Automatically exported from code.google.com/p/octane-benchmark
0 stars 0 forks source link

GB Emulator crashes when changing settings for canvas scaling #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Modify line 9373 of gbemu-part2.js so that the setting for "Scale the canvas 
in JS, or let the browser scale the canvas?" is "true".
2. Run the benchmark.

What is the expected output? What do you see instead?
The benchmark page shows "Error" for GB Emulator and the Octane score is marked 
as incomplete. On the console, you get:
Gameboy: HTML5 Canvas support required: this.drawContextOffscreen.getImageData 
is not a functionfile: gbemu-part2.js, line: 5031
Gameboy: Error

What version of the product are you using? On what operating system?
Firefox 29

Please provide any additional information below.
The root cause of the problem is that lines 9753 and 9754 read undefined 
values. With the default settings of gbemu, these values are ignored and 
replaced by default values in lines 5005 and 5006 of gbemu-part2.js. With the 
changed settings, however, the values propagate to line 77 of gbemu-part1.js 
and cause an exception, because NaN is passed to Uint8Array. Even worse, the 
exception is caught in line 5030 of gbemu-part2.js and the error handling code 
calls an undefined function. This call leads to another exception, which is not 
caught and causes the benchmark to crash.

Original issue reported on code.google.com by mich...@binaervarianz.de on 27 May 2014 at 6:04

GoogleCodeExporter commented 9 years ago
Hello, could you give us more background on why you'd like to try this change? 
Gameboy, as many other tests in Octane, needed to be modified to avoid any 
canvas interaction, which is not the goal of the benchmark. So many functions 
have been replaced with dummy ones and probably this change accesses either 
something that is not covered or something that doesn't exist.

Original comment by octane.t...@gmail.com on 28 May 2014 at 8:53

GoogleCodeExporter commented 9 years ago
Thanks for the quick reply. We found this problem while working on a novel 
program analysis that detects bugs. The code is clearly wrong, as it tries to 
call a function that doesn't exist.
If Octane benchmarks are supposed to run correctly only for the benchmark 
input, you probably don't have to fix it. If, instead, you care about having a 
consistent program, you may want to either remove/reduce the settings array (to 
prevent canvas interaction), or fix the bug itself.

Original comment by mich...@binaervarianz.de on 28 May 2014 at 2:42

GoogleCodeExporter commented 9 years ago
I see, now it makes sense. Yes, generally the code is supposed to work in one 
way and with the minimal amount of modifications from the original. That is why 
the settings weren't even touched. I think we will leave things like this for 
this specific issue. Cheers

Original comment by octane.t...@gmail.com on 28 May 2014 at 2:54