Skip to content

Internal compiler error in src/compiler.js #20107

Open

Description

@goldwaving

Emscripten v3.1.44 on Windows 11.

Internal compiler error in src/compiler.js!
Please create a bug report at https://github.com/emscripten-core/emscripten/issues/
with a log of the build and the input files used to run. Exception message: "TypeError: sig.slice(...).replace is not a function
   at addFromLibrary (C:\Develop\emsdk-main\upstream\emscripten\src\jsifier.js:528:57)
   at symbolHandler (C:\Develop\emsdk-main\upstream\emscripten\src\jsifier.js:554:16)
   at symbolHandler (C:\Develop\emsdk-main\upstream\emscripten\src\jsifier.js:554:16)
   at Object.<anonymous> (C:\Develop\emsdk-main\upstream\emscripten\src\compiler.js:102:3
   at Module._compile (node:internal/modules/cjs/loader:1196:14)
   at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
   at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
   at Function.Module._load (node:internal/modules/cjs/loader:909:12)
   at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
   at node:internal/main/run_main_module:22:47

Maybe check length of sig is greater than 1 character?

Activity

  1. sbc100 commented on Aug 23, 2023

    @sbc100
    Collaborator

    Hmm.. but sig.slice(1) should always return a string even if sig is the empty string.

    > ''.slice(1).replace(/j/g, 'ii')
    ''
    

    Which leads me to believe that perhaps sig is perhaps some other type? Can add console.log(sig) and console.log(typeof sig) return before line 528 of jsifier.js?

  2. sbc100 commented on Aug 23, 2023

    @sbc100
    Collaborator

    Are you passing your own JS library files? (i.e. are you using --js-library?). Can you share your full link command?

  3. goldwaving commented on Aug 23, 2023

    @goldwaving
    ContributorAuthor

    Good catch. Turns out that one of my sigs was ['iiii'] instead of just 'iiii'. Perhaps there could be a check that sig is a string somewhere to avoid this kind of a compiler error.

  4. sbc100 commented on Aug 23, 2023

    @sbc100
    Collaborator

    Sounds like a good idea.

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