Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

out of memory / unable to execute command: / clang frontend command failed due to signal #45523

Open Quuxplusone opened 4 years ago

Quuxplusone commented 4 years ago
Bugzilla Link PR46553
Status NEW
Importance P normal
Reported by Kinichiro Inoguchi (kinichiro.inoguchi@gmail.com)
Reported on 2020-07-02 05:06:56 -0700
Last modified on 2020-08-06 18:23:37 -0700
Version 8.0
Hardware PC OpenBSD
CC blitzrakete@gmail.com, brad@comstyle.com, dgregor@apple.com, dimitry@andric.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
I had encountered this while building JUCE (https://github.com/juce-
framework/JUCE).

* Clang version
--------------------------------------------------------------------------------
$ c++ --version
OpenBSD clang version 8.0.1 (tags/RELEASE_801/final) (based on LLVM 8.0.1)
Target: amd64-unknown-openbsd6.7
Thread model: posix
InstalledDir: /usr/bin
--------------------------------------------------------------------------------

* Error message
--------------------------------------------------------------------------------
...
  [ 37%] Building CXX object
  extras/Build/juceaide/CMakeFiles/juceaide.dir/__/__/__/modules/juce_gui_basics/juce_gui_basics.cpp.o

  LLVM ERROR: out of memory

  c++: error: unable to execute command: Abort trap (core dumped)

  c++: error: clang frontend command failed due to signal (use -v to see
  invocation)

  OpenBSD clang version 8.0.1 (tags/RELEASE_801/final) (based on LLVM 8.0.1)

  Target: amd64-unknown-openbsd6.7

  Thread model: posix

  InstalledDir: /usr/bin

  c++: note: diagnostic msg: PLEASE submit a bug report to
  http://llvm.org/bugs/ and include the crash backtrace, preprocessed source,
  and associated run script.

  c++: note: diagnostic msg:

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

  PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:

  Preprocessed source(s) and associated run script(s) are located at:

  c++: note: diagnostic msg: /tmp/juce_gui_basics-511356.cpp

  c++: note: diagnostic msg: /tmp/juce_gui_basics-511356.sh

  c++: note: diagnostic msg:

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

  *** Error 254 in .
  (extras/Build/juceaide/CMakeFiles/juceaide.dir/build.make:109
  'extras/Build/juceaide/CMakeFiles/juceaide.dir/__/__/__/modules/juce_gui_basics/juce_gui_basics.cpp.o')

  *** Error 2 in .  (CMakeFiles/Makefile2:153
  'extras/Build/juceaide/CMakeFiles/juceaide.dir/all': /usr/bin/make -s -f
  extras/Build/juceaide/CM...)

  *** Error 2 in /usr/obj/work2/juce/JUCE/cmake-build/tools (Makefile:150
  'all': /usr/bin/make -s -f CMakeFiles/Makefile2 all)

-- Configuring incomplete, errors occurred!
See also "/usr/obj/work2/juce/JUCE/cmake-build/CMakeFiles/CMakeOutput.log".
--------------------------------------------------------------------------------

* gdb bt info
--------------------------------------------------------------------------------
$ gdb /usr/bin/c++ ./cmake-build/tools/extras/Build/juceaide/c++.core
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-unknown-openbsd6.7"...
(no debugging symbols found)

