Assertion failed: exceptfds not supported

214 views
Skip to first unread message

George

unread,
Jun 10, 2018, 3:04:03 PM6/10/18
to emscripten-discuss
I am trying to port my first project to emscripten, which is based on SDL2. I do get my screen displayed ok, but before I can move the mouse or use the keyboard I get the error message: "Assertion failed: exceptfds not supported"

Since I do not use sockets in my project, I do not know why I get this message. I searched my code, but "exceptfds" does not appear anywhere.

However, the javascript code generated, does include exceptfds:

function ___syscall142(which, varargs) {SYSCALLS.varargs = varargs;
  try {
   // newselect
      // readfds are supported,
      // writefds checks socket open status
      // exceptfds not supported
      // timeout is always 0 - fully async
      var nfds = SYSCALLS.get(), readfds = SYSCALLS.get(), writefds = SYSCALLS.get(), exceptfds = SYSCALLS.get(), timeout = SYSCALLS.get();
 
      assert(nfds <= 64, 'nfds must be less than or equal to 64');  // fd sets have 64 bits // TODO: this could be 1024 based on current musl headers
      assert(!exceptfds, 'exceptfds not supported');

So what can I do to work around this problem?

George

Alon Zakai

unread,
Jun 13, 2018, 6:52:19 PM6/13/18
to emscripten-discuss
The stack trace for that error should be helpful, in a debug build - you can see the full path of C/C++ code that ended up doing a syscall that expects exceptfd support to be present. Hopefully that code can then be changed to not be run or not use exceptfds.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

George

unread,
Jun 20, 2018, 4:01:51 PM6/20/18
to emscripten-discuss
Thank you Alon. The library I try to port contains a switch to use poll() instead of select(). If I now use poll() in <poll.h>, I do not get the exceptfds error any more. However, I get a "-12" message in the console window if I move the mouse over the application area. I also get this when I type a key. I do not know how to proceed. The graphics are displayed correctly but mouse or keyboard input result in "-12".

I try to base this library on SDL2 using -"s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1" and the "emscripten_sleep(1)" command when the library or application loops in an event loop. This worked well for small test applications.

George


Alon Zakai

unread,
Jun 21, 2018, 4:47:16 PM6/21/18
to emscripten-discuss
Sounds like that might be the same as


, see the ongoing discussion there.

George

unread,
Jun 23, 2018, 4:35:08 AM6/23/18
to emscripten-discuss
My problem is probably related. I also port a library within I use emscripten_sleep() commands to avoid that applications using this library have to change their event loop to emscripten_set_main_loop(). Up to now I thought my problems would be related to the following thread since it also mentions the -12 error code:  https://groups.google.com/forum/#!searchin/emscripten-discuss/emscripten_sleep_with_yield/emscripten-discuss/dR5KtlyXyHQ/CI9BjTXesGgJ

Is there any documentation anywhere what these error codes mean? I now changed my program and sometimes get "27". I already had "-1" and "-12" in the past. If have no clue what this means.

Since there seems to be no quick solution at the moment, I plan to change my project to use emscripten_set_main_loop() instead.

Now that I already put these emscripten_sleep() commands into my library and want to change to emscripten_set_main_loop() to get something working I have the following questions:

- can I leave the emscripten_sleep() commands in the library even when it is used with a program using emscripten_set_main_loop() or do I need to take them out? This way the library could be used with and without EMTERPRETIFY=1 / EMTERPRETIFY_ASYNC=1 setting by an application program. Does the emscripten_sleep() command have any effect when using emscripten_set_main_loop()? I thought it gives a time-slice to the browser.

- when compiling the files for the library and combining them with EMAR, do I need to use EMTERPRETIFY=1 / EMTERPRETIFY_ASYNC=1 when the library shall be used with an application that will use EMTERPRETIFY=1 / EMTERPRETIFY_ASYNC=1? And compile the library again without EMTERPRETIFY=1 / EMTERPRETIFY_ASYNC=1 if it shall be used with an application using emscripten_set_main_loop()?

George




Alon Zakai

unread,
Jun 25, 2018, 5:15:40 PM6/25/18
to emscripten-discuss
There should be an error text with those numbers - perhaps only when ASSERTIONS is on, though. It's a bug if there's no text in that case.

The -12 one for emterpreter-async is an exception which lacks a text. I think in the discussion in that issue that we may just be removing it anyhow.

I don't remember any special problems with sleep and the main loop - I seem to recall we pause the main loop for it. I'd search in the test suite, we should have not many tests for emscripten_sleep, and likely one will test the main loop.

Reply all
Reply to author
Forward
0 new messages