Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

acorn-optimizer.js: TypeError: Cannot read property 'type' of undefined #10745

Closed
Beuc opened this issue Mar 21, 2020 · 2 comments
Closed

acorn-optimizer.js: TypeError: Cannot read property 'type' of undefined #10745

Beuc opened this issue Mar 21, 2020 · 2 comments

Comments

@Beuc
Copy link
Contributor

@Beuc Beuc commented Mar 21, 2020

Hi,

I got a new internal error at final link time when upgrading 1.39.10 -> 1.39.11 with full rebuild:

$ emcc renpyweb/build/main-renpyweb-static.bc renpyweb/build/emscripten-static.bc renpyweb/build/importexport.bc pygame_sdl2/emscripten-static/build-temp/gen-static/*.o pygame_sdl2/emscripten-static/build-temp/src/*.o renpy/module/emscripten-static/build-temp/*.o renpy/module/emscripten-static/build-temp/gen-static/*.o \
    -L renpyweb/install/lib -O3 -s ASSERTIONS=0 -s EMULATE_FUNCTION_POINTER_CASTS=1 -s FORCE_FILESYSTEM=1 -s LZ4=1 -s RETAIN_COMPILER_SETTINGS=1 -s MINIFY_HTML=0 -s ENVIRONMENT=web -lpython2.7 -s USE_SDL=2 -lSDL2_image -ljpeg -lpng -lwebp -lz -s USE_FREETYPE=1 -lavformat -lavcodec -lavutil -lswresample -lswscale -lfribidi -lzip -lidbfs.js -s EXPORTED_FUNCTIONS='["_main", "_Py_Initialize", "_PyRun_SimpleString", "_pyapp_runmain", "_emSavegamesImport", "_emSavegamesExport"]' -s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]' -s FULL_ES2=1 --shell-file renpy-shell.html --pre-js renpy-pre.js \
    -s ASYNCIFY=1 -s ASYNCIFY_STACK_SIZE=65535 -s ASYNCIFY_WHITELIST='["main", "pyapp_runmain", "SDL_WaitEvent", "SDL_WaitEventTimeout", "SDL_Delay", "SDL_RenderPresent", "GLES2_RenderPresent", "SDL_GL_SwapWindow", "Emscripten_GLES_SwapWindow", "byn$fpcast-emu$Emscripten_GLES_SwapWindow", "SDL_UpdateWindowSurface", "SDL_UpdateWindowSurfaceRects", "Emscripten_UpdateWindowFramebuffer", "PyRun_SimpleFileExFlags", "PyRun_FileExFlags", "PyEval_EvalCode", "PyEval_EvalCodeEx", "PyEval_EvalFrameEx", "PyCFunction_Call", "PyObject_Call", "fast_function", "byn$fpcast-emu$function_call", "function_call", "instancemethod_call", "byn$fpcast-emu$instancemethod_call", "byn$fpcast-emu$slot_tp_call", "slot_tp_call", "__pyx_pw_11pygame_sdl2_5event_7wait", "byn$fpcast-emu$__pyx_pw_11pygame_sdl2_5event_7wait", "__pyx_pw_11pygame_sdl2_7display_21flip", "byn$fpcast-emu$__pyx_pw_11pygame_sdl2_7display_21flip", "__pyx_pw_11pygame_sdl2_7display_6Window_13flip", "byn$fpcast-emu$__pyx_pw_11pygame_sdl2_7display_6Window_13flip", "__pyx_pf_5renpy_2gl_6gldraw_6GLDraw_*draw_screen", "__pyx_pw_5renpy_2gl_6gldraw_6GLDraw_*draw_screen", "byn$fpcast-emu$__pyx_pw_5renpy_2gl_6gldraw_6GLDraw_*draw_screen", "__Pyx_PyObject_CallNoArg*", "byn$fpcast-emu$__pyx_pw_10emscripten_*sleep", "__pyx_pf_10emscripten_*sleep", "__pyx_pw_10emscripten_*sleep", "gen_send", "gen_send_ex", "gen_iternext", "type_call", "slot_tp_init", "builtin_eval"]' \
    -s INITIAL_MEMORY=128MB -s ALLOW_MEMORY_GROWTH=1 \
    -o renpyweb/build/t/index.html
[...]
renpyweb/emsdk/upstream/emscripten/tools/acorn-optimizer.js:688
          if (target.type === 'Identifier' && target.name === 'asm' && value) {
                     ^

TypeError: Cannot read property 'type' of undefined
    at renpyweb/emsdk/upstream/emscripten/tools/acorn-optimizer.js:688:22
    at fullWalk (renpyweb/emsdk/upstream/emscripten/tools/acorn-optimizer.js:85:3)
    at renpyweb/emsdk/upstream/emscripten/tools/acorn-optimizer.js:83:5
    at maybeChild (renpyweb/emsdk/upstream/emscripten/tools/acorn-optimizer.js:52:7)
    at Array.forEach (<anonymous>)
    at visitChildren (renpyweb/emsdk/upstream/emscripten/tools/acorn-optimizer.js:63:15)
    at fullWalk (renpyweb/emsdk/upstream/emscripten/tools/acorn-optimizer.js:82:3)
    at renpyweb/emsdk/upstream/emscripten/tools/acorn-optimizer.js:83:5
    at maybeChild (renpyweb/emsdk/upstream/emscripten/tools/acorn-optimizer.js:52:7)
    at visitChildren (renpyweb/emsdk/upstream/emscripten/tools/acorn-optimizer.js:60:10)
shared:ERROR: 'renpyweb/emsdk/node/12.9.1_64bit/bin/node renpyweb/emsdk/upstream/emscripten/tools/acorn-optimizer.js /tmp/tmpoOlryj.js emitDCEGraph noPrint' failed (1)

I can't reproduce it on smaller programs :/

git bisect says:

fac19919dce8181e1bbad89a7f0b7f111bf14a60 is the first bad commit
commit fac19919dce8181e1bbad89a7f0b7f111bf14a60
Author: Alon Zakai <azakai@google.com>
Date:   Thu Mar 19 09:29:32 2020 -0700

    Properly metadce wasm exports in minimal runtime with asm = without var (#10724)
    
    See #10663 for background: the asm exports in that mode are not always
    received as var asm = but sometimes just asm = if asm is declared
    in the outer scope (if something might use them).

@kripken

This comment has been minimized.

Copy link
Member

@kripken kripken commented Mar 21, 2020

Thanks @Beuc , and sorry about this regression. Fix in #10749

@Beuc

This comment has been minimized.

Copy link
Contributor Author

@Beuc Beuc commented Mar 21, 2020

Thanks for the prompt fix, it works for me :)

@Beuc Beuc closed this Mar 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.