-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Build stalls on massive autogenerated C files #23557
Comments
What pat of the process is failing? Is it compiling or linking? If it is linking (seems likely), what part of the link is failing? (You add |
It's the compiling process ( Here's the full command that's being run (as part of the makefile), if it helps:
|
In that case this is likely a clang issue since emcc will simply exec clang when compiling, and nothing more. Can you confirm that it is the clang process that is stalling and eating all your memory? Can you add Does compiling the same C file for a different |
Since the file in question has a huge amount of |
Could you perhaps attach the pre-processed |
re2c does have some options to reduce the number of gotos, I believe; may be worth me experimenting regenerating it w/ some of those options to see how it behaves. The parser.c I have is the same as the one in libpostal above - I'll see about getting my changes put into a repo here in a bit (they're relatively minimal, at the moment, isolated to the autoconf scripts.) I can also see about pulling it out to try to isolate it for testing.
|
To reproduce, pull my libpostal fork and run the following:
I'm still going to work on splitting out the parser, but in the mean time you can use this to get far enough into the build to where it gets unhappy. |
I've been experimenting with building various things with emscripten to relatively decent success, until recently.
The library in question is libpostal. After making a few changes (namely to have it use the clang webassembly SSE intrinsics, increasing the max wasm memory, etc), it hangs on building the enormous scanner.c - this file is autogenerated from re2c, but despite being enormous, non-emscripten builds take on the order of a few dozen seconds. Emscripten's build, however, steadily climbs in memory usage until its killed from OOM. I've thrown 200GB of memory at it and ran it overnight and it still never finished, eventually still dying to an OOM.
I can get the complexity of the file is quite high, but this still seems rather unusual, and I'm having trouble tracking down potential causes - I feel it may be a bug in the toolchain.
The text was updated successfully, but these errors were encountered: