This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug record/21447] New: "Assertion `tp != NULL' failed" when trying to "record btrace" a multithreaded program


https://sourceware.org/bugzilla/show_bug.cgi?id=21447

            Bug ID: 21447
           Summary: "Assertion `tp != NULL' failed" when trying to "record
                    btrace" a multithreaded program
           Product: gdb
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: record
          Assignee: unassigned at sourceware dot org
          Reporter: b7.10110111 at gmail dot com
  Target Milestone: ---

Created attachment 10034
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10034&action=edit
Backtrace

Here's a test C++ program:

#include <string.h>
#include <thread>
int bar()
{
    char buf[10];
    memset(buf, 0, sizeof(buf));
    memset(buf, 'A', 100);  // overflow
}
int foo()
{
    return bar();
}
void mythread()
{
    for(volatile int x=0;x!=1;);
}
int main()
{
    std::thread thr(mythread);
    foo();
}

I compile it like follows on a 32-bit x86 gcc 4.5:
g++ test.cpp -o test -std=c++0x -pthread -g -fno-stack-protector

Then I run GDB as
gdb -q ./test -ex start -ex 'record btrace' -ex c

And get this output:

Temporary breakpoint 1, main () at test.cpp:19
19          std::thread thr(mythread);
Continuing.
record-btrace.c:1415: internal-error: void
record_btrace_fetch_registers(target_ops*, regcache*, int): Assertion `tp !=
NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.

Attached is a backtrace from the core generated by GDB for itself.

I was testing
* 32-bit x86 GDB 8.0.50.20170429-git and 7.10.50.20151205-cvs on LFS
* 64-bit x86_64 GDB 7.10.50.20151205-cvs on CLFS 1.2.0
CPU is Intel Core i7-4765T
Linux 3.12.18 64-bit

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]