Skip to content

Bunch of Aborted(Assertion failed: exceptfds not supported) errors when running unoptimized code #19951

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

Closed
pd-l2ork opened this issue Aug 2, 2023 · 1 comment

Comments

@pd-l2ork
Copy link

pd-l2ork commented Aug 2, 2023

Hi alll,

I have a rather complex project, a visual programming environment, whose runtime I am trying to port to a browser. I am currently building on a project that partially works and am now trying to make it easier to debug. So, I tried rebuilding the project with a -g flag only to find out that while the project runs ok when compiled with -O3 flag (there are known issues that I am trying to fix, but it generally matches what the project I am building upon used to provide), when removing this flag (not even adding the -g flag instead), when running the code, I suddenly get a bunch of the main.js:56 Aborted(Assertion failed: exceptfds not supported) errors, as follows:

ain.js:56 Aborted(Assertion failed: exceptfds not supported)
printErr @ main.js:56
abort @ main.js:950
assert @ main.js:631
___syscall__newselect @ main.js:5420
$select @ main.wasm:0x28f3a7
$sys_domicrosleep @ main.wasm:0x15ce2e
$sys_pollgui @ main.wasm:0x15eb39
$libpd_process_float @ main.wasm:0x1aa664
$Pd::audioOut(unsigned char*, int) @ main.wasm:0xb90db
$Pd::forwardAudioOut(void*, unsigned char*, int) @ main.wasm:0xb6c3b
$HandleAudioProcess @ main.wasm:0x209500
dynCall @ main.js:1622
SDL2.audio.scriptProcessorNode.onaudioprocess @ main.js:1287
main.js:969 Uncaught RuntimeError: Aborted(Assertion failed: exceptfds not supported)
    at abort (main.js:969:11)
    at assert (main.js:631:5)
    at ___syscall__newselect (main.js:5420:7)
    at select (main.wasm:0x28f3a7)
    at sys_domicrosleep (main.wasm:0x15ce2e)
    at sys_pollgui (main.wasm:0x15eb39)
    at libpd_process_float (main.wasm:0x1aa664)
    at Pd::audioOut(unsigned char*, int) (main.wasm:0xb90db)
    at Pd::forwardAudioOut(void*, unsigned char*, int) (main.wasm:0xb6c3b)
    at HandleAudioProcess (main.wasm:0x209500)
abort @ main.js:969
assert @ main.js:631
___syscall__newselect @ main.js:5420
$select @ main.wasm:0x28f3a7
$sys_domicrosleep @ main.wasm:0x15ce2e
$sys_pollgui @ main.wasm:0x15eb39
$libpd_process_float @ main.wasm:0x1aa664
$Pd::audioOut(unsigned char*, int) @ main.wasm:0xb90db
$Pd::forwardAudioOut(void*, unsigned char*, int) @ main.wasm:0xb6c3b
$HandleAudioProcess @ main.wasm:0x209500
dynCall @ main.js:1622
SDL2.audio.scriptProcessorNode.onaudioprocess @ main.js:1287
main.js:56 Aborted(Assertion failed: exceptfds not supported)
printErr @ main.js:56
abort @ main.js:950
assert @ main.js:631
___syscall__newselect @ main.js:5420
$select @ main.wasm:0x28f3a7
$sys_domicrosleep @ main.wasm:0x15ce2e
$sys_pollgui @ main.wasm:0x15eb39
$libpd_process_float @ main.wasm:0x1aa664
$Pd::audioOut(unsigned char*, int) @ main.wasm:0xb90db
$Pd::forwardAudioOut(void*, unsigned char*, int) @ main.wasm:0xb6c3b
$HandleAudioProcess @ main.wasm:0x209500
dynCall @ main.js:1622
SDL2.audio.scriptProcessorNode.onaudioprocess @ main.js:1287
main.js:969 Uncaught RuntimeError: Aborted(Assertion failed: exceptfds not supported)
    at abort (main.js:969:11)
    at assert (main.js:631:5)
    at ___syscall__newselect (main.js:5420:7)
    at select (main.wasm:0x28f3a7)
    at sys_domicrosleep (main.wasm:0x15ce2e)
    at sys_pollgui (main.wasm:0x15eb39)
    at libpd_process_float (main.wasm:0x1aa664)
    at Pd::audioOut(unsigned char*, int) (main.wasm:0xb90db)
    at Pd::forwardAudioOut(void*, unsigned char*, int) (main.wasm:0xb6c3b)
    at HandleAudioProcess (main.wasm:0x209500)
abort @ main.js:969
assert @ main.js:631

I've never encountered something like this. To be fair this is the first time I am delving into the emscripten environment. Any thoughts what may be causing this?

It appears this has to do something with the ___syscall__newselect (which appears to mimic sys/select.h C version), and I saw somewhere earlier that exceptfds is not supported. Perhaps because this variable is not optimized out, it triggers the aforesaid error? The software in question does use network socket to separate front-end from the back-end, which does realtime DSP (mostly audio), and I definitely found some select calls sprinkled throughout the compiled source. How would one go about fixing this, so that I can get a version that can be more easily debugged?

Thank you for your help. @sbc100 is already partially familiar with this project through our discussion via the issue #11753

@pd-l2ork
Copy link
Author

pd-l2ork commented Aug 2, 2023

So, I think I figured it out. I found all select calls in the C code and made sure that it does not have a variable assigned to the exceptfds (made it into 0 instead). Now I can finally start debugging.

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

No branches or pull requests

1 participant