Core was generated by `c++'.
Program terminated with signal 6, Aborted.
Reading symbols from /usr/lib/libpthread.so.26.1...done.
Loaded symbols for /usr/lib/libpthread.so.26.1
Reading symbols from /usr/lib/libc++.so.4.0...done.
Loaded symbols for /usr/lib/libc++.so.4.0
Reading symbols from /usr/lib/libc++abi.so.2.1...done.
Loaded symbols for /usr/lib/libc++abi.so.2.1
Symbols already loaded for /usr/lib/libpthread.so.26.1
Reading symbols from /usr/lib/libm.so.10.1...done.
Loaded symbols for /usr/lib/libm.so.10.1
Reading symbols from /usr/lib/libc.so.96.0...done.
Loaded symbols for /usr/lib/libc.so.96.0
Reading symbols from /usr/libexec/ld.so...Error while reading shared library
symbols:
Dwarf Error: wrong version in compilation unit header (is 4, should be 2) [in
module /usr/libexec/ld.so]
#0  thrkill () at -:3
3       -: No such file or directory.
        in -
(gdb) bt
#0  thrkill () at -:3
#1  0x00000002f589f49e in _libc_abort () at /usr/src/lib/libc/stdlib/abort.c:61
#2  0x00000000013caadb in __register_frame_info ()
#3  0x00000000013cab33 in __register_frame_info ()
Die: DW_TAG_unspecified_type (abbrev = 36, offset = 1157166)
        has children: FALSE
        attributes:
                DW_AT_name (DW_FORM_strp) string: "decltype(nullptr)"
Dwarf Error: Cannot find type of die [in module /usr/lib/libc++.so.4.0]
(gdb)
--------------------------------------------------------------------------------
Quuxplusone commented 4 years ago
Preprocessed source(s) and associated run script(s).
https://github.com/kinichiro/zynaddsubfx/files/4864152/juce_gui_basics-511356.zip
Quuxplusone commented 4 years ago
I tried this on FreeBSD, since I don't have an OpenBSD machine, with the llvm80
port, which also has clang version 8.0.1 (tags/RELEASE_801/final), so I had to
remove the non-standard -ret-protector command line option.

It compiled just fine, and took ~813 MiB of resident memory:

% /usr/bin/time -l clang80 -cc1 -triple amd64-unknown-openbsd6.7 -emit-obj -
mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-
name juce_gui_basics.cpp -mrelocation-model pic -pic-level 1 -pic-is-pie -
mthread-model posix -mdisable-fp-elim -relaxed-aliasing -masm-verbose -
mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-feature
+retpoline-indirect-calls -target-feature +retpoline-indirect-branches -dwarf-
column-info -debug-info-kind=limited -dwarf-version=2 -debugger-tuning=gdb -
coverage-notes-file /usr/obj/work2/juce/JUCE/cmake-
build/tools/extras/Build/juceaide/CMakeFiles/juceaide.dir/__/__/__/modules/juce_gui_basics/juce_gui_basics.cpp.gcno
-D DEBUG=1 -D JUCE_64BIT=1 -D JUCE_DISABLE_JUCE_VERSION_PRINTING=1 -D
JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED=1 -D
JUCE_MODULE_AVAILABLE_juce_build_tools=1 -D JUCE_MODULE_AVAILABLE_juce_core=1 -
D JUCE_MODULE_AVAILABLE_juce_data_structures=1 -D
JUCE_MODULE_AVAILABLE_juce_events=1 -D JUCE_MODULE_AVAILABLE_juce_graphics=1 -D
JUCE_MODULE_AVAILABLE_juce_gui_basics=1 -D JUCE_STANDALONE_APPLICATION=1 -D
JUCE_USE_CURL=0 -D _DEBUG=1 -O0 -Wall -Wshadow-all -Wshorten-64-to-32 -Wstrict-
aliasing -Wuninitialized -Wunused-parameter -Wconversion -Wsign-compare -Wint-
conversion -Wconditional-uninitialized -Woverloaded-virtual -Wreorder -
Wconstant-conversion -Wsign-conversion -Wunused-private-field -Wbool-conversion
-Wextra-semi -Wunreachable-code -Wzero-as-null-pointer-constant -Wcast-align -
Winconsistent-missing-destructor-override -Wshift-sign-overflow -Wnullable-to-
nonnull-conversion -Wno-missing-field-initializers -Wno-ignored-qualifiers -
Wswitch-enum -Wpedantic -fdeprecated-macro -ferror-limit 19 -fmessage-length 0 -
fwrapv -D_RET_PROTECTOR -fobjc-runtime=gnustep -fcxx-exceptions -fexceptions -
fdiagnostics-show-option -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-
realloc -fno-builtin-valloc -fno-builtin-free -fno-builtin-strdup -fno-builtin-
strndup -x c++ juce_gui_basics-511356.cpp -faddrsig
       27.40 real        19.79 user         0.77 sys
    833104  maximum resident set size
     21886  average shared memory size
        43  average unshared data size
       253  average unshared stack size
    196671  page reclaims
         3  page faults
         0  swaps
         3  block input operations
       175  block output operations
         0  messages sent
         0  messages received
         0  signals received
        11  voluntary context switches
      1136  involuntary context switches

Does your error go away if you remove -ret-protector? If so, the problem lies
in that OpenBSD specific addition. Otherwise, your machine may just be low on
memory?
Quuxplusone commented 4 years ago
Thanks for your investigation.
I'm running this OpenBSD on vm and it has 2GB RAM.
I had removed "-ret-protector" and tried again, but still fail with the same
error.
I'll try to see if there's another reason for this.
Quuxplusone commented 3 years ago

Kinichiro,

Please try out a -current snapshot. -current was just upgraded from 8 to 10. Let us know if there was any improvement.