Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

libclang crash-recovery test fail #9221

Open Quuxplusone opened 13 years ago

Quuxplusone commented 13 years ago
Bugzilla Link PR8858
Status NEW
Importance P normal
Reported by Pawel Worach (pawel.worach@gmail.com)
Reported on 2010-12-25 16:14:29 -0800
Last modified on 2010-12-25 18:12:38 -0800
Version trunk
Hardware PC FreeBSD
CC daniel@zuster.org, dimitry@andric.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
llvm/clang r122550.

These three test fail on FreeBSD with a segfault.
Clang :: Index/crash-recovery-code-complete.c
Clang :: Index/crash-recovery.c
Clang :: Index/crash-recovery-reparse.c

Valgrind says:
> env LD_LIBRARY_PATH=/data/buildslave/freebsd-clang-amd64/obj/obj-
llvm.1/Release+Asserts/lib valgrind /data/buildslave/freebsd-clang-
amd64/obj/obj-llvm.1/Release+Asserts/bin/c-index-test -test-load-source all
/data/buildslave/freebsd-clang-amd64/src-llvm/tools/clang/test/Index/crash-recovery.c
==82744== Memcheck, a memory error detector
==82744== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==82744== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info
==82744== Command: /data/buildslave/freebsd-clang-amd64/obj/obj-
llvm.1/Release+Asserts/bin/c-index-test -test-load-source all
/data/buildslave/freebsd-clang-amd64/src-llvm/tools/clang/test/Index/crash-recovery.c
==82744==
==82744== Thread 3:
==82744== Invalid write of size 4
==82744==    at 0x13A387C: (anonymous
namespace)::PragmaDebugHandler::HandlePragma(clang::Preprocessor&,
clang::PragmaIntroducerKind, clang::Token&) (in /data/buildslave/freebsd-clang-
amd64/obj/obj-llvm.1/Release+Asserts/lib/libclang.so)
==82744==    by 0x13A32A8:
clang::PragmaNamespace::HandlePragma(clang::Preprocessor&,
clang::PragmaIntroducerKind, clang::Token&) (in /data/buildslave/freebsd-clang-
amd64/obj/obj-llvm.1/Release+Asserts/lib/libclang.so)
==82744==    by 0x13A32A8:
clang::PragmaNamespace::HandlePragma(clang::Preprocessor&,
clang::PragmaIntroducerKind, clang::Token&) (in /data/buildslave/freebsd-clang-
amd64/obj/obj-llvm.1/Release+Asserts/lib/libclang.so)
==82744==    by 0x139B82A: clang::Preprocessor::HandlePragmaDirective(unsigned
int) (in /data/buildslave/freebsd-clang-amd64/obj/obj-
llvm.1/Release+Asserts/lib/libclang.so)
==82744==    by 0x138BF8C: clang::Preprocessor::HandleDirective(clang::Token&)
(in /data/buildslave/freebsd-clang-amd64/obj/obj-
llvm.1/Release+Asserts/lib/libclang.so)
==82744==    by 0x137845B: clang::Lexer::LexTokenInternal(clang::Token&) (in
/data/buildslave/freebsd-clang-amd64/obj/obj-llvm.1/Release+Asserts/lib/libclang.so)
==82744==    by 0x137836B: clang::Lexer::LexTokenInternal(clang::Token&) (in
/data/buildslave/freebsd-clang-amd64/obj/obj-llvm.1/Release+Asserts/lib/libclang.so)
==82744==    by 0xF2F763: clang::Parser::ConsumeToken() (in
/data/buildslave/freebsd-clang-amd64/obj/obj-llvm.1/Release+Asserts/lib/libclang.so)
==82744==    by 0xF404D5:
clang::Parser::ExpectAndConsume(clang::tok::TokenKind, unsigned int, char
const*, clang::tok::TokenKind) (in /data/buildslave/freebsd-clang-amd64/obj/obj-
llvm.1/Release+Asserts/lib/libclang.so)
==82744==    by 0xF4C120:
clang::Parser::ParseDeclGroup(clang::Parser::ParsingDeclSpec&, unsigned int,
bool, clang::SourceLocation*) (in /data/buildslave/freebsd-clang-amd64/obj/obj-
llvm.1/Release+Asserts/lib/libclang.so)
==82744==    by 0xF5644E:
clang::Parser::ParseSimpleDeclaration(clang::ASTOwningVector<clang::Stmt*,
32u>&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, bool)
(in /data/buildslave/freebsd-clang-amd64/obj/obj-
llvm.1/Release+Asserts/lib/libclang.so)
==82744==    by 0xF56533:
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) (in /data/buildslave/freebsd-clang-
amd64/obj/obj-llvm.1/Release+Asserts/lib/libclang.so)
==82744==  Address 0x11 is not stack'd, malloc'd or (recently) free'd
==82744==
libclang: crash detected during parsing: {
  'source_filename' : '(null)'
  'command_line_args' : ['/data/buildslave/freebsd-clang-amd64/src-llvm/tools/clang/test/Index/crash-recovery.c'],
  'unsaved_files' : [],
  'options' : 1,
}
Unable to load translation unit!
==82744==
==82744== HEAP SUMMARY:
==82744==     in use at exit: 411,475 bytes in 300 blocks
==82744==   total heap usage: 572 allocs, 272 frees, 464,809 bytes allocated
==82744==
==82744== LEAK SUMMARY:
==82744==    definitely lost: 1,645 bytes in 6 blocks
==82744==    indirectly lost: 406,222 bytes in 258 blocks
==82744==      possibly lost: 0 bytes in 0 blocks
==82744==    still reachable: 3,608 bytes in 36 blocks
==82744==         suppressed: 0 bytes in 0 blocks
==82744== Rerun with --leak-check=full to see details of leaked memory
==82744==
==82744== For counts of detected and suppressed errors, rerun with: -v
==82744== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Quuxplusone commented 13 years ago
When the test is executed by lit this ends up in crash-recovery.c.tmp.err
Error: Segmentation fault: 11 (core dumped)
Quuxplusone commented 13 years ago
AFAIK this is a python problem in lit, where signals from child
processes are not processed correctly if the (python) parent is
threaded.  It may be FreeBSD-specific, but IIRC there were also reports
of other systems where threading and python can give problems.

A workaround is to run these tests single-threaded; I'm not sure if
there is a nice way to specify that only these tests should be run
single-threaded, but here on my machines I simply run all tests like
that.  Ugly, but works. :)