Summary: | sys-devel/gdb-7.5 - broken back trace | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | wbrana |
Component: | [OLD] Core system | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED INVALID | ||
Severity: | normal | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | http://sourceware.org/bugzilla/show_bug.cgi?id=14492 | ||
See Also: |
http://code.google.com/p/crack-language/issues/detail?id=103 http://sourceware.org/bugzilla/show_bug.cgi?id=14492 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
wbrana
2012-08-16 19:25:59 UTC
(In reply to comment #0) > when I try to debug crack, output from gdb doesn't make sense > see http://code.google.com/p/crack-language/issues/detail?id=103 Please attach/post all relevant information here. Also, the bug description is rather nondescript - we'll need to find something more specific. I tried to disassemble. There are things which don't make sense example according to gdb it crashes at instruction "test %eax,%eax" #10 0x0000038e3338d57f in operator< (other=..., this=<optimized out>) at debug/DebugTools.cc:41 0x0000038e3338d572 <+98>: 49 8b 74 24 20 mov 0x20(%r12),%rsi 0x0000038e3338d577 <+103>: 48 89 ef mov %rbp,%rdi 0x0000038e3338d57a <+106>: e8 f1 07 fe ff callq 0x38e3336dd70 <strcmp@plt> 0x0000038e3338d57f <+111>: 85 c0 test %eax,%eax 0x0000038e3338d581 <+113>: 78 2d js 0x38e3338d5b0 <(anonymous namespace)::lookUpString((anonymous namespace)::InternedString const&)+160> 0x0000038e3338d583 <+115>: 48 8b 54 24 08 mov 0x8(%rsp),%rdx 0x0000038e3338d588 <+120>: 64 48 33 14 25 28 00 00 00 xor %fs:0x28,%rdx 0x0000038e3338d591 <+129>: 49 8d 44 24 20 lea 0x20(%r12),%rax There are nonsensical addresses #3 0x00000000000205e0 in ?? () #6 0x0000000000000020 in ?? () Program received signal SIGSEGV, Segmentation fault. 0x0000038e342cbff9 in ?? () (gdb) bt #0 0x0000038e342cbff9 in ?? () #1 0x0000038e342e28da in ?? () #2 0x0000038e31d9ce60 in using_malloc_checking () from /lib64/libc.so.6 #3 0x00000000000205e0 in ?? () #4 0x0000004a6ffaac40 in ?? () #5 0x0000038e342d57d7 in ?? () #6 0x0000000000000020 in ?? () #7 0x0000038e31a92252 in __libc_calloc (n=<optimized out>, elem_size=<optimized out>) at malloc.c:4065 #8 0x0000038e342e0830 in ?? () #9 0x000003c61d4a1a00 in ?? () #10 0x0000038e3338d57f in operator< (other=..., this=<optimized out>) at debug/DebugTools.cc:41 #11 operator() (__y=..., __x=..., this=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/include/g++-v4/bits/stl_function.h:236 #12 find (this=0x38e3414eaa0, __k=...) at /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/include/g++-v4/bits/stl_tree.h:1539 #13 find (__x=..., this=0x38e3414eaa0) at /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/include/g++-v4/bits/stl_set.h:605 #14 (anonymous namespace)::lookUpString (key=...) at debug/DebugTools.cc:60 #15 0x0000038e3343c750 in builder::mvll::LLVMJitBuilder::run (this=0x38e342df6a9) at builder/llvm/LLVMJitBuilder.cc:217 #16 0x0000038e3343d297 in builder::mvll::LLVMJitBuilder::doRunOrDump (this=0x4a6fb69460, context=...) at builder/llvm/LLVMJitBuilder.cc:375 #17 0x0000038e3343ebb3 in builder::mvll::LLVMJitBuilder::innerCloseModule (this=0x4a6fb69460, context=..., moduleDef=0x4a6fc2e4a0) at builder/llvm/LLVMJitBuilder.cc:360 #18 0x0000038e3343f40d in recursiveClose (builder=<optimized out>, context=..., this=<optimized out>) at builder/llvm/BJitModuleDef.h:73 #19 closeOrDefer (builder=0x4a6fb69460, context=..., this=0x4a6fc2e4a0) at builder/llvm/BJitModuleDef.h:82 #20 builder::mvll::LLVMJitBuilder::closeModule (this=0x4a6fb69460, context=..., moduleDef=<optimized out>) at builder/llvm/LLVMJitBuilder.cc:383 #21 0x0000038e333cb327 in model::ModuleDef::close (this=0x4a6fc2e4a0, context=...) at model/ModuleDef.cc:48 #22 0x0000038e3339c916 in model::Construct::parseModule (this=0x4a6f7b8230, context=..., module=0x4a6fc2e4a0, path=..., src=...) at model/Construct.cc:397 #23 0x0000038e3339f2bc in model::Construct::loadModule (this=0x4a6f7b8230, moduleNameBegin="crack", moduleNameEnd=..., canonicalName=...) at model/Construct.cc:605 #24 0x0000038e333d7324 in parser::Parser::parseImportStmt (this=0x3c61d4a3020, ns=0x4a6fc14458) at parser/Parser.cc:2679 #25 0x0000038e333e439d in parser::Parser::parseStatement (this=0x3c61d4a3020, defsAllowed=true) at parser/Parser.cc:356 #26 0x0000038e333e477b in parser::Parser::parseBlock (this=0x3c61d4a3020, nested=false, closeEvent=parser::Parser::noCallbacks) at parser/Parser.cc:485 #27 0x0000038e333e4a36 in parser::Parser::parse (this=<optimized out>) at parser/Parser.cc:3396 #28 0x0000038e3339c90b in model::Construct::parseModule (this=0x4a6f7b8230, context=..., module=0x4a6fc14420, path=..., src=...) at model/Construct.cc:396 #29 0x0000038e3339d59b in model::Construct::runScript (this=0x4a6f7b8230, src=..., name="example/hello.crk") at model/Construct.cc:782 #30 0x0000038e3348a736 in Crack::runScript (this=0x3c61d4a3630, src=..., name="example/hello.crk") at Crack.cc:108 #31 0x0000004a6dd7b15a in main (argc=4, argv=0x3c61d4a3a78) at crack_main.cc:277 crash seems to be caused by null pointer dereference in strcmp (gdb) frame 10 #10 0x000003b9ef45257f in operator< (other=..., this=<optimized out>) at debug/DebugTools.cc:41 41 return strcmp(val, other.val) < 0; (gdb) info locals No locals. (gdb) p val value has been optimized out (gdb) p other $1 = (const (anonymous namespace)::InternedString &) @0x3b9ee636f00: {val = 0x0} (gdb) quit int strcmp (p1, p2) const char *p1; const char *p2; { register const unsigned char *s1 = (const unsigned char *) p1; register const unsigned char *s2 = (const unsigned char *) p2; unsigned reg_char c1, c2; do { c1 = (unsigned char) *s1++; c2 = (unsigned char) *s2++; if (c1 == '\0') return c1 - c2; } while (c1 == c2); return c1 - c2; } glibc was compiled with -ggdb, but there are no symbols in back trace crash doesn't happen if crack is compiled with -fno-PIE -fPIC compile crack trunk: hg clone https://crack-language.googlecode.com/hg/ crack-language cd crack-language ./bootstrap ./configure make paxctl -m .libs/crack debugging: $ ./crack_dbg -- -l lib example/hello.crk GNU gdb (Gentoo 7.5 p1) 7.5 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". For bug reporting instructions, please see: <http://bugs.gentoo.org/>... Reading symbols from /mnt/md3/cache/inst/crack-language/.libs/crack...done. (gdb) r Starting program: /mnt/md3/cache/inst/crack-language/.libs/crack -l lib example/hello.crk [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. $ gcc -v Reading specs from /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/specs COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.4/gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.4/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /mnt/md3/cache/portage/sys-devel/gcc-4.6.4/work/gcc-4.6-20120803/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.4 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.4 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.4/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.4/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --enable-lto --disable-nls --with-system-zlib --enable-obsolete --disable-werror --enable-secureplt --enable-multilib --disable-libmudflap --disable-libssp --enable-esp --disable-libgomp --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.6.4/python --enable-checking=release --disable-libgcj --disable-libquadmath --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo Hardened 4.6.4 p1.5, pie-0.5.2' Thread model: posix gcc version 4.6.4 20120803 (prerelease) (Gentoo Hardened 4.6.4 p1.5, pie-0.5.2) upstream bug http://sourceware.org/bugzilla/show_bug.cgi?id=14492 *** This bug has been marked as a duplicate of bug 428238 *** |