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

CGAL freezes on boolean operations #21580

Open
Hedrig opened this issue Mar 21, 2024 · 3 comments
Open

CGAL freezes on boolean operations #21580

Hedrig opened this issue Mar 21, 2024 · 3 comments

Comments

@Hedrig
Copy link

Hedrig commented Mar 21, 2024

It seems that CGAL's boolean operation hang the browser indefinitely. This occurs from time to time seemingly at random. I have heard it's because CGAL's rounding modes are not imported correctly to WebAssembly. Is that true? Is there a way to use CGAL with Emscripten as to avoid the issue?

emcc -v output: emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.51 (c0c2ca1)
clang version 18.0.0git (https://github.com/llvm/llvm-project f2464ca317bfeeedddb7cbdea3c2c8ec487890bb)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /home/medal/projects/emsdk/upstream/bin

@sbc100
Copy link
Collaborator

sbc100 commented Mar 21, 2024

If you run with devtools open can you see what it happening when you such as hang?

I'm not sure what you mean by "rounding modes are not imported correctly to WebAssembly". Wasm doesn't support different rounding modes as of today but I don't see who that would cause browser hands, especially non-deterministic ones.

@Hedrig
Copy link
Author

Hedrig commented Apr 16, 2024

Okay, after researching the problem a while more, I have identified the problem. It seems that one of CGAL's operations is using recursion, which causes an unhandled stack overflow exception. I have two questions:

  1. Is it possible to increase Javascript stack size to prevent the exception?
  2. Is it possible to handle the exception given that it occurs within the Javascript runtime?

@sbc100
Copy link
Collaborator

sbc100 commented Apr 16, 2024

Here is some information on javascript stack overflows: https://humanwhocodes.com/blog/2009/05/19/javascript-stack-overflow-error/

Yes you can catch them, and no it not possible to control the stack size in the wild (You can do it with browser flag I suppose but that probably don't work for more folks).

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

2 participants