numworks / epsilon

Modern graphing calculator operating system.
https://www.numworks.com/resources/engineering/software/
1.75k stars 466 forks source link

[Emscripten] 100! sqrt(ans) sqrt(ans) sqrt(ans) abort #1735

Open RedGl0w opened 3 years ago

RedGl0w commented 3 years ago

To Reproduce

Steps to reproduce the behavior:

  1. Go to the calculation app
  2. Type 100!
  3. Type 3 times sqrt(ans)
  4. The third time the simulator crashes

Screenshots

When compiling the simulator without window name (because of https://github.com/numworks/epsilon/issues/1734) and with DEBUG=1, when following the crashing scenario here is the logs :

emscripten_set_main_loop_timing: Cannot set timing mode for main loop since a main loop does not exist! Call emscripten_set_main_loop first to set one up.
abort(-12) at jsStackTrace@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:863398
stackTrace@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:863566
abort@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:42280
_Emscripten_HandleFocus@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:15:591391
dynCall_iiii@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:49:188523
focusEventHandlerFunc@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1032419
jsEventHandler@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:987429

This error happened during an emterpreter-async operation. Was there non-emterpreted code on the stack during save (which is unallowed)? If so, you may want to adjust EMTERPRETIFY_BLACKLIST, EMTERPRETIFY_WHITELIST. For reference, this is what the stack looked like when we tried to save it: 2,handle@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1051389
_emscripten_sleep@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1051793
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:51632
_IonSimulatorCallbackDidScanKeyboard@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:49:276446
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:43367
__ZN3Ion8Keyboard4scanEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:19:567283
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:20533
__ZN3Ion6Events8getEventEPi@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:34:304392
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:34127
__ZN7RunLoop4stepEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:27:475143
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:47205
__ZN7RunLoop8runWhileEPFbPvES0_@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:13:25459
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:32554
__ZN7RunLoop3runEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:40:385510
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:50399
__ZN9Container3runEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:26:493373
dynCall_vi@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:49:234769
invoke_vi@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1070959
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:7024
__ZN13AppsContainer3runEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:39:572875
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:19980
__Z8ion_mainiPKPKc@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:25:363308
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:9753
Epsilon/asm.emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:56:16637
resume@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1050940
_emscripten_sleep/</<@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1051839
setTimeout handler*_emscripten_sleep/<@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1051827
handle@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1050360
_emscripten_sleep@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1051793
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:51632
_IonSimulatorCallbackDidScanKeyboard@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:49:276446
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:43367
__ZN3Ion8Keyboard4scanEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:19:567283
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:20533
__ZN3Ion6Events8getEventEPi@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:34:304392
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:34127
__ZN7RunLoop4stepEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:27:475143
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:47205
__ZN7RunLoop8runWhileEPFbPvES0_@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:13:25459
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:32554
__ZN7RunLoop3runEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:40:385510
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:50399
__ZN9Container3runEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:26:493373
dynCall_vi@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:49:234769
invoke_vi@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1070959
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:7024
__ZN13AppsContainer3runEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:39:572875
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:19980
__Z8ion_mainiPKPKc@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:25:363308
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:9753
Epsilon/asm.emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:56:16637
resume@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1050940
_emscripten_sleep/</<@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1051839
setTimeout handler*_emscripten_sleep/<@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1051827
handle@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1050360
_emscripten_sleep@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1051793
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:51632
_IonSimulatorCallbackDidScanKeyboard@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:49:276446
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:43367
__ZN3Ion8Keyboard4scanEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:19:567283
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:20533
__ZN3Ion6Events8getEventEPi@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:34:304392
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:34127
__ZN7RunLoop4stepEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:27:475143
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:47205
__ZN7RunLoop8runWhileEPFbPvES0_@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:13:25459
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:32554
__ZN7RunLoop3runEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:40:385510
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:50399
__ZN9Container3runEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:26:493373
dynCall_vi@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:49:234769
invoke_vi@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1070959
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:7024
__ZN13AppsContainer3runEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:39:572875
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:19980
__Z8ion_mainiPKPKc@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:25:363308
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:9753
Epsilon/asm.emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:56:16637
resume@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1050940
_emscripten_sleep/</<@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1051839
setTimeout handler*_emscripten_sleep/<@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1051827
handle@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1050360
_emscripten_sleep@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1051793
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:51632
_IonSimulatorCallbackDidScanKeyboard@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:49:276446
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:43367
__ZN3Ion8Keyboard4scanEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:19:567283
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:20533
__ZN3Ion6Events8getEventEPi@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:34:304392
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:34127
__ZN7RunLoop4stepEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:27:475143
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:47205
__ZN7RunLoop8runWhileEPFbPvES0_@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:13:25459
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:32554
__ZN7RunLoop3runEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:40:385510
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:50399
__ZN9Container3runEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:26:493373
dynCall_vi@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:49:234769
invoke_vi@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1070959
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:7024
__ZN13AppsContainer3runEv@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:39:572875
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:19980
__Z8ion_mainiPKPKc@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:25:363308
emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:47:9753
Epsilon/asm.emterpret@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:56:16637
resume@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1050940
_emscripten_sleep/</<@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1051839
setTimeout handler*_emscripten_sleep/<@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1051827
handle@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1050360
_emscripten_sleep@file:///home/redgl0w/Bureau/100!/output/debug/simulator/web/epsilon.js:9:1051793

Environment

RedGl0w commented 3 years ago

After some tests, it seems that the rollback system of poincare doens't work at all with emterpreter-async (probably the stack manipulation of setjmp / longjmp isn't supported by empterpreter, because on omega with WASM we don't have this issue).