emscripten-core / emscripten-core/emscripten

Uncaught RuntimeError: unreachable from worker

Open
#18,840 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

**Version of emscripten/emsdk:**
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.32 (eab98adf462c39f3c31d348331c4830bcaa36949)
clang version 17.0.0 (https://github.com/llvm/llvm-project df82394e7a2d06506718cafa347bf7827c79fc4f)
Target: wasm32-unknown-emscripten
Thread model: posix

I am building [svt-av1](https://gitlab.com/AOMediaCodec/SVT-AV1) v1.4.1 for [ffmpeg](https://github.com/FFmpeg/FFmpeg) with emscripten 3.1.32. I managed to successfully compile to wasm, but during runtime (in browser worker), I am getting these exceptions:

![Clipboard01](https://user-images.githubusercontent.com/750041/221163503-0dd7b7c1-1641-403b-a619-0f2a0216a582.jpg) )

First I thought this might be related to large number of processes/workers being opened, however I can restrict the count to some reasonable ~20 which is tested safe with some other examples.

Here are my compilation flags, I think I am being generous with memory:

```
-s INITIAL_MEMORY=256mb
-s ALLOW_MEMORY_GROWTH=1
-s MAXIMUM_MEMORY=4gb
-s ENVIRONMENT=worker
-s PROXY_TO_PTHREAD=1
-s STACK_SIZE=10MB
-s DEFAULT_PTHREAD_STACK_SIZE=4MB
-pthread
```

...also `-msimd128` is being used.

At this point I am not sure this to which technology the error is related to (emscripten, webassembly, svtav1) but considering the error message (note attached screenshot) I will have hard time reporting error to svtav1 issue tracker and so decided to ask here first.

I would like to kindly ask the elders of the emscripten if this appears like something to be fixed on emscripten side?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.