Skip to content

acorn optimizer assertion error #20639

Closed
Closed

Description

@pca006132

This is a regression which does not happen on 3.1.47 but occur on 3.1.48.

See elalish/manifold#591 (comment)

Version of emscripten/emsdk:

It works on 3.1.47 but regressed on 3.1.48.

Failing command line in full:

I did not get a minimal reproducible example but here is the docker instruction for how to compile with docker (ubuntu 22.04):

apt-get update
apt-get install -y git build-essential cmake nodejs gcc python3
git clone --recurse-submodules https://github.com/elalish/manifold.git
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
cd ..
source ./emsdk/emsdk_env.sh
cd manifold
mkdir buildWASM
cd buildWASM
emcmake cmake -DCMAKE_BUILD_TYPE=Release .. && emmake make

Error output:

[ 49%] Linking CXX executable manifold.js
cd /home/loosetooth/git/manifold/buildWASM/bindings/wasm && /usr/bin/cmake -E cmake_link_script CMakeFiles/manifoldjs.dir/link.txt --verbose=1
/home/loosetooth/git/emsdk/upstream/emscripten/em++ -O3 -DNDEBUG  -sALLOW_MEMORY_GROWTH=1 -fexceptions -sDISABLE_EXCEPTION_CATCHING=0 --pre-js /home/loosetooth/git/manifold/bindings/wasm/bindings.js --bind -sALLOW_TABLE_GROWTH=1 -sEXPORTED_RUNTIME_METHODS=addFunction,removeFunction -sMODULARIZE=1 -sEXPORT_ES6=1 @CMakeFiles/manifoldjs.dir/objects1.rsp -o manifold.js @CMakeFiles/manifoldjs.dir/linklibs.rsp
/home/loosetooth/git/emsdk/upstream/emscripten/tools/acorn-optimizer.js:25
    throw new Error(text);
    ^

Error: ObjectPattern
    at assert (/home/loosetooth/git/emsdk/upstream/emscripten/tools/acorn-optimizer.js:25:11)
    at /home/loosetooth/git/emsdk/upstream/emscripten/tools/acorn-optimizer.js:382:9
    at Array.forEach (<anonymous>)
    at handleFunction (/home/loosetooth/git/emsdk/upstream/emscripten/tools/acorn-optimizer.js:374:19)
    at Object.FunctionExpression (/home/loosetooth/git/emsdk/upstream/emscripten/tools/acorn-optimizer.js:453:9)
    at c (/home/loosetooth/git/emsdk/upstream/emscripten/tools/acorn-optimizer.js:85:20)
    at recursiveWalk (/home/loosetooth/git/emsdk/upstream/emscripten/tools/acorn-optimizer.js:87:5)
    at /home/loosetooth/git/emsdk/upstream/emscripten/tools/acorn-optimizer.js:83:38
    at maybeChild (/home/loosetooth/git/emsdk/upstream/emscripten/tools/acorn-optimizer.js:47:7)
    at visitChildren (/home/loosetooth/git/emsdk/upstream/emscripten/tools/acorn-optimizer.js:54:10)
em++: error: '/home/loosetooth/git/emsdk/node/16.20.0_64bit/bin/node /home/loosetooth/git/emsdk/upstream/emscripten/tools/acorn-optimizer.js /tmp/emscripten_temp_6y0yiggg/manifold.js AJSDCE minifyWhitespace --exportES6 -o /tmp/emscripten_temp_6y0yiggg/manifold.jso1.js' failed (returned 1)
make[2]: *** [bindings/wasm/CMakeFiles/manifoldjs.dir/build.make:111: bindings/wasm/manifold.js] Error 1
make[2]: Leaving directory '/home/loosetooth/git/manifold/buildWASM'
make[1]: *** [CMakeFiles/Makefile2:605: bindings/wasm/CMakeFiles/manifoldjs.dir/all] Error 2
make[1]: Leaving directory '/home/loosetooth/git/manifold/buildWASM'
make: *** [Makefile:139: all] Error 2
emmake: error: 'make' failed (returned 2)

It seems that the bug is in https://github.com/emscripten-core/emscripten/pull/20435/files#diff-ec87fe741c2d9f4342527583df7043c3cb656ed2b99e3e6e5f68f3c61afb12aa line 382, the param.type is ObjectPattern instead of Identifier.

Activity

  1. sbc100 commented on Nov 7, 2023

    @sbc100
    Collaborator

    I think this is a dup of #20631 and was fixed already in #20635

  2. pca006132 commented on Nov 7, 2023

    @pca006132
    Author

    ok thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions