[llvm-bugs] [Bug 41857] New: Clang frontend crash when using -o /dev/null with wasm

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 13 04:27:43 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=41857

            Bug ID: 41857
           Summary: Clang frontend crash when using -o /dev/null with wasm
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: justin at postgresql.org
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Created attachment 21942
  --> https://bugs.llvm.org/attachment.cgi?id=21942&action=edit
Bugpoint simplified bitcode which the crash happens with

Stumbled on an unexpected bug with clang when using -o /dev/null, that seems to
happen only when generating for wasm:

************

$ clang --compile -v --target=wasm32-unknown-unknown-wasm -o /dev/null
bugpoint-reduced-simplified.ll
clang version 8.0.1 (https://git.llvm.org/git/clang.git
0a125120dc2ee0fe914542b605996bebaf0b8e9a) (https://git.llvm.org/git/llvm.git
45a188afecbea2d2409cc282bdb91bf58da8b0c8)
Target: wasm32-unknown-unknown-wasm
Thread model: single
InstalledDir: /opt/llvm8/bin
 "/opt/llvm8/bin/clang-8" -cc1 -triple wasm32-unknown-unknown-wasm -emit-obj
-mrelax-all -disable-free -disable-llvm-verifier -discard-value-names
-main-file-name bugpoint-reduced-simplified.ll -mrelocation-model static
-mthread-model single -masm-verbose -mconstructor-aliases -fuse-init-array
-target-cpu generic -fvisibility hidden -dwarf-column-info -debugger-tuning=gdb
-momit-leaf-frame-pointer -v -coverage-notes-file /dev/null.gcno -resource-dir
/opt/llvm8/lib/clang/8.0.1 -fdebug-compilation-dir
/home/jc/git_repos/src/github.com/tinygo-org/tinygo/src/examples/wasm/main
-ferror-limit 19 -fmessage-length 144 -fobjc-runtime=gnustep -fno-common
-fdiagnostics-show-option -fcolor-diagnostics -o /dev/null -x ir
bugpoint-reduced-simplified.ll
clang -cc1 version 8.0.1 based upon LLVM 8.0.1 default target
x86_64-unknown-linux-gnu
fatal error: error in backend: section size does not fit in a uint32_t
clang-8: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 8.0.1 (https://git.llvm.org/git/clang.git
0a125120dc2ee0fe914542b605996bebaf0b8e9a) (https://git.llvm.org/git/llvm.git
45a188afecbea2d2409cc282bdb91bf58da8b0c8)
Target: wasm32-unknown-unknown-wasm
Thread model: single
InstalledDir: /opt/llvm8/bin
clang-8: 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-8: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.

************

When giving any output filename (eg not /dev/null), the code generation works:

************

$ clang --compile -v --target=wasm32-unknown-unknown-wasm -o stuff
bugpoint-reduced-simplified.ll
clang version 8.0.1 (https://git.llvm.org/git/clang.git
0a125120dc2ee0fe914542b605996bebaf0b8e9a) (https://git.llvm.org/git/llvm.git
45a188afecbea2d2409cc282bdb91bf58da8b0c8)
Target: wasm32-unknown-unknown-wasm
Thread model: single
InstalledDir: /opt/llvm8/bin
 "/opt/llvm8/bin/clang-8" -cc1 -triple wasm32-unknown-unknown-wasm -emit-obj
-mrelax-all -disable-free -disable-llvm-verifier -discard-value-names
-main-file-name bugpoint-reduced-simplified.ll -mrelocation-model static
-mthread-model single -masm-verbose -mconstructor-aliases -fuse-init-array
-target-cpu generic -fvisibility hidden -dwarf-column-info -debugger-tuning=gdb
-momit-leaf-frame-pointer -v -coverage-notes-file
/home/jc/git_repos/src/github.com/tinygo-org/tinygo/src/examples/wasm/main/stuff.gcno
-resource-dir /opt/llvm8/lib/clang/8.0.1 -fdebug-compilation-dir
/home/jc/git_repos/src/github.com/tinygo-org/tinygo/src/examples/wasm/main
-ferror-limit 19 -fmessage-length 144 -fobjc-runtime=gnustep -fno-common
-fdiagnostics-show-option -fcolor-diagnostics -o stuff -x ir
bugpoint-reduced-simplified.ll
clang -cc1 version 8.0.1 based upon LLVM 8.0.1 default target
x86_64-unknown-linux-gnu

$ ls -la stuff
-rw-rw-r--. 1 jc jc 4090 May 13 21:21 stuff

************

Using /dev/null with non-wasm seems fine:

************

$ clang --compile -v -o /dev/null bugpoint-reduced-simplified.ll
clang version 8.0.1 (https://git.llvm.org/git/clang.git
0a125120dc2ee0fe914542b605996bebaf0b8e9a) (https://git.llvm.org/git/llvm.git
45a188afecbea2d2409cc282bdb91bf58da8b0c8)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/llvm8/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
 "/opt/llvm8/bin/clang-8" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj
-mrelax-all -disable-free -disable-llvm-verifier -discard-value-names
-main-file-name bugpoint-reduced-simplified.ll -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-dwarf-column-info -debugger-tuning=gdb -v -coverage-notes-file /dev/null.gcno
-resource-dir /opt/llvm8/lib/clang/8.0.1 -fdebug-compilation-dir
/home/jc/git_repos/src/github.com/tinygo-org/tinygo/src/examples/wasm/main
-ferror-limit 19 -fmessage-length 144 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -o /dev/null -x ir
bugpoint-reduced-simplified.ll -faddrsig
clang -cc1 version 8.0.1 based upon LLVM 8.0.1 default target
x86_64-unknown-linux-gnu
warning: overriding the module target triple with x86_64-unknown-linux-gnu
[-Woverride-module]
1 warning generated.

************

Attached is the bugpoint produced simplified bitcode file which this crash
happens on.  Hopefully helpful. :)

This may be related to the should-be-fixed bug here:
https://reviews.llvm.org/D57479

So, possibly a regression?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190513/1f8babe1/attachment.html>


More information about the llvm-bugs mailing list