Skip to content
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

more than one touch asserts emscripten_set_touchmove_callback callback #12826

Open
lpotter opened this issue Nov 19, 2020 · 4 comments
Open

more than one touch asserts emscripten_set_touchmove_callback callback #12826

lpotter opened this issue Nov 19, 2020 · 4 comments

Comments

@lpotter
Copy link

lpotter commented Nov 19, 2020

More than one active touch crashes emscripten_set_touchmove_callback
(no other callbacks crash)

Using 2.0.9 with this simple example:
`
#include
#include <emscripten/html5.h>

EM_BOOL touchmove_callback(int, EmscriptenTouchEvent const touchEvent, void) {
static int i = 0;
std::cout << touchEvent->numTouches << std::endl;
return EM_FALSE;
}

int main(int const, char const* const []) {
emscripten_set_touchmove_callback("#canvas", nullptr, 1, touchmove_callback);
return 0;
}
`

@lpotter lpotter changed the title more than one touch asserts emscripten_set_touchmove_callback more than one touch asserts emscripten_set_touchmove_callback callback Nov 19, 2020
@kripken
Copy link
Member

kripken commented Nov 19, 2020

What error do you see?

That program doesn't seem to compile - it is missing at least #include iostream, but even with that it errors for me on a few things, starting with error: 'void' must be the first and only parameter if specified.

Also I assume this needs some pattern of input to trigger the bug - it would be good if the testcase can create events to cause the bug automatically.

@lpotter
Copy link
Author

lpotter commented Nov 20, 2020

Actually, the iostream is there when I edit that description, but seems to be hidden by the html, as are the * in the appropriate places in the function arguments.
It does not seem to let me attach .cpp file.

Not sure how I would code simple 'two fingers touch on touchscreen'.
One finger works fine, as does 1.39.8. Other callbacks work fine with more than one finger point too.

Here is the console message:

Assertion failed: undefined em_touch.html:1246:19 printErr http://192.168.1.123:8000/em_touch.html:1246 abort http://192.168.1.123:8000/em_touch.js:1392 assert http://192.168.1.123:8000/em_touch.js:588 touchEventHandlerFunc http://192.168.1.123:8000/em_touch.js:1851 jsEventHandler http://192.168.1.123:8000/em_touch.js:1788 (Async: EventListener.handleEvent) registerOrRemoveHandler http://192.168.1.123:8000/em_touch.js:1797 __registerTouchEventCallback http://192.168.1.123:8000/em_touch.js:1910 _emscripten_set_touchmove_callback_on_thread http://192.168.1.123:8000/em_touch.js:1913 http://192.168.1.123:8000/em_touch.wasm:4055 createExportWrapper http://192.168.1.123:8000/em_touch.js:1454 callMain http://192.168.1.123:8000/em_touch.js:5144 doRun http://192.168.1.123:8000/em_touch.js:5208 run http://192.168.1.123:8000/em_touch.js:5219 (Async: setTimeout handler) run http://192.168.1.123:8000/em_touch.js:5215 runCaller http://192.168.1.123:8000/em_touch.js:5122 removeRunDependency http://192.168.1.123:8000/em_touch.js:1377 receiveInstance http://192.168.1.123:8000/em_touch.js:1520 receiveInstantiatedSource http://192.168.1.123:8000/em_touch.js:1536 (Async: promise callback) instantiateAsync http://192.168.1.123:8000/em_touch.js:1559 (Async: promise callback) instantiateAsync http://192.168.1.123:8000/em_touch.js:1557 createWasm http://192.168.1.123:8000/em_touch.js:1584 http://192.168.1.123:8000/em_touch.js:4873 Uncaught Error: undefined em_touch.js:1403:11 abort http://192.168.1.123:8000/em_touch.js:1403 assert http://192.168.1.123:8000/em_touch.js:588 touchEventHandlerFunc http://192.168.1.123:8000/em_touch.js:1851 jsEventHandler http://192.168.1.123:8000/em_touch.js:1788 (Async: EventListener.handleEvent) registerOrRemoveHandler http://192.168.1.123:8000/em_touch.js:1797 __registerTouchEventCallback http://192.168.1.123:8000/em_touch.js:1910 _emscripten_set_touchmove_callback_on_thread http://192.168.1.123:8000/em_touch.js:1913 http://192.168.1.123:8000/em_touch.wasm:4055 createExportWrapper http://192.168.1.123:8000/em_touch.js:1454 callMain http://192.168.1.123:8000/em_touch.js:5144 doRun http://192.168.1.123:8000/em_touch.js:5208 run http://192.168.1.123:8000/em_touch.js:5219 (Async: setTimeout handler) run http://192.168.1.123:8000/em_touch.js:5215 runCaller http://192.168.1.123:8000/em_touch.js:5122 removeRunDependency http://192.168.1.123:8000/em_touch.js:1377 receiveInstance http://192.168.1.123:8000/em_touch.js:1520 receiveInstantiatedSource http://192.168.1.123:8000/em_touch.js:1536 (Async: promise callback) instantiateAsync http://192.168.1.123:8000/em_touch.js:1559 (Async: promise callback) instantiateAsync http://192.168.1.123:8000/em_touch.js:1557 createWasm http://192.168.1.123:8000/em_touch.js:1584 http://192.168.1.123:8000/em_touch.js:4873

@yymrennie
Copy link

I got the same problem but for me it occurs on single touches as well, and seemingly occurs on all touch events. I hit the same asserts as mentioned in bug #14064. This was tested on a Windows 10 tablet using Emscripten 2.0.25 and was tested on Firefox 90.0 and Edge 91.0.864.70 with the problem happening on both.

For the moment we've disabled assertions to work around this but it isn't an ideal solution.

@adam4235
Copy link

adam4235 commented Mar 9, 2022

As mentioned in #14064, I think this might be fixed now?

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

4 participants