Bug 26912 - "file" command causes core dump while specifying the executable on the command line does not
Summary: "file" command causes core dump while specifying the executable on the comman...
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: c++ (show other bugs)
Version: 10.1
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 27043 27365 28010 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-11-18 00:44 UTC by Jim
Modified: 2021-07-06 23:30 UTC (History)
7 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2021-07-02 00:00:00


Attachments
GDB core file (38.91 KB, multipart/archive)
2020-12-02 21:58 UTC, Aaron Carson
Details
attachment-3060292-0.html (926 bytes, text/html)
2021-07-03 17:25 UTC, Sam Warner
Details
attachment-977364-0.html (1.71 KB, text/html)
2021-07-03 18:35 UTC, Sam Warner
Details
attachment-3984744-0.html (2.89 KB, text/html)
2021-07-05 16:04 UTC, Sam Warner
Details
attachment-3064665-0.html (2.99 KB, text/html)
2021-07-06 01:18 UTC, Jonah Graham
Details
make check gdb-base/*.exp for the 'file' patch (4.54 KB, text/plain)
2021-07-06 23:30 UTC, Sam Warner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim 2020-11-18 00:44:11 UTC

    
Comment 1 Jim 2020-11-18 00:50:00 UTC
Using macOS Big Sur version 11.0.1 and clang version 12.0.0 with gdb 10.1 installed with brew.  I can debug a "hello world" app if I specify the executable in the command line.  However if I enter gdb and then pass it as an argument to the "file" command, gdb crashes with the following message: 

../../gdb/thread.c:95: internal-error: struct thread_info *inferior_thread(): Assertion `current_thread_ != nullptr' failed.
A problem internal to GDB has been detected,
Comment 2 Aaron Carson 2020-12-02 21:58:16 UTC
Created attachment 13022 [details]
GDB core file

Attaching result of "Create a core file of GDB? (y or n)" prompt of GDB cli after bug was encountered.
Comment 3 Aaron Carson 2020-12-02 22:03:27 UTC
Encountered identical issue on macOS Catalina 10.15.5 with gcc/g++ version 10.2.0 and gdb version 10.1, both installed with brew.  Was able to debug fine using "gdb filename", but using "gdb" and then in command prompt "file <filename>" causes same bug as described by Jim above.  This makes debugging with tools like Eclipse CDT or ddd impossible.
Comment 4 Simon Marchi 2020-12-02 22:06:31 UTC
Does the assert failure / crash happen when you do use the file command itself, or when you run after having used the file command?
Comment 5 Aaron Carson 2020-12-03 01:08:38 UTC
Yes, upon typing the file command itself.  Here is a snippet of the exact input and output from the cli prompt:

```
(gdb) file program
Reading symbols from program...
Reading symbols from /Users/aaron/code/eclipse/workspace/SetPointCompare/program.dSYM/Contents/Resources/DWARF/program...
../../gdb/thread.c:95: internal-error: struct thread_info *inferior_thread(): Assertion `current_thread_ != nullptr' 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/>.

../../gdb/thread.c:95: internal-error: struct thread_info *inferior_thread(): Assertion `current_thread_ != nullptr' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) y
Abort trap: 6
```
Comment 6 Simon Marchi 2020-12-03 17:07:09 UTC
I managed to attach with lldb and get this backtrace.  Note that I probably won't spend too much time on this as I am not a Mac user (I happen to have access through one via VNC, which is a bit painful to use).

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x3a)
  * frame #0: 0x0000000100906a57 gdb`bfd_get_file_size(abfd=0x00000001025224f0) at bfdio.c:489:11
    frame #1: 0x0000000100930d78 gdb`bfd_mach_o_scan(abfd=0x00000001025224f0, header=0x00007ffeefbfeec8, mdata=0x0000000103044218) at mach-o.c:5272:28
    frame #2: 0x00000001009308e1 gdb`bfd_mach_o_header_p(abfd=0x00000001025224f0, hdr_off=0, file_type=<no summary available>, cpu_type=BFD_MACH_O_CPU_TYPE_X86_64) at mach-o.c:5436:8
    frame #3: 0x0000000100926100 gdb`bfd_mach_o_x86_64_object_p(abfd=0x00000001025224f0) at mach-o-x86-64.c:35:10
    frame #4: 0x000000010090aeab gdb`bfd_check_format_matches(abfd=0x00000001025224f0, format=bfd_object, matching=0x0000000000000000) at format.c:343:17
    frame #5: 0x000000010090ab1f gdb`bfd_check_format(abfd=0x00000001025224f0, format=bfd_object) at format.c:94:10
    frame #6: 0x0000000100931a78 gdb`bfd_mach_o_fat_extract(abfd=0x0000000102522320, format=bfd_object, arch=0x0000000100c930e0) at mach-o.c:5737:7
    frame #7: 0x0000000100680b51 gdb`gdb_bfd_mach_o_fat_extract(abfd=0x0000000102522320, format=bfd_object, arch=0x0000000100c930e0) at solib-darwin.c:409:17
    frame #8: 0x00000001006807bd gdb`darwin_get_dyld_bfd() at solib-darwin.c:443:3
    frame #9: 0x00000001006800e4 gdb`darwin_solib_get_all_image_info_addr_at_init(info=0x0000000102522250) at solib-darwin.c:457:30
    frame #10: 0x000000010067f492 gdb`darwin_solib_create_inferior_hook(from_tty=1) at solib-darwin.c:515:5
    frame #11: 0x0000000100689169 gdb`solib_create_inferior_hook(from_tty=1) at solib.c:1211:3
    frame #12: 0x00000001006c67da gdb`symbol_file_command(args="test", from_tty=1) at symfile.c:1663:7
    frame #13: 0x0000000100322da7 gdb`file_command(arg="test", from_tty=1) at exec.c:536:3
    frame #14: 0x00000001001530e4 gdb`do_const_cfunc(c=0x0000000102257e20, args="test", from_tty=1) at cli-decode.c:107:3
    frame #15: 0x0000000100156cc4 gdb`cmd_func(cmd=0x0000000102257e20, args="test", from_tty=1) at cli-decode.c:1952:7
    frame #16: 0x00000001007657d1 gdb`execute_command(p="t", from_tty=1) at top.c:655:2
    frame #17: 0x000000010031c797 gdb`command_handler(command="") at event-top.c:588:7
    frame #18: 0x000000010031cdc5 gdb`command_line_handler(rl=0x00007ffeefbff760) at event-top.c:773:7
    frame #19: 0x000000010031bfc8 gdb`gdb_rl_callback_handler(rl="file test") at event-top.c:219:7
    frame #20: 0x00000001008d63c2 gdb`rl_callback_read_char at callback.c:281:4
    frame #21: 0x000000010031d956 gdb`gdb_rl_callback_read_char_wrapper_noexcept() at event-top.c:177:7
    frame #22: 0x000000010031bb55 gdb`gdb_rl_callback_read_char_wrapper(client_data=0x0000000102206d90) at event-top.c:194:7
    frame #23: 0x000000010031c5eb gdb`stdin_event_handler(error=0, client_data=0x0000000102206d90) at event-top.c:516:4
    frame #24: 0x0000000100986660 gdb`handle_file_event(file_ptr=0x00000001022b6840, ready_mask=1) at event-loop.cc:548:6
    frame #25: 0x0000000100984f03 gdb`gdb_wait_for_event(block=1) at event-loop.cc:673:7
    frame #26: 0x00000001009849db gdb`gdb_do_one_event() at event-loop.cc:215:7
    frame #27: 0x00000001004687f4 gdb`start_event_loop() at main.c:356:13
    frame #28: 0x0000000100463370 gdb`captured_command_loop() at main.c:416:3
    frame #29: 0x00000001004608b2 gdb`captured_main(data=0x00007ffeefbffb88) at main.c:1254:4
    frame #30: 0x00000001004607f5 gdb`gdb_main(args=0x00007ffeefbffb88) at main.c:1269:7
    frame #31: 0x0000000100000bb4 gdb`main(argc=1, argv=0x00007ffeefbffbd8) at gdb.c:32:10
    frame #32: 0x00007fff6f686cc9 libdyld.dylib`start + 1
    frame #33: 0x00007fff6f686cc9 libdyld.dylib`start + 1
Comment 7 Simon Marchi 2020-12-14 19:05:32 UTC
*** Bug 27043 has been marked as a duplicate of this bug. ***
Comment 8 Emad 2021-02-11 00:09:35 UTC
I have the same issue, although I came to it using Eclipse on MA OSX.

The gdb debugger does not start with Eclipse.

It tried the  ggdb alone was able to reproduce the same issue with a Hello World program.

Below is the Debugger Console output.

--------------------------

GNU gdb (GDB) 10.1
Copyright (C) 2020 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-apple-darwin20.1.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_gdb/gdb/work/gdb-10.1/gdb/thread.c:95: internal-error: struct thread_info *inferior_thread(): Assertion `current_thread_ != nullptr' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]

This is a bug, please report it.
Comment 9 Sam Warner 2021-07-02 18:53:15 UTC
Can I change the bug to Confirmed and assign myself (WIP on using Simon's source modifications (simark), and if not resolved by these continue to investigate-resolve)?
Comment 10 Sam Warner 2021-07-02 18:55:18 UTC
*** Bug 28010 has been marked as a duplicate of this bug. ***
Comment 11 Simon Marchi 2021-07-02 22:51:14 UTC
(In reply to Sam Warner from comment #9)
> Can I change the bug to Confirmed and assign myself (WIP on using Simon's
> source modifications (simark), and if not resolved by these continue to
> investigate-resolve)?

Here's the patch in question:

https://sourceware.org/pipermail/gdb-patches/2021-June/180396.html

Can you just verify if this fixes the problem for you?  If so I'll commit it to the master branch.
Comment 12 Sam Warner 2021-07-02 23:07:08 UTC
Yep - in process of verifying
Comment 13 Sam Warner 2021-07-03 17:25:17 UTC
Created attachment 13530 [details]
attachment-3060292-0.html

Hi Simon,
   I’ve been unable to find this patch on https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git <https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git>   I tried searching based on Change-ID, and other items listed within the thread, and even your name.  Can you point me to the patch?

   You do show the source changes you made.  I will go make the source changes to solid-darwin.c and test.  If you can point me to the patch that’d be great.

Sam

> On Jul 2, 2021, at 3:51 PM, simark at simark dot ca <sourceware-bugzilla@sourceware.org> wrote:
> 
> https://sourceware.org/bugzilla/show_bug.cgi?id=26912
> 
> --- Comment #11 from Simon Marchi <simark at simark dot ca> ---
> (In reply to Sam Warner from comment #9)
>> Can I change the bug to Confirmed and assign myself (WIP on using Simon's
>> source modifications (simark), and if not resolved by these continue to
>> investigate-resolve)?
> 
> Here's the patch in question:
> 
> https://sourceware.org/pipermail/gdb-patches/2021-June/180396.html
> 
> Can you just verify if this fixes the problem for you?  If so I'll commit it to
> the master branch.
> 
> -- 
> You are receiving this mail because:
> You are on the CC list for the bug.
Comment 14 Sam Warner 2021-07-03 18:35:49 UTC
Created attachment 13531 [details]
attachment-977364-0.html

Success - null-pointer gone when using ‘-file’ command.
  
I hand edited solid-darwin.c, and used the following:

  //
  // from Simon Marchi, put in here by Sam Warner as couldn't find the patch
  //
  /* Everything below only makes sense if we have a running inferior.  */
  if (!target_has_execution_current() )
    return;

