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

inlinable function call in a function with debug info must have a !dbg location #9797

Open
Beuc opened this issue Nov 7, 2019 · 7 comments
Open

Comments

@Beuc
Copy link
Contributor

@Beuc Beuc commented Nov 7, 2019

New issue with 1.39.2:

/xxx/emsdk/upstream/emscripten-git/emcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/xxx/scripts/../install/include -I/xxx/scripts/../install/include/SDL2 -s USE_SDL=2 -s USE_SDL_TTF=2 -I. -Isrc -I/xxx/python-emscripten/2.7.10/crosspython-static/include/python2.7 -c src/write_png.c -o emscripten-static/build-temp/src/write_png.o
inlinable function call in a function with debug info must have a !dbg location
  %malloccall = tail call i8* @malloc(i32 40)
inlinable function call in a function with debug info must have a !dbg location
  tail call void @free(i8* %66)
inlinable function call in a function with debug info must have a !dbg location
  %malloccall = tail call i8* @malloc(i32 40)
inlinable function call in a function with debug info must have a !dbg location
  tail call void @free(i8* %80)
fatal error: error in backend: Broken module found, compilation aborted!
clang-10: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 10.0.0 (/b/s/w/ir/cache/git/chromium.googlesource.com-external-github.com-llvm-llvm--project 2293b3f169a27232a9f208ae157517b96ff9a4f0)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /xxx/emsdk/upstream/bin
clang-10: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang-10: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-10: note: diagnostic msg: /tmp/write_png-19a706.c
clang-10: note: diagnostic msg: /tmp/write_png-19a706.sh
clang-10: note: diagnostic msg: 

********************
shared:ERROR: '/xxx/emsdk/upstream/bin/clang -target wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=39 -D__EMSCRIPTEN_tiny__=2 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -nostdsysteminc -Xclang -isystem/xxx/emsdk/upstream/emscripten-git/system/include/libcxx -Xclang -isystem/xxx/emsdk/upstream/emscripten-git/system/lib/libcxxabi/include -Xclang -isystem/xxx/emsdk/upstream/emscripten-git/system/include/compat -Xclang -isystem/xxx/emsdk/upstream/emscripten-git/system/include -Xclang -isystem/xxx/emsdk/upstream/emscripten-git/system/include/libc -Xclang -isystem/xxx/emsdk/upstream/emscripten-git/system/lib/libc/musl/arch/emscripten -Xclang -isystem/xxx/emsdk/upstream/emscripten-git/system/local/include -DNDEBUG -O3 -Wall -Wstrict-prototypes -I/xxx/scripts/../install/include -I/xxx/scripts/../install/include/SDL2 -I. -Isrc -I/xxx/python-emscripten/2.7.10/crosspython-static/include/python2.7 -c -DEMSCRIPTEN -g src/write_png.c -Xclang -isystem/xxx/emsdk/.emscripten_cache/wasm-obj/ports-builds/sdl2/include -Xclang -isystem/xxx/emsdk/.emscripten_cache/wasm-obj/ports-builds/freetype/include -c -o emscripten-static/build-temp/src/write_png.o -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr' failed (70)

Source: write_png-19a706.zip
and https://github.com/renpy/pygame_sdl2/blob/master/src/write_png.c

@kripken

This comment has been minimized.

Copy link
Member

@kripken kripken commented Nov 7, 2019

This is probably an upstream clang/llvm issue.

Does it also happen when building the file with that same clang natively?

@tlively I see tail calls in that IR message, and it says it crashes in the backend - was there a recent wasm backend change in that area?

@Beuc

This comment has been minimized.

Copy link
Contributor Author

@Beuc Beuc commented Nov 11, 2019

Does it also happen when building the file with that same clang natively?

When using upstream/bin/clang to generate a native .o using the same arguments, no issue.
The error occurs when using emcc.

@kripken

This comment has been minimized.

Copy link
Member

@kripken kripken commented Nov 11, 2019

Interesting. Ok, I tried to reproduce locally with the download you provided,

emcc  -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -s USE_SDL=2 -s USE_SDL_TTF=2 -o write_png.c write_png-19a706.c

(I had to remove a bunch of other flags from the above). I doesn't crash, though. That's on latest tot, perhaps this was fixed in LLVM meanwhile?

@andryblack

This comment has been minimized.

Copy link

@andryblack andryblack commented Nov 14, 2019

Have same issue with debug build on 1.39.2

emcc   -MMD -MP -DDEBUG  -O3 -g -s NO_EXIT_RUNTIME=1 -s STRICT=1 -s USE_WEBGL2=1 -Wno-undefined-var-template -s ENVIRONMENT='web' -s ALLOW_MEMORY_GROWTH=1 -s MALLOC='emmalloc' -s NO_DYNAMIC_EXECUTION=1 -s SAFE_HEAP=1 --emit-symbol-map  -o "png.o" -MF "png.d" -c "png.c"
inlinable function call in a function with debug info must have a !dbg location
  tail call void @free(i8* %11)
inlinable function call in a function with debug info must have a !dbg location
  tail call void @free(i8* %21)

ERROR: '/emsdk/upstream/bin/clang -target wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=39 -D__EMSCRIPTEN_tiny__=2 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -nostdsysteminc -Xclang -isystem/emsdk/upstream/emscripten/system/include/libcxx -Xclang -isystem/emsdk/upstream/emscripten/system/lib/libcxxabi/include -Xclang -isystem/emsdk/upstream/emscripten/system/include/compat -Xclang -isystem/emsdk/upstream/emscripten/system/include -Xclang -isystem/emsdk/upstream/emscripten/system/include/libc -Xclang -isystem/emsdk/upstream/emscripten/system/lib/libc/musl/arch/emscripten -Xclang -isystem/emsdk/upstream/emscripten/system/local/include -MMD -MP -DDEBUG -O3 -Wno-undefined-var-template -MF png.d -c -g png.c -Xclang -isystem/emsdk/upstream/emscripten/system/include/SDL -c -o 
png.o -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr' failed (70)

png-105a18.c

but success with release (different flags)

emcc   -MMD -MP -DNDEBUG  -O3 -s NO_EXIT_RUNTIME=1 -s STRICT=1 -s USE_WEBGL2=1 -Wno-undefined-var-template -s ENVIRONMENT='web' -s ALLOW_MEMORY_GROWTH=1 -s MALLOC='emmalloc' -s NO_DYNAMIC_EXECUTION=1 --emit-symbol-map -s ASSERTIONS=0 -s ABORTING_MALLOC=0 -s STACK_OVERFLOW_CHECK=0 -O2  -o "png.o" -MF "png.d" -c "png.c"
@kripken

This comment has been minimized.

Copy link
Member

@kripken kripken commented Nov 14, 2019

Thanks for the testcase @andryblack!

I don't see an error on latest tip of tree tot-upstream, so perhaps this has been fixed in upstream meanwhile. We tagged 1.39.3 earlier today, so that might already include the fix.

@Beuc

This comment has been minimized.

Copy link
Contributor Author

@Beuc Beuc commented Nov 14, 2019

1.39.3 fixes this issue for me (and introduces another - the Quest for the Stable Version continues ;)).

@andryblack

This comment has been minimized.

Copy link

@andryblack andryblack commented Nov 15, 2019

1.39.3 fixes issue for me too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.