On Fri, May 11, 2018 at 9:54 AM Scott Watson <wswat...@gmail.com> wrote:

> I've been struggling with an issue with embind.  I have a media player
> that I am building with emscripten.  Ultimately I need this to run as WASM,
> but I need pthreads.  While I've been waiting for pthread support in WASM,
> I've been building to asm.js and debugging.  Everything seems to be
> working, although the performance isn't great but that was expected.
>

I'm not too sure how embind is handled in multiple threads, will take a
peek shortly and refresh my memory...


> I'm getting to the point now where I want to test out WASM.  I am using
> the incoming branch of emscripten and the firefox nightly build.  However,
> when I use -s WASM=1 I get
>
> uncaught exception: BindingError: Cannot register public name '' twice
>
> The call stack looks like this:
>
> throwBindingError <- exposePublicSymbol <- __embind_register_enum
>
> So it looks like it trying to setup the binding for one of my enums.  I
> have a few enums.  The name of the enum is blank (""), so I can't tell
> which one it's crapping out on.
>
[snip]

>
>
>
> EMSCRIPTEN_BINDINGS(MediaPlayer) {
>
>   using namespace emscripten;
>
>   enum_<Arris::MediaPlayerState>("MediaPlayerState")
>   .value("PlayerStateStopped",
>  Arris::MediaPlayerState::PlayerStateStopped)
>
[snip]

Hmm, the 'name' seen in exposePublicSymbol should be the exported name
passed in explicitly from the bindings, which for these enum bindings is
'MediaPlayerState' etc. If you're seeing '' there, it's most likely that
there's a failure to extract the string from the heap, for instance by
having a pointer to a null byte, and it's happening multiple times (hence
discovering the conflict on the second symbol).

Is this happening on the main thread, in a worker, or both?

I'd recommend trimming down the code to try to produce a minimal test case
if you can; I can't seem to reproduce the error with just the bindings
given above, building for pthreads and starting a worker pool but not
actually running anything on them yet.

-- brion

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to