[llvm-bugs] [Bug 40762] New: Clang hangs with "too many errors emitted"

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 18 07:19:42 PST 2019


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

            Bug ID: 40762
           Summary: Clang hangs with "too many errors emitted"
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: theirix at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Created attachment 21488
  --> https://bugs.llvm.org/attachment.cgi?id=21488&action=edit
example

*Overview*

Clang hangs infinitely on a specific source code just after printing
diagnostics line:

fatal error: too many errors emitted, stopping now [-ferror-limit=]

The reproducing example unfortunately depends on boost::test. I think a bug is
actually caused by heaviness of boost::test. I checked the error with Boost
1.68 and Boost 1.62 from Debian.


*Steps to Reproduce*

1. Install boost headers - 1.68 works fine, 1.62 on Debian works too
(libboost-dev)

2. Compile attached file:

clang++ --std=c++11 -O0 -c main.cxx


*Actual Results*

1. Compiler gives an error and hangs (at least 30 minutes)


*Expected Results*

1. Should give error and exit with error code 


*Build Date & Hardware*

- Reproduced on Linux with 7.0.1 and 3.8.
- Reproduced on macOS with LLVM-provided clang 7.0.0 and apple-clang 10.0.0.
- GCC works fine.

Stacktrace when SIGINT-ed:

```
fatal error: too many errors emitted, stopping now [-ferror-limit=]
^C
Program received signal SIGINT, Interrupt.
0x00007ffff7bccb0a in __waitpid (pid=32641, stat_loc=0x7fffffffca14, options=0)
at ../sysdeps/unix/sysv/linux/waitpid.c:29
29      ../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
(gdb) bt
#0  0x00007ffff7bccb0a in __waitpid (pid=32641, stat_loc=0x7fffffffca14,
options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
#1  0x0000000001cea90f in llvm::sys::Wait(llvm::sys::ProcessInfo const&,
unsigned int, bool, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*) ()
#2  0x0000000001ce9837 in llvm::sys::ExecuteAndWait(llvm::StringRef,
llvm::ArrayRef<llvm::StringRef>, llvm::Optional<llvm::ArrayRef<llvm::StringRef>
>, llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, unsigned int, unsigned
int, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) ()
#3  0x000000000216bc22 in
clang::driver::Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const ()
#4  0x0000000002141ab5 in
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const ()
#5  0x0000000002141d8a in
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
()
#6  0x000000000215782b in
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) ()
#7  0x00000000009326ef in main ()
(gdb)%
```

-- 
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/20190218/5bd901e4/attachment.html>


More information about the llvm-bugs mailing list