public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/27831] New: add-symbol-file, attach, print global-sym related assertion failure
@ 2021-05-07 23:55 kevinb at redhat dot com
  2023-06-21 13:10 ` [Bug symtab/27831] " pexu at sourceware dot mail.kapsi.fi
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: kevinb at redhat dot com @ 2021-05-07 23:55 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 27831
           Summary: add-symbol-file, attach, print global-sym related
                    assertion failure
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: kevinb at redhat dot com
  Target Milestone: ---

Created attachment 13424
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13424&action=edit
Test case for demonstrating OBJF_MAINLINE assertion when using
attach-symbol-file

Using the provided test case, do:

gcc -o add-symbol-file-attach -g add-symbol-file-attach.c
./add-symbol-file-attach &
pgrep -f add-symbol-file-attach
(A process ID will be printed here - remember it for use with attach command,
below)

gdb -q
add-symbol-file add-symbol-file-attach
y
attach <pid-of-add-symbol-file-attach-process>
y
print foo

At this point, GDB will show the assertion failure:

symtab.c:6417: internal-error: CORE_ADDR get_msymbol_address(objfile*, const
minimal_symbol*): Assertion `(objf->flags & OBJF_MAINLINE) == 0' failed.

Once you've exited from GDB, kill the test program with:

pkill -f add-symbol-file-attach

Here's a session showing the problem:

[kev@f33-1 tmp]$ gcc -o add-symbol-file-attach -g add-symbol-file-attach.c
[kev@f33-1 tmp]$ ./add-symbol-file-attach &
[1] 4103218
[kev@f33-1 tmp]$ pgrep -f add-symbol-file-attach
4103218
[kev@f33-1 tmp]$ /ironwood1/sourceware-git/f33-master/inst/bin/gdb -q
(gdb) add-symbol-file add-symbol-file-attach
add symbol table from file "add-symbol-file-attach"
(y or n) y
Reading symbols from add-symbol-file-attach...
(gdb) attach 4103218
Attaching to process 4103218
Load new symbol table from "/tmp/add-symbol-file-attach"? (y or n) y
Reading symbols from /tmp/add-symbol-file-attach...
Reading symbols from /lib64/libc.so.6...
(No debugging symbols found in /lib64/libc.so.6)
Reading symbols from /lib64/ld-linux-x86-64.so.2...
(No debugging symbols found in /lib64/ld-linux-x86-64.so.2)
0x00007f502130bf27 in pause () from /lib64/libc.so.6
(gdb) p foo
/ironwood1/sourceware-git/f33-master/bld/../../worktree-master/gdb/symtab.c:6417:
internal-error: CORE_ADDR get_msymbol_address(objfile*, const minimal_symbol*):
Assertion `(objf->flags & OBJF_MAINLINE) == 0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y

This is a bug, please report it.  For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.

/ironwood1/sourceware-git/f33-master/bld/../../worktree-master/gdb/symtab.c:6417:
internal-error: CORE_ADDR get_msymbol_address(objfile*, const minimal_symbol*):
Assertion `(objf->flags & OBJF_MAINLINE) == 0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) n
[kev@f33-1 tmp]$ pkill -f add-symbol-file-attach

I have a fix for this bug...

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-08-31 15:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-07 23:55 [Bug symtab/27831] New: add-symbol-file, attach, print global-sym related assertion failure kevinb at redhat dot com
2023-06-21 13:10 ` [Bug symtab/27831] " pexu at sourceware dot mail.kapsi.fi
2023-08-04 15:56 ` tromey at sourceware dot org
2023-08-05  2:42 ` kevinb at redhat dot com
2023-08-31 14:54 ` cvs-commit at gcc dot gnu.org
2023-08-31 14:54 ` cvs-commit at gcc dot gnu.org
2023-08-31 15:55 ` kevinb at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).