cclark2
(Cclark2)
May 20, 2019, 2:51pm
1
If you develop your Rack plugin on Windows, you may have have run into this:
$ gdb
osabi.c:661: internal-error: _initialize_gdb_osabi: gdb_osabi_names[] is inconsistent
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) Segmentation fault (core dumped)
Here’s the bug verifying that this has nothing to do with Rack:
opened 08:56PM - 15 May 19 UTC
closed 06:42AM - 28 Aug 22 UTC
I was having problem starting gdb in all msys2 shells, so I deleted msys2 from m… y system and did a fresh install.
After that, I was having the following problems.
MSYS2 shell
```
$ gdb
osabi.c:661: internal-error: _initialize_gdb_osabi: gdb_osabi_names[] is inconsistent
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) Segmentation fault (core dumped)
```
MINGW32 shell :
```
$ gdb
C:/msys64/mingw32/bin/gdb.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
```
MINGW64 shell :
```
$ gdb
C:/msys64/mingw64/bin/gdb.exe: error while loading shared libraries: libsource-highlight-4.dll: cannot open shared object file: No such file or directory
```
Calling `pacman -Q --info gdb` reports the following in a MINGW64 shell :
```
Name : gdb
Version : 8.2.1-1
Description : GNU Debugger (MSYS2 version)
Architecture : x86_64
```
[This URL](https://msys2.duckdns.org/package/mingw-w64-x86_64-gdb?repo=mingw64) reports that the latest version should be 8.3-1.
If I open gdb.exe with an hexadecimal editor, I can see a lot of reference to "gdb-8.3" (mostly in assertion strings).
To be sure, one of my colleague, which didn't update for a few days and is still able to debug, did this :
```
$ sha256sum `which gdb`
099588743af8a4847c2d4c51b85bb67a139194db74eec654aa94e9720b4e1a84 */mingw64/bin/gdb
```
On my computer, it yield this result :
```
$ sha256sum `which gdb`
91c8f9f131a3a2c5cea7ecb9f442bb2d97367bb7213d629ca5abdce1f2169d68 */mingw64/bin/gdb
```
This SHA matches the SHA of gdb 8.3-1.
I cannot reinstall 8.2.1-1, as the meta-data for the package are wrong, but gdb 8.3-1 doesn't start.
What should I do?
And here’s the fix:
pacman -S mingw-w64-x86_64-gdb
$ /mingw64/bin/gdb
GNU gdb (GDB) 8.3
...
2 Likes
Wow, thanks so much for posting, that did it
Vortico
(VCV - Andrew)
May 20, 2019, 3:23pm
3
Thanks, added mingw-w64-x86_64-gdb to list of Windows build dependencies, since it’s used so much.
cclark2
(Cclark2)
May 20, 2019, 4:52pm
4
One downside to this workaround is that the replacement GDB does not work with arrow keys to edit the command line or show history, when used with the standard mingw64.exe terminal.
There is a workaround to this workaround as described here
$ pacman -S winpty
$ winpty gdb --args ./Rack.exe -d
[Edit] … but it messes up breakpoints. Sigh.