Bug 17876 - internal-error: go_symbol_package_name: Assertion `SYMBOL_LANGUAGE (sym) == language_go' failed.
Summary: internal-error: go_symbol_package_name: Assertion `SYMBOL_LANGUAGE (sym) == l...
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: go (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 14.1
Assignee: Tom Tromey
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-25 18:23 UTC by Jan Kratochvil
Modified: 2023-02-18 00:21 UTC (History)
2 users (show)

See Also:
Host:
Target: x86_64-linux-gnu
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kratochvil 2015-01-25 18:23:26 UTC
(gdb) file docker
Reading symbols from docker...done.
(gdb) tb *_start
Temporary breakpoint 1 at 0x73a7b0
(gdb) run
Starting program: /usr/bin/docker 
[...]
go-lang.c:403: internal-error: go_symbol_package_name: Assertion `SYMBOL_LANGUAGE (sym) == language_go' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Comment 1 Doug Evans 2015-01-26 01:46:31 UTC
The assert looks too aggressive,

=>gdb_assert (SYMBOL_LANGUAGE (sym) == language_go);

though go_symbol_package_name does expect a go symbol.

I'd say have the caller first check for a go symbol.
Comment 2 Tom Tromey 2023-02-17 00:59:05 UTC
I wrote the patch.
Comment 3 Sourceware Commits 2023-02-18 00:06:30 UTC
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e8eca7a6b602290bb3f50728432d524577ade727

commit e8eca7a6b602290bb3f50728432d524577ade727
Author: Tom Tromey <tom@tromey.com>
Date:   Thu Feb 16 17:52:07 2023 -0700

    Fix crash in go_symbol_package_name
    
    go_symbol_package_name package name asserts that it is only passed a
    Go symbol, but this is not enforced by one caller.  It seems simplest
    to just check and return early in this case.
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=17876
    Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Comment 4 Tom Tromey 2023-02-18 00:21:00 UTC
Fixed.