I used target_has_execution_current() to get around some header file issue where target_has_execution wasn’t being defined in my environment.  I’ll go research that next.  After solving the header so I use the exact changes Simon had, then I’ll run the test-suite.

Thank you Simon,


Sam

…. edited from command shell … (make it easier to read)
sam@gdbdev--1- gdb-10.2 % gdb --data-directory=/Users/sam/Documents/gdb-10.2/gdb/data-directory gdb
GNU gdb (GDB) 10.2
Copyright (C) 2021 Free Software Foundation, Inc.
(top-gdb) run -q
(gdb) file /Users/sam/Documents/gdb-10.2/gdb/gdb
Reading symbols from /Users/sam/Documents/gdb-10.2/gdb/gdb...
(top-gdb) 




> On Jul 3, 2021, at 10:25 AM, Sam Warner <samuel.r.warner@me.com> wrote:
> 
> Hi Simon,
>    I’ve been unable to find this patch on https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git <https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git>   I tried searching based on Change-ID, and other items listed within the thread, and even your name.  Can you point me to the patch?
> 
>    You do show the source changes you made.  I will go make the source changes to solid-darwin.c and test.  If you can point me to the patch that’d be great.
> 
> Sam
> 
>> On Jul 2, 2021, at 3:51 PM, simark at simark dot ca <sourceware-bugzilla@sourceware.org <mailto:sourceware-bugzilla@sourceware.org>> wrote:
>> 
>> https://sourceware.org/bugzilla/show_bug.cgi?id=26912 <https://sourceware.org/bugzilla/show_bug.cgi?id=26912>
>> 
>> --- Comment #11 from Simon Marchi <simark at simark dot ca> ---
>> (In reply to Sam Warner from comment #9)
>>> Can I change the bug to Confirmed and assign myself (WIP on using Simon's
>>> source modifications (simark), and if not resolved by these continue to
>>> investigate-resolve)?
>> 
>> Here's the patch in question:
>> 
>> https://sourceware.org/pipermail/gdb-patches/2021-June/180396.html
>> 
>> Can you just verify if this fixes the problem for you?  If so I'll commit it to
>> the master branch.
>> 
>> -- 
>> You are receiving this mail because:
>> You are on the CC list for the bug.
>
Comment 15 Simon Marchi 2021-07-05 00:57:06 UTC
*** Bug 27365 has been marked as a duplicate of this bug. ***
Comment 17 Sam Warner 2021-07-05 16:04:57 UTC
Created attachment 13539 [details]
attachment-3984744-0.html

Hi,
  On rare occasions I am encountering the following "internal-error: int filter_overlapping_sections”. I suspect it has more to do with my technique for debugging gdb than an issue with the patch.

  Still running test suites,  Should we wait before marking the bug fixed?

Sam

sam@gdbdev--1- gdb % /Users/sam/Documents/gdb-10.2/gdb/gdb --data-directory=/Users/sam/Documents/gdb-10.2/gdb/data-directory /Users/sam/Documents/gdb-10.2/gdb/gdb
GNU gdb (GDB) 10.2
Copyright (C) 2021 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-apple-darwin20.5.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /Users/sam/Documents/gdb-10.2/gdb/gdb...
Setting up the environment for debugging gdb.
During symbol reading: unsupported tag: 'DW_TAG_unspecified_type'
During symbol reading: cannot get low and high bounds for subprogram DIE at 0xa78
During symbol reading: unexpected demangled name 'allocator<char> >'
During symbol reading: unexpected overlap between:
 (A) section `.cstring' from `/Users/sam/Documents/gdb-10.2/gdb/xml-builtin.o' [0x0, 0x9e)
 (B) section `*ABS*' from `/Users/sam/Documents/gdb-10.2/gdb/xml-builtin.o' [0x0, 0x0).
Will ignore section B
objfiles.c:1111: internal-error: int filter_overlapping_sections(struct obj_section **, int): Assertion `sect1_addr <= sect2_addr' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]

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

objfiles.c:1111: internal-error: int filter_overlapping_sections(struct obj_sect--Typ--Typ--T--Typ--Ty--Typ-----Ty--T------------Typ------Ty----T---------T-------Type <RET> for more, q to quit, c to continue without paging--c
ion **, int): Assertion `sect1_addr <= sect2_addr' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]
zsh: abort      /Users/sam/Documents/gdb-10.2/gdb/gdb  /Users/sam/Documents/gdb-10.2/gdb/gdb
sam@gdbdev--1- gdb % /Users/sam/Documents/gdb-10.2/gdb/gdb --data-directory=/Users/sam/Documents/gdb-10.2/gdb/data-directory /Users/sam/Documents/gdb-10.2/gdb/gdb

> On Jul 3, 2021, at 11:35 AM, Sam Warner <samuel.r.warner@me.com> wrote:
> 
> Success - null-pointer gone when using ‘-file’ command.
>   
> I hand edited solid-darwin.c, and used the following:
> 
>   //
>   // from Simon Marchi, put in here by Sam Warner as couldn't find the patch
>   //
>   /* Everything below only makes sense if we have a running inferior.  */
>   if (!target_has_execution_current() )
>     return;
> 
> I used target_has_execution_current() to get around some header file issue where target_has_execution wasn’t being defined in my environment.  I’ll go research that next.  After solving the header so I use the exact changes Simon had, then I’ll run the test-suite.
> 
> Thank you Simon,
> 
> 
> Sam
> 
> …. edited from command shell … (make it easier to read)
> sam@gdbdev--1- gdb-10.2 % gdb --data-directory=/Users/sam/Documents/gdb-10.2/gdb/data-directory gdb
> GNU gdb (GDB) 10.2
> Copyright (C) 2021 Free Software Foundation, Inc.
> (top-gdb) run -q
> (gdb) file /Users/sam/Documents/gdb-10.2/gdb/gdb
> Reading symbols from /Users/sam/Documents/gdb-10.2/gdb/gdb...
> (top-gdb) 
> 
> 
> 
> 
>> On Jul 3, 2021, at 10:25 AM, Sam Warner <samuel.r.warner@me.com <mailto:samuel.r.warner@me.com>> wrote:
>> 
>> Hi Simon,
>>    I’ve been unable to find this patch on https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git <https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git>   I tried searching based on Change-ID, and other items listed within the thread, and even your name.  Can you point me to the patch?
>> 
>>    You do show the source changes you made.  I will go make the source changes to solid-darwin.c and test.  If you can point me to the patch that’d be great.
>> 
>> Sam
>> 
>>> On Jul 2, 2021, at 3:51 PM, simark at simark dot ca <sourceware-bugzilla@sourceware.org <mailto:sourceware-bugzilla@sourceware.org>> wrote:
>>> 
>>> https://sourceware.org/bugzilla/show_bug.cgi?id=26912 <https://sourceware.org/bugzilla/show_bug.cgi?id=26912>
>>> 
>>> --- Comment #11 from Simon Marchi <simark at simark dot ca> ---
>>> (In reply to Sam Warner from comment #9)
>>>> Can I change the bug to Confirmed and assign myself (WIP on using Simon's
>>>> source modifications (simark), and if not resolved by these continue to
>>>> investigate-resolve)?
>>> 
>>> Here's the patch in question:
>>> 
>>> https://sourceware.org/pipermail/gdb-patches/2021-June/180396.html <https://sourceware.org/pipermail/gdb-patches/2021-June/180396.html>
>>> 
>>> Can you just verify if this fixes the problem for you?  If so I'll commit it to
>>> the master branch.
>>> 
>>> -- 
>>> You are receiving this mail because:
>>> You are on the CC list for the bug.
>> 
>
Comment 18 Simon Marchi 2021-07-05 16:54:16 UTC
(In reply to Sam Warner from comment #17)
> Created attachment 13539 [details]
> attachment-3984744-0.html
> 
> Hi,
>   On rare occasions I am encountering the following "internal-error: int
> filter_overlapping_sections”. I suspect it has more to do with my technique
> for debugging gdb than an issue with the patch.
> 
>   Still running test suites,  Should we wait before marking the bug fixed?

I think that the cause and consequence of this bug was pretty clear and are resolved by my patch, so we can consider it fixed.  The other error you encounter could be filed as a separate bug.
Comment 19 Sam Warner 2021-07-05 20:45:54 UTC
will a status of "P2 normal" get this Patch into the next GDB release?
when is the next GDB release?
is there a daily build of GDB including this patch?

and, ...

How does one track the progress of a patch through QA?
(re:...RESOLVED: A resolution has been performed, and it is awaiting verification by QA. From here bugs are either reopened and given some open status, or are verified by QA and marked VERIFIED.)

Sam
Comment 20 Simon Marchi 2021-07-05 21:21:37 UTC
(In reply to Sam Warner from comment #19)
> will a status of "P2 normal" get this Patch into the next GDB release?
> when is the next GDB release?
> is there a daily build of GDB including this patch?

I merged the patch in the master branch and in the gdb-11-branch (which will become the next GDB release).

There are daily preview tarballs (representing what a release would look like):

https://sourceware.org/pub/gdb/snapshots/

But no binary releases.

> 
> and, ...
> 
> How does one track the progress of a patch through QA?
> (re:...RESOLVED: A resolution has been performed, and it is awaiting
> verification by QA. From here bugs are either reopened and given some open
> status, or are verified by QA and marked VERIFIED.)

There is no QA team, everybody is responsible for running the testsuite for the platforms they care about and report regressions, if they don't want the support for the platforms they care about to bit-rot.  In the past years, nobody seemed to care much about the Darwin / macOS port, which is why it started to bit-rot a little bit.

Ideally, we'd have a working CI system, but this is not easy, it is very time-consuming (I'm talking about human resources).  See this thread for the latest efforts about that:

https://sourceware.org/pipermail/gdb/2021-June/049537.html
https://sourceware.org/pipermail/gdb/2021-July/049540.html

So basically, this bug is considered fixed until someone finds out that it isn't, in which case we can re-open it.
Comment 21 Jonah Graham 2021-07-06 01:18:14 UTC
Created attachment 13541 [details]
attachment-3064665-0.html

Hi Sam,

I am not in a position to answer any of these questions - probably best for
IRC or mailing list.

Jonah

~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com


On Mon, 5 Jul 2021 at 12:04, Sam Warner <samuel.r.warner@me.com> wrote:

> Hi,
>   On rare occasions I am encountering the following "internal-error: int
> filter_overlapping_sections”. I suspect it has more to do with my
> technique for debugging gdb than an issue with the patch.
>
>   Still running test suites,  Should we wait before marking the bug fixed?
>
> Sam
>
> sam@gdbdev--1- gdb % /Users/sam/Documents/gdb-10.2/gdb/gdb
> --data-directory=/Users/sam/Documents/gdb-10.2/gdb/data-directory
> /Users/sam/Documents/gdb-10.2/gdb/gdb
> *GNU gdb (GDB) 10.2*
> Copyright (C) 2021 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-apple-darwin20.5.0".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <https://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
>     <http://www.gnu.org/software/gdb/documentation/>.
>
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from /Users/sam/Documents/gdb-10.2/gdb/gdb...
> Setting up the environment for debugging gdb.
> During symbol reading: unsupported tag: 'DW_TAG_unspecified_type'
> During symbol reading: cannot get low and high bounds for subprogram DIE
> at 0xa78
> During symbol reading: unexpected demangled name 'allocator<char> >'
> During symbol reading: unexpected overlap between:
>  (A) section `.cstring' from
> `/Users/sam/Documents/gdb-10.2/gdb/xml-builtin.o' [0x0, 0x9e)
>  (B) section `*ABS*' from
> `/Users/sam/Documents/gdb-10.2/gdb/xml-builtin.o' [0x0, 0x0).
> Will ignore section B
> objfiles.c:1111: internal-error: int filter_overlapping_sections(struct
> obj_section **, int): Assertion `sect1_addr <= sect2_addr' failed.
> A problem internal to GDB has been detected,
> further debugging may prove unreliable.
> Quit this debugging session? (y or n) [answered Y; input not from terminal]
>
> This is a bug, please report it.  For instructions, see:
> <https://www.gnu.org/software/gdb/bugs/>.
>
> objfiles.c:1111: internal-error: int filter_overlapping_sections(struct
> obj_sect--Typ--Typ--T--Typ--Ty--Typ-----Ty--T------------Typ------Ty----T---------T-------Type
> <RET> for more, q to quit, c to continue without paging--c
> ion **, int): Assertion `sect1_addr <= sect2_addr' failed.
> A problem internal to GDB has been detected,
> further debugging may prove unreliable.
> Create a core file of GDB? (y or n) [answered Y; input not from terminal]
> zsh: abort      /Users/sam/Documents/gdb-10.2/gdb/gdb
> /Users/sam/Documents/gdb-10.2/gdb/gdb
> sam@gdbdev--1- gdb % /Users/sam/Documents/gdb-10.2/gdb/gdb
> --data-directory=/Users/sam/Documents/gdb-10.2/gdb/data-directory
> /Users/sam/Documents/gdb-10.2/gdb/gdb
>
> On Jul 3, 2021, at 11:35 AM, Sam Warner <samuel.r.warner@me.com> wrote:
>
> Success - null-pointer gone when using ‘-file’ command.
>
> I hand edited solid-darwin.c, and used the following:
>
>   //
>   // from Simon Marchi, put in here by Sam Warner as couldn't find the
> patch
>   //
>   /* Everything below only makes sense if we have a running inferior.  */
>   if (!target_has_execution_current() )
>     return;
>
> I used target_has_execution_current() to get around some header file issue
> where target_has_execution wasn’t being defined in my environment.  I’ll
> go research that next.  After solving the header so I use the exact changes
> Simon had, then I’ll run the test-suite.
>
> Thank you Simon,
>
>
> Sam
>
> …. edited from command shell … (make it easier to read)
> sam@gdbdev--1- gdb-10.2 % gdb
> --data-directory=/Users/sam/Documents/gdb-10.2/gdb/data-directory gdb
> *GNU gdb (GDB) 10.2*
> Copyright (C) 2021 Free Software Foundation, Inc.
> (top-gdb) run -q
> (gdb) file /Users/sam/Documents/gdb-10.2/gdb/gdb
> Reading symbols from /Users/sam/Documents/gdb-10.2/gdb/gdb...
> (top-gdb)
>
>
>
>
> On Jul 3, 2021, at 10:25 AM, Sam Warner <samuel.r.warner@me.com> wrote:
>
> Hi Simon,
>    I’ve been unable to find this patch on
> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git   I tried
> searching based on Change-ID, and other items listed within the thread, and
> even your name.  Can you point me to the patch?
>
>    You do show the source changes you made.  I will go make the source
> changes to solid-darwin.c and test.  If you can point me to the patch
> that’d be great.
>
> Sam
>
> On Jul 2, 2021, at 3:51 PM, simark at simark dot ca <
> sourceware-bugzilla@sourceware.org> wrote:
>
> https://sourceware.org/bugzilla/show_bug.cgi?id=26912
>
> --- Comment #11 from Simon Marchi <simark at simark dot ca> ---
> (In reply to Sam Warner from comment #9)
>
> Can I change the bug to Confirmed and assign myself (WIP on using Simon's
> source modifications (simark), and if not resolved by these continue to
> investigate-resolve)?
>
>
> Here's the patch in question:
>
> https://sourceware.org/pipermail/gdb-patches/2021-June/180396.html
>
> Can you just verify if this fixes the problem for you?  If so I'll commit
> it to
> the master branch.
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
>
>
>
>
>
Comment 22 Sam Warner 2021-07-06 15:56:23 UTC
yeh, bit-rot and the CI, I was going to jump on that next, after I find a distribution path for this version of gdb.
Comment 23 Sam Warner 2021-07-06 23:30:51 UTC
Created attachment 13543 [details]
make check gdb-base/*.exp for the 'file' patch

gdb.base tests run.  many failing, and yet to be investigated, with the likely cause being bit-rot from testsuite's not having been run regularly on macOS.