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

wasm-pack test fails with an error #4274

Closed
marcosadriano05 opened this issue Nov 16, 2024 · 8 comments
Closed

wasm-pack test fails with an error #4274

marcosadriano05 opened this issue Nov 16, 2024 · 8 comments
Labels

Comments

@marcosadriano05
Copy link

marcosadriano05 commented Nov 16, 2024

Describe the Bug

On a side project, i update the version of wasm-bindgen to 0.2.95 and wasm-bindgen-test to 0.3.45, but when i run wasm-pack test --target node, the output is:

$ wasm-pack test --node -r ./geo_helper/
[INFO]: 🎯  Checking for the Wasm target...
    Finished `release` profile [optimized] target(s) in 0.09s
[INFO]: ⬇️  Installing wasm-bindgen...
    Finished `release` profile [optimized] target(s) in 0.09s
     Running unittests src/lib.rs (target/wasm32-unknown-unknown/release/deps/geo_helper-465eda34574761e7.wasm)
Set timeout to 20 seconds...
running 3 tests                                   

Stacktrace:
    ptr1=0x2563fbfdb931
    ptr2=(nil)
    ptr3=(nil)
    ptr4=(nil)
    ptr5=(nil)
    ptr6=(nil)
    failure_message_object=0x7fff5e616ec0

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x170deb9]
    1: StubFrame [pc: 0x17a1f14]
Security context: 0x3288f78e5d39 <JSGlobalObject>
    2: /* anonymous */ [0x1229ec705219] [/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/wasm-bindgen-test.js:627] [bytecode=0x2563fbfee4e1 offset=0](this=0x3288f78c1131 <JSGlobalProxy>,0x2563fbfdb931 <Other heap object (WASM_INTERNAL_FUNCTION_TYPE)>,0x13191f041339 <null>,1114772)
    3: handleError [0x2bfa9eb0b841] [/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/wasm-bindgen-test.js:256] [bytecode=0x2563fbfe66e1 offset=8](this=0x3288f78c1131 <JSGlobalProxy>,0x1229ec705219 <JSFunction (sfi = 0x2563fbfd8679)>,0x1229ec7051f1 <Arguments map = 0x2e175678f5d9>)
    4: /* anonymous */ [0x2beb1d7fdcb9] [/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/wasm-bindgen-test.js:626] [bytecode=0x2563fbfd86e1 offset=10](this=0x3288f78c1131 <JSGlobalProxy>)
    5: WasmToJsFrame [pc: 0x35a66f5ec1ac]
    6: Wasm [wasm://wasm/geo_helper-465eda34574761e7.wasm-00151186], function #568 ('__wbg_call_3bfa248576352471 externref shim'), pc=0x35a66f583788 (+0xc8), pos=249175 (+17)
    7: Wasm [wasm://wasm/geo_helper-465eda34574761e7.wasm-00151186], function #438 ('js_sys::Function::call1::hb95161d718781f34'), pc=0x35a66f588220 (+0x60), pos=242060 (+18)
    8: Wasm [wasm://wasm/geo_helper-465eda34574761e7.wasm-00151186], function #147 ('wasmbindgentestcontext_run'), pc=0x35a66f5acf79 (+0x479), pos=165690 (+490)
    9: Wasm [wasm://wasm/geo_helper-465eda34574761e7.wasm-00151186], function #637 ('wasmbindgentestcontext_run externref shim'), pc=0x35a66f56d93d (+0x3d), pos=251027 (+9)
   10: JsToWasmFrame [pc: 0x170619f]
   11: run [0x2bfa9eb1a0e1] [/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/wasm-bindgen-test.js:412] [bytecode=0x2563fbfe82d1 offset=93](this=0x1229ec7015f1 <WasmBindgenTestContext map = 0x2e17567bde51>,0x1229ec7036b1 <JSArray[3]>)
   12: main [0xfdb10f23ef1] [/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs:45] [bytecode=0x2563fbfe78f1 offset=82](this=0x3288f78c1131 <JSGlobalProxy>,0x1229ec703449 <JSArray[3]>)
   13: /* anonymous */ [0xfdb10f23449] [/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs:55] [bytecode=0x315a8639dba1 offset=227](this=0x0fdb10f21641 <Object map = 0x2e1756782259>,0x0fdb10f21641 <Object map = 0x2e1756782259>,0x0fdb10f238d9 <JSFunction require (sfi = 0x315a8639e431)>,0x0fdb10f21439 <Module map = 0x2e17567aa081>,0x0fdb10f1fab9 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">,0x0fdb10f23809 <String[123]: "/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm">)
   14: _compile [0x3288f78d9a21] [node:internal/modules/cjs/loader:1356] [bytecode=0x315a8639bc89 offset=426](this=0x0fdb10f21439 <Module map = 0x2e17567aa081>,0x0fdb10f22931 <String[1894]: "...<truncated>>">,0x0fdb10f1fab9 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">)
   15: .js [0x3288f78d9031] [node:internal/modules/cjs/loader:1414] [bytecode=0x315a863980a1 offset=486](this=0x3288f78d8ed1 <Object map = 0x2e1756783e79>,0x0fdb10f21439 <Module map = 0x2e17567aa081>,0x0fdb10f1fab9 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">)
   16: load [0x3288f78d9a91] [node:internal/modules/cjs/loader:1197] [bytecode=0x315a86397231 offset=144](this=0x0fdb10f21439 <Module map = 0x2e17567aa081>,0x0fdb10f1fab9 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">)
   17: _load [0x3288f78d9609] [node:internal/modules/cjs/loader:1013] [bytecode=0x315a86393c01 offset=469](this=0x3288f78d8c91 <JSFunction Module (sfi = 0x31d70e457aa9)>,0x0fdb10f16729 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">,0x13191f041339 <null>,0x13191f041729 <true>)
   18: runMain(aka executeUserEntryPoint) [0x3288f78ffb69] [node:internal/modules/run_main:128] [bytecode=0x315a8638ff01 offset=87](this=0x3288f78d8c91 <JSFunction Module (sfi = 0x31d70e457aa9)>,0x0fdb10f16729 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">)
   19: /* anonymous */(aka /* anonymous */) [0xfdb10f072e1] [node:internal/main/run_main_module:28] [bytecode=0x315a86385541 offset=112](this=0x13191f0415b9 <undefined>,0x3288f78c2ef1 <process map = 0x2e17567a8f11>,0x3288f78c3661 <JSFunction requireBuiltin (sfi = 0x1d710f24fc59)>,0x3288f78c35e1 <JSFunction internalBinding (sfi = 0x1d710f24f211)>,0x06e05184ec29 <Object map = 0x2e17567a66d9>)
   20: InternalFrame [pc: 0x169051c]
   21: EntryFrame [pc: 0x1690243]

==== Details ================================================

[0]: ExitFrame [pc: 0x170deb9]
[1]: StubFrame [pc: 0x17a1f14]
[2]: /* anonymous */ [0x1229ec705219] [/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/wasm-bindgen-test.js:627] [bytecode=0x2563fbfee4e1 offset=0](this=0x3288f78c1131 <JSGlobalProxy>,0x2563fbfdb931 <Other heap object (WASM_INTERNAL_FUNCTION_TYPE)>,0x13191f041339 <null>,1114772) {
  // expression stack (top to bottom)
  [01] : 0x13191f0415b9 <undefined>
  [00] : 0x13191f0415b9 <undefined>
--------- s o u r c e   c o d e ---------
function (arg0, arg1, arg2) {\x0a    const ret = arg0.call(arg1, arg2);\x0a    return ret;\x0a}
-----------------------------------------
}

[3]: handleError [0x2bfa9eb0b841] [/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/wasm-bindgen-test.js:256] [bytecode=0x2563fbfe66e1 offset=8](this=0x3288f78c1131 <JSGlobalProxy>,0x1229ec705219 <JSFunction (sfi = 0x2563fbfd8679)>,0x1229ec7051f1 <Arguments map = 0x2e175678f5d9>) {
  // expression stack (top to bottom)
  [08] : 0x3288f78c1131 <JSGlobalProxy>
  [07] : 0x2563fbfdb931 <Other heap object (WASM_INTERNAL_FUNCTION_TYPE)>
  [06] : 0x13191f041339 <null>
  [05] : 1114772
  [04] : 0x13191f0415b9 <undefined>
  [03] : 0x13191f0415b9 <undefined>
  [02] : 0x3288f78d12f9 <JSFunction apply (sfi = 0x31d70e4776a9)>
  [01] : 0x2bfa9eb0b3c1 <FunctionContext[30]>
  [00] : 0x13191f0415b9 <undefined>
--------- s o u r c e   c o d e ---------
function handleError(f, args) {\x0a    try {\x0a        return f.apply(this, args);\x0a    } catch (e) {\x0a        const idx = addToExternrefTable0(e);\x0a        wasm.__wbindgen_exn_store(idx);\x0a    }\x0a}
-----------------------------------------
}

[4]: /* anonymous */ [0x2beb1d7fdcb9] [/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/wasm-bindgen-test.js:626] [bytecode=0x2563fbfd86e1 offset=10](this=0x3288f78c1131 <JSGlobalProxy>) {
  // expression stack (top to bottom)
  [05] : 0x3288f78c1131 <JSGlobalProxy>
  [04] : 0x1229ec705219 <JSFunction (sfi = 0x2563fbfd8679)>
  [03] : 0x1229ec7051f1 <Arguments map = 0x2e175678f5d9>
  [02] : 0x1229ec705219 <JSFunction (sfi = 0x2563fbfd8679)>
  [01] : 0x2bfa9eb0b841 <JSFunction handleError (sfi = 0x2beb1d7e9791)>
  [00] : 0x1229ec7051f1 <Arguments map = 0x2e175678f5d9>
--------- s o u r c e   c o d e ---------
function () { return handleError(function (arg0, arg1, arg2) {\x0a    const ret = arg0.call(arg1, arg2);\x0a    return ret;\x0a}, arguments) }
-----------------------------------------
}

[5]: WasmToJsFrame [pc: 0x35a66f5ec1ac]
[6]: Wasm [wasm://wasm/geo_helper-465eda34574761e7.wasm-00151186], function #568 ('__wbg_call_3bfa248576352471 externref shim'), pc=0x35a66f583788 (+0xc8), pos=249175 (+17)

[7]: Wasm [wasm://wasm/geo_helper-465eda34574761e7.wasm-00151186], function #438 ('js_sys::Function::call1::hb95161d718781f34'), pc=0x35a66f588220 (+0x60), pos=242060 (+18)

[8]: Wasm [wasm://wasm/geo_helper-465eda34574761e7.wasm-00151186], function #147 ('wasmbindgentestcontext_run'), pc=0x35a66f5acf79 (+0x479), pos=165690 (+490)

[9]: Wasm [wasm://wasm/geo_helper-465eda34574761e7.wasm-00151186], function #637 ('wasmbindgentestcontext_run externref shim'), pc=0x35a66f56d93d (+0x3d), pos=251027 (+9)

[10]: JsToWasmFrame [pc: 0x170619f]
[11]: run [0x2bfa9eb1a0e1] [/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/wasm-bindgen-test.js:412] [bytecode=0x2563fbfe82d1 offset=93](this=0x1229ec7015f1 <WasmBindgenTestContext map = 0x2e17567bde51>,0x1229ec7036b1 <JSArray[3]>) {
  // expression stack (top to bottom)
  [11] : 0x2bfa9eb37ab1 <Object map = 0x2e17567bcfb1>
  [10] : 1114768
  [09] : 1114784
  [08] : 3
  [07] : 3
  [06] : 1114784
  [05] : 1114768
  [04] : 0x2bfa9eb37ab1 <Object map = 0x2e17567bcfb1>
  [03] : 0x2563fbfdc0c9 <JSFunction js-to-wasm:iii:n (sfi = 0x2563fbfdc091)>
  [02] : 0x13191f0415b9 <undefined>
  [01] : 3
  [00] : 1114784
--------- s o u r c e   c o d e ---------
function run(tests) {\x0a        if (this.__wbg_ptr == 0) throw new Error('Attempt to use a moved value');\x0a        _assertNum(this.__wbg_ptr);\x0a        const ptr0 = passArrayJsValueToWasm0(tests, wasm.__wbindgen_malloc);\x0a        const len0 = WASM_VECTOR_LEN;\x0a        const ret = wasm.wasmbindgentestcontext_run(this....

-----------------------------------------
}

[12]: main [0xfdb10f23ef1] [/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs:45] [bytecode=0x2563fbfe78f1 offset=82](this=0x3288f78c1131 <JSGlobalProxy>,0x1229ec703449 <JSArray[3]>) {
  // expression stack (top to bottom)
  [09] : 0x1229ec7015f1 <WasmBindgenTestContext map = 0x2e17567bde51>
  [08] : 0x1229ec7036b1 <JSArray[3]>
  [07] : 0x1229ec703651 <JSFunction (sfi = 0x2563fbfe7819)>
  [06] : 0x0fdb10f08ce9 <JSArray[2]>
  [05] : 0x1229ec7036b1 <JSArray[3]>
  [04] : 0x1229ec7015f1 <WasmBindgenTestContext map = 0x2e17567bde51>
  [03] : 0x2bfa9eb1a0e1 <JSFunction run (sfi = 0x2beb1d7ea3e1)>
  [02] : 0x0fdb10f23eb1 <FunctionContext[6]>
  [01] : 0x13191f0415b9 <undefined>
  [00] : 0x1229ec703589 <JSAsyncFunctionObject>
--------- s o u r c e   c o d e ---------
function main(tests) {\x0a            // Forward runtime arguments. These arguments are also arguments to the\x0a            // `wasm-bindgen-test-runner` which forwards them to node which we\x0a            // forward to the test harness. this is basically only used for test\x0a            // filters for now.\x0a            cx...

-----------------------------------------
}

[13]: /* anonymous */ [0xfdb10f23449] [/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs:55] [bytecode=0x315a8639dba1 offset=227](this=0x0fdb10f21641 <Object map = 0x2e1756782259>,0x0fdb10f21641 <Object map = 0x2e1756782259>,0x0fdb10f238d9 <JSFunction require (sfi = 0x315a8639e431)>,0x0fdb10f21439 <Module map = 0x2e17567aa081>,0x0fdb10f1fab9 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">,0x0fdb10f23809 <String[123]: "/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm">) {
  // heap-allocated locals
  var exit = 0x3288f78c6f09 <JSFunction exit (sfi = 0xaa01f690db1)>
  var wasm = 0x156c467be2c1 <Object map = 0x2e17567bcff9>
  var handlers = 0x1229ec701239 <Object map = 0x2e17567bdfb9>
  var cx = 0x1229ec7015f1 <WasmBindgenTestContext map = 0x2e17567bde51>
  // expression stack (top to bottom)
  [08] : 0x3288f78c1131 <JSGlobalProxy>
  [07] : 0x1229ec703449 <JSArray[3]>
  [06] : 0x315a8639d6c9 <String[50]: #__wbgt_point_in_polygon_with_two_intern_polygons_2>
  [05] : 0x156c467be2c1 <Object map = 0x2e17567bcff9>
  [04] : 0x3288f78c38c1 <JSFunction push (sfi = 0x31d70e47f3d1)>
  [03] : 0x3288f78c1151 <NativeContext[271]>
  [02] : 0x1229ec703449 <JSArray[3]>
  [01] : 0x0fdb10f23ef1 <JSFunction main (sfi = 0x315a8639d919)>
  [00] : 0x1229ec701271 <JSFunction wrap (sfi = 0x315a8639d969)>
--------- s o u r c e   c o d e ---------
function \x0a        const { exit } = require('node:process');\x0a        const wasm = require('./wasm-bindgen-test.js');\x0a\x0a        \x0aconst handlers = {};\x0a\x0aconst wrap = method => {\x0a    const og = console[method];\x0a    const on_method = `on_console_${method}`;\x0a    console[method] = function (...args) {\x0a        og.appl...

-----------------------------------------
}

[14]: _compile [0x3288f78d9a21] [node:internal/modules/cjs/loader:1356] [bytecode=0x315a8639bc89 offset=426](this=0x0fdb10f21439 <Module map = 0x2e17567aa081>,0x0fdb10f22931 <String[1894]: "...<truncated>>">,0x0fdb10f1fab9 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">) {
  // expression stack (top to bottom)
  [24] : 0x0fdb10f21641 <Object map = 0x2e1756782259>
  [23] : 0x0fdb10f21641 <Object map = 0x2e1756782259>
  [22] : 0x0fdb10f238d9 <JSFunction require (sfi = 0x315a8639e431)>
  [21] : 0x0fdb10f21439 <Module map = 0x2e17567aa081>
  [20] : 0x0fdb10f1fab9 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">
  [19] : 0x0fdb10f23809 <String[123]: "/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm">
  [18] : 0x13191f0415b9 <undefined>
  [17] : 0x13191f0415b9 <undefined>
  [16] : 0x13191f0415b9 <undefined>
  [15] : 0x0fdb10f23e91 <JSArray[5]>
  [14] : 0x0fdb10f23e91 <JSArray[5]>
  [13] : 0x0fdb10f21641 <Object map = 0x2e1756782259>
  [12] : 0x0fdb10f23449 <JSFunction (sfi = 0x315a8639d861)>
  [11] : 0x3288f78c3aa1 <JSFunction apply (sfi = 0x31d70e4798c9)>
  [10] : 0x0fdb10f21439 <Module map = 0x2e17567aa081>
  [09] : 0x0fdb10f21641 <Object map = 0x2e1756782259>
  [08] : 0x0fdb10f21641 <Object map = 0x2e1756782259>
  [07] : 0x13191f0415b9 <undefined>
  [06] : 0x0fdb10f238d9 <JSFunction require (sfi = 0x315a8639e431)>
  [05] : 0x0fdb10f23809 <String[123]: "/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm">
  [04] : 0x13191f041339 <null>
  [03] : 0x0fdb10f23449 <JSFunction (sfi = 0x315a8639d861)>
  [02] : 0x13191f0415b9 <undefined>
  [01] : 0x13191f0415b9 <undefined>
  [00] : 0x13191f0415b9 <undefined>
--------- s o u r c e   c o d e ---------
function (content, filename) {\x0a  let moduleURL;\x0a  let redirects;\x0a  const manifest = policy()?.manifest;\x0a  if (manifest) {\x0a    moduleURL = pathToFileURL(filename);\x0a    redirects = manifest.getDependencyMapper(moduleURL);\x0a    manifest.assertIntegrity(moduleURL, content);\x0a  }\x0a\x0a  const compiledWrapper = wrapSafe...

-----------------------------------------
}

[15]: .js [0x3288f78d9031] [node:internal/modules/cjs/loader:1414] [bytecode=0x315a863980a1 offset=486](this=0x3288f78d8ed1 <Object map = 0x2e1756783e79>,0x0fdb10f21439 <Module map = 0x2e17567aa081>,0x0fdb10f1fab9 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">) {
  // expression stack (top to bottom)
  [22] : 0x0fdb10f21439 <Module map = 0x2e17567aa081>
  [21] : 0x0fdb10f22931 <String[1894]: "...<truncated>>">
  [20] : 0x0fdb10f1fab9 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">
  [19] : 0x13191f0415b9 <undefined>
  [18] : 0x13191f0415b9 <undefined>
  [17] : 0x0cd5e0d48759 <String[4]: #utf8>
  [16] : 0x0cd5e0d42549 <String[3]: #.js>
  [15] : 0x3288f78da5f9 <Object map = 0x2e175678aa79>
  [14] : 0x3288f78d9a21 <JSFunction Module._compile (sfi = 0x31d70e458791)>
  [13] : 0x13191f0415b9 <undefined>
  [12] : 0x13191f0415b9 <undefined>
  [11] : 0x13191f0415b9 <undefined>
  [10] : 0x13191f0415b9 <undefined>
  [09] : 0x13191f0415b9 <undefined>
  [08] : 0x13191f0415b9 <undefined>
  [07] : 0x13191f0415b9 <undefined>
  [06] : 0x13191f0415b9 <undefined>
  [05] : 0x13191f0415b9 <undefined>
  [04] : 0x13191f0415b9 <undefined>
  [03] : 0x13191f0415b9 <undefined>
  [02] : 0x13191f0415b9 <undefined>
  [01] : 0x0fdb10f22931 <String[1894]: "...<truncated>>">
  [00] : 0x13191f0415b9 <undefined>
--------- s o u r c e   c o d e ---------
function (module, filename) {\x0a  // If already analyzed the source, then it will be cached.\x0a  const cached = cjsParseCache.get(module);\x0a  let content;\x0a  if (cached?.source) {\x0a    content = cached.source;\x0a    cached.source = undefined;\x0a  } else {\x0a    content = fs.readFileSync(filename, 'utf8');\x0a  }\x0a  if (Strin...

-----------------------------------------
}

[16]: load [0x3288f78d9a91] [node:internal/modules/cjs/loader:1197] [bytecode=0x315a86397231 offset=144](this=0x0fdb10f21439 <Module map = 0x2e17567aa081>,0x0fdb10f1fab9 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">) {
  // expression stack (top to bottom)
  [10] : 0x3288f78d8ed1 <Object map = 0x2e1756783e79>
  [09] : 0x0fdb10f21439 <Module map = 0x2e17567aa081>
  [08] : 0x0fdb10f1fab9 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">
  [07] : 0x3288f78c90c9 <Object map = 0x2e17567861a1>
  [06] : 0x0fdb10f21d39 <String[123]: "/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm">
  [05] : 0x315a86393659 <String[4]: #.mjs>
  [04] : 0x3288f78d8ed1 <Object map = 0x2e1756783e79>
  [03] : 0x3288f78d9031 <JSFunction Module._extensions..js (sfi = 0x31d70e458821)>
  [02] : 0x13191f0415b9 <undefined>
  [01] : 0x13191f0415b9 <undefined>
  [00] : 0x0cd5e0d42549 <String[3]: #.js>
--------- s o u r c e   c o d e ---------
function (filename) {\x0a  debug('load %j for module %j', filename, this.id);\x0a\x0a  assert(!this.loaded);\x0a  this.filename = filename;\x0a  this.paths = Module._nodeModulePaths(path.dirname(filename));\x0a\x0a  const extension = findLongestRegisteredExtension(filename);\x0a  // allow .mjs to be overridden\x0a  if (StringPrototype...

-----------------------------------------
}

[17]: _load [0x3288f78d9609] [node:internal/modules/cjs/loader:1013] [bytecode=0x315a86393c01 offset=469](this=0x3288f78d8c91 <JSFunction Module (sfi = 0x31d70e457aa9)>,0x0fdb10f16729 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">,0x13191f041339 <null>,0x13191f041729 <true>) {
  // expression stack (top to bottom)
  [21] : 0x0fdb10f21439 <Module map = 0x2e17567aa081>
  [20] : 0x0fdb10f1fab9 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">
  [19] : 0x13191f0415b9 <undefined>
  [18] : 0x13191f0415b9 <undefined>
  [17] : 0x13191f041729 <true>
  [16] : 0x3288f78d9a91 <JSFunction Module.load (sfi = 0x31d70e458619)>
  [15] : 0x3288f78d8371 <FunctionContext[124]>
  [14] : 0x3288f78d9ae9 <JSFunction Module.require (sfi = 0x31d70e458689)>
  [13] : 0x3288f78e4d31 <Object map = 0x2e1756783e79>
  [12] : 0x13191f0415b9 <undefined>
  [11] : 0x13191f0415b9 <undefined>
  [10] : 0x13191f0415b9 <undefined>
  [09] : 0x13191f0415b9 <undefined>
  [08] : 0x13191f0415b9 <undefined>
  [07] : 0x13191f0415b9 <undefined>
  [06] : 0x13191f0415b9 <undefined>
  [05] : 0x13191f0415b9 <undefined>
  [04] : 0x13191f041729 <true>
  [03] : 0x0fdb10f21439 <Module map = 0x2e17567aa081>
  [02] : 0x13191f0415b9 <undefined>
  [01] : 0x0fdb10f1fab9 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">
  [00] : 0x13191f0415b9 <undefined>
--------- s o u r c e   c o d e ---------
function (request, parent, isMain) {\x0a  let relResolveCacheIdentifier;\x0a  if (parent) {\x0a    debug('Module._load REQUEST %s parent: %s', request, parent.id);\x0a    // Fast path for (lazy loaded) modules in the same directory. The indirect\x0a    // caching is required to allow cache invalidation without changing the...

-----------------------------------------
}

[18]: runMain(aka executeUserEntryPoint) [0x3288f78ffb69] [node:internal/modules/run_main:128] [bytecode=0x315a8638ff01 offset=87](this=0x3288f78d8c91 <JSFunction Module (sfi = 0x31d70e457aa9)>,0x0fdb10f16729 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">) {
  // expression stack (top to bottom)
  [12] : 0x3288f78d8c91 <JSFunction Module (sfi = 0x31d70e457aa9)>
  [11] : 0x0fdb10f16729 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">
  [10] : 0x13191f041339 <null>
  [09] : 0x13191f041729 <true>
  [08] : 0x13191f041729 <true>
  [07] : 0x13191f041339 <null>
  [06] : 0x0fdb10f16729 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">
  [05] : 0x3288f78d8c91 <JSFunction Module (sfi = 0x31d70e457aa9)>
  [04] : 0x3288f78d9609 <JSFunction Module._load (sfi = 0x31d70e458479)>
  [03] : 0x3288f78d8c91 <JSFunction Module (sfi = 0x31d70e457aa9)>
  [02] : 0x13191f041789 <false>
  [01] : 0x0fdb10f1fab9 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">
  [00] : 0x0fdb10f16729 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">
--------- s o u r c e   c o d e ---------
function executeUserEntryPoint(main = process.argv[1]) {\x0a  const resolvedMain = resolveMainPath(main);\x0a  const useESMLoader = shouldUseESMLoader(resolvedMain);\x0a  if (useESMLoader) {\x0a    runMainESM(resolvedMain || main);\x0a  } else {\x0a    // Module._load is the monkey-patchable CJS module loader.\x0a    const { Module } = require('inte...

-----------------------------------------
}

[19]: /* anonymous */(aka /* anonymous */) [0xfdb10f072e1] [node:internal/main/run_main_module:28] [bytecode=0x315a86385541 offset=112](this=0x13191f0415b9 <undefined>,0x3288f78c2ef1 <process map = 0x2e17567a8f11>,0x3288f78c3661 <JSFunction requireBuiltin (sfi = 0x1d710f24fc59)>,0x3288f78c35e1 <JSFunction internalBinding (sfi = 0x1d710f24f211)>,0x06e05184ec29 <Object map = 0x2e17567a66d9>) {
  // expression stack (top to bottom)
  [09] : 0x3288f78d8c91 <JSFunction Module (sfi = 0x31d70e457aa9)>
  [08] : 0x0fdb10f16729 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">
  [07] : 0x315a863852d9 <String[27]: #internal/modules/cjs/loader>
  [06] : 0x3288f78d8c91 <JSFunction Module (sfi = 0x31d70e457aa9)>
  [05] : 0x3288f78ffb69 <JSFunction executeUserEntryPoint (sfi = 0x31d70e46c051)>
  [04] : 0x0fdb10f16729 <String[131]: c"/home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/wbg-tmp-geo_helper-465eda34574761e7.wasm/run.cjs">
  [03] : 0x3288f78c84b1 <JSFunction getOptionValue (sfi = 0x294a2954a9a1)>
  [02] : 0x06e051842151 <JSFunction markBootstrapComplete (sfi = 0x31d70e465f41)>
  [01] : 0x06e0518420a1 <JSFunction prepareMainThreadExecution (sfi = 0x31d70e4651a9)>
  [00] : 0x3288f78c3ad9 <JSBoundFunction (BoundTargetFunction 0x3288f78c36e9)>
--------- s o u r c e   c o d e ---------
function 'use strict';\x0a\x0aconst { RegExpPrototypeExec } = primordials;\x0a\x0aconst {\x0a  prepareMainThreadExecution,\x0a  markBootstrapComplete,\x0a} = require('internal/process/pre_execution');\x0aconst { getOptionValue } = require('internal/options');\x0a\x0aconst mainEntry = prepareMainThreadExecution(true);\x0a\x0amarkBootstrapComple...

-----------------------------------------
}

[20]: InternalFrame [pc: 0x169051c]
[21]: EntryFrame [pc: 0x1690243]
=====================

error: test failed, to rerun pass `--lib`

Caused by:
  process didn't exit successfully: `/home/marcos/.cache/.wasm-pack/wasm-bindgen-46a41f966b4cfc69/wasm-bindgen-test-runner /home/marcos/Documentos/projetos/delivery/geo_helper/target/wasm32-unknown-unknown/release/deps/geo_helper-465eda34574761e7.wasm` (signal: 5, SIGTRAP: trace/breakpoint trap)
Error: Running Wasm tests with wasm-bindgen-test failed
Caused by: Running Wasm tests with wasm-bindgen-test failed
Caused by: failed to execute `cargo test`: exited with exit status: 101
  full command: cd "./geo_helper/" && CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER="/home/marcos/.cache/.wasm-pack/wasm-bindgen-46a41f966b4cfc69/wasm-bindgen-test-runner" WASM_BINDGEN_TEST_ONLY_NODE="1" "cargo" "test" "--release" "--target" "wasm32-unknown-unknown"

Steps to Reproduce

  1. Open the project's root directory
  2. Run wasm-pack test --target node -r ./geo_helper/

The link to repository with the code : repo

Cargo.toml

[package]
name = "geo-helper"
version = "0.2.0"
edition = "2021"

[lib]
crate-type = ["cdylib"]

[profile.release]
codegen-units = 1
incremental = true
lto = true
opt-level = "z"

[dependencies]
wasm-bindgen = { version = "=0.2.95", features = ["serde-serialize"] }
serde-wasm-bindgen = "0.6.5"
serde = { version = "1.0.215", features = ["derive"] }
serde_json = "1.0.132"
geo = "0.29.1"

[dev-dependencies]
wasm-bindgen-test = "0.3.45"

Exemple of a wasm-bindgen-test test of the project

#[cfg(test)]
pub mod tests {
  use super::*;
  use wasm_bindgen_test::*;

  #[wasm_bindgen_test]
  fn point_in_polygon_with_no_intern_polygons() {
    let point = PointJs { x: 25.0, y: 34.0 };
    let point_js = serde_wasm_bindgen::to_value(&point).unwrap();
    let polygon = PolygonJs {
      exterior: vec![
        PointJs { x: 30.0, y: 20.0 },
        PointJs { x: 45.0, y: 40.0 },
        PointJs { x: 10.0, y: 40.0 },
        PointJs { x: 30.0, y: 20.0 },
      ],
      interiors: vec![],
    };
    let polygon_js = serde_wasm_bindgen::to_value(&polygon).unwrap();
    assert_eq!(is_point_in_polygon(point_js, polygon_js.clone()), Ok(true));
    let point = PointJs { x: 10.0, y: 10.0 };
    let point_js = serde_wasm_bindgen::to_value(&point).unwrap();
    assert_eq!(is_point_in_polygon(point_js, polygon_js), Ok(false));
  }
}

Expected Behavior

In the past, when i run with wasm-bindgen version 0.2.92 and wasm-bindgen-test version 0.3.41 it works.

Actual Behavior

The command wasm-pack test --target node fails with the versions specified.

Additional Context

  • rustup 1.27.1
  • rustc 1.82.0
  • wasm-pack 0.13.1
  • wasm-bindgen 0.2.95
  • wasm-bindgen-test 0.3.45
@marcosadriano05 marcosadriano05 changed the title wasm-pack test fails wasm-pack test fails with an error Nov 16, 2024
@daxpedda
Copy link
Collaborator

I think this is an issue with serde-wasm-bindgen, so you have to ask there.
Let me know if you can reproduce this issue without external dependencies.

@daxpedda daxpedda closed this as not planned Won't fix, can't repro, duplicate, stale Nov 17, 2024
@gthb
Copy link
Contributor

gthb commented Nov 22, 2024

My project does not use serde-wasm-bindgen and also has this error breaking our CI job. That CI job previously succeeded on Oct 18, and now fails after just a git commit --allow-empty from that commit, so identical working tree.

Here's the GH actions job configuration up to the step that failed:

    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Apply CI caching
      uses: Swatinem/rust-cache@v2
    - name: Install wasm-pack
      run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
    - name: Test (WebAssembly in Node)
      run: wasm-pack test --node waspiary

That rust-cache step did restore a cache entry in the Oct 18 build:

  Cache Paths:
      /home/runner/.cargo
      /home/runner/work/Waspiary/Waspiary/target

... and didn't in today's build (I guess the cache entry expired), so I can't completely rule out that the actual regression occurred earlier than Oct 18 and just didn't take effect in that build (but it strikes me as unlikely).

The Cargo.lock file is in the repo so all dependencies other than the OS, Rust and wasm-pack ought to be unchanged.

Here's a diff of the raw Github Actions logs (skipping definitely irrelevant changes like the temp directory name and git SHA and branch name), showing the OS and Rust differences (sadly the wasm-pack version does not appear in the output):

--- succeeded.txt	2024-11-22 10:17:49
+++ failed.txt	2024-11-22 10:17:59
@@ -6,9 +6,9 @@
 ##[endgroup]
 ##[group]Runner Image
 Image: ubuntu-22.04
-Version: 20241015.1.0
-Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20241015.1/images/ubuntu/Ubuntu2204-Readme.md
-Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20241015.1
+Version: 20241117.1.0
+Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20241117.1/images/ubuntu/Ubuntu2204-Readme.md
+Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20241117.1
 ##[endgroup]
 ##[group]Runner Image Provisioner
 2.0.384.1
@@ -301,13 +301,13 @@
     /home/runner/.cargo
     /home/runner/work/Waspiary/Waspiary/target
 Restore Key:
-    v0-rust-test-wasm-and-upload-pkg-0338b651
+    v0-rust-test-wasm-and-upload-pkg-1d484091
 Cache Key:
-    v0-rust-test-wasm-and-upload-pkg-0338b651-0d2aaad4
+    v0-rust-test-wasm-and-upload-pkg-1d484091-0d2aaad4
 .. Prefix:
   - v0-rust-test-wasm-and-upload-pkg
 .. Environment considered:
-  - Rust Version: 1.81.0 x86_64-unknown-linux-gnu (eeb90cda1969383f56a2637cbd3037bdf598841c)
+  - Rust Version: 1.82.0 x86_64-unknown-linux-gnu (f6e511eec7342f59a25f7c0534f1dbea00d01b14)
   - CARGO_INCREMENTAL
 .. Lockfiles considered:
   - /home/runner/work/Waspiary/Waspiary/Cargo.lock

... and then the failing run compiles a bunch of things that weren't compiled in the successful run because of the caching. Then it's just:

Stacktrace:
    ptr1=0x183802bd54b1
    ptr2=(nil)
    ptr3=(nil)
    ptr4=(nil)
    ptr5=(nil)
    ptr6=(nil)
    failure_message_object=0x7ffc9d568670

etc., instead of the test wasm::* ... ok lines.

Can't reproduce locally with the same Rust version and same wasm-pack version (but I'm on an Apple Silicon Mac, so different CPU architecture).

@gthb
Copy link
Contributor

gthb commented Nov 22, 2024

This went away for me when I updated my CI job to install Rust 1.81.0 with rustup (the current ubuntu-latest includes Rust 1.82.0).

So this appears to be a regression in wasm-pack (or wasm-bindgen-test ... or Node?) introduced by Rust 1.82.0.

@gthb
Copy link
Contributor

gthb commented Nov 22, 2024

This also went away for me when I tried keeping Rust 1.82.0 and instead adding:

    - uses: actions/setup-node@v4
      with:
        node-version: '22'

Then also tried:

    steps:
    - uses: actions/setup-node@v4
      with:
        node-version: '20'

and that worked as well.

Then tried:

    steps:
    - uses: actions/setup-node@v4
      with:
        node-version: '18'

and that fails with the Node crash, unsurprisingly because it installs the exact same version 18.20.5 of Node as is in ubuntu-latest (that image being less than a month old.

So I've seen this wasm-pack test --node crash with Node 18.20.5 (in the ubuntu-latest CI runner) with Rust 1.82.0, but with no other combination of Node and Rust versions.

So it appears that Rust 1.82.0 changes the wasm output to include something that makes Node 18.20.5 crash, and that crash weakness is fixed in the current Node 20 and 22 versions.

@gthb
Copy link
Contributor

gthb commented Nov 22, 2024

Oh, and I can reproduce this locally, simply by running nvm install v18.20.5 first.

@kozabrada123
Copy link

Hi, our project has the same issue; on rustc 1.81.0 the tests run fine, but they break in the same way on 1.82.0, as described in #4274 (comment)

however, we don't run our tests with node but in firefox (or chrome, same issue) instead: GECKODRIVER=$(which geckodriver) cargo test --target wasm32-unknown-unknown

kozabrada123 added a commit to polyphony-chat/chorus that referenced this issue Nov 23, 2024
@morenol
Copy link
Contributor

morenol commented Nov 25, 2024

Got same issue in https://github.com/smartcorelib/smartcore

@daxpedda
Copy link
Collaborator

If you find that your project suddenly fails when updating to Rust v1.82, see #4211 for more information.

To summarize: Rust/LLVM now enable the reference type proposal by default, so your toolchain has to support that as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants