Skip to content

Bringing up graphical window with SDL crashes when interactive debugger happens #18

@NattyNarwhal

Description

@NattyNarwhal

I'm trying to use the debugger to poke ARC (#13), but enabling it (CMake debug build, CXXFLAGS="-DIDB") causes a segfault when the graphical window pops up.

[calvin@salient build]$ gdb --args ./axpbox run
GNU gdb (GDB) Fedora 9.1-5.fc32
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-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://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 ./axpbox...
(gdb) run
Starting program: /home/calvin/src/axpbox/build/axpbox run
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.31-2.fc32.x86_64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
%GUI-I-INS: Installing sdl module as the ES40 GUI
sys0(tsunami): $Id: System.cpp,v 1.79 2008/06/12 07:29:44 iamcamiel Exp $
%FLS-F-NOREST: Flash could not be restored from rom/flash.rom
sys0(tsunami): $Id: Flash.cpp,v 1.19 2008/03/24 22:11:50 iamcamiel Exp $
dma: $Id: DMA.cpp,v 1.9 2008/04/29 09:24:52 iamcamiel Exp $
pci0.19(ali_usb): $Id: AliM1543C_usb.cpp,v 1.6 2008/03/14 15:30:50 iamcamiel Exp $
%DPR-F-NOREST: DPR could not be restored from rom/dpr.rom
sys0(tsunami): $Id: DPR.cpp,v 1.23 2008/06/12 07:29:44 iamcamiel Exp $
cpu0(ev68cb)(0): $Id: AlphaCPU.cpp,v 1.82 2009/03/16 01:33:27 iamcamiel Exp $
serial0(serial): Waiting for connection on port 21264.
[Detaching after fork from child process 70146]
serial0(serial): $Id: Serial.cpp,v 1.51 2008/06/03 09:07:56 iamcamiel Exp $
serial1(serial): Waiting for connection on port 21265.
[Detaching after fork from child process 70152]
serial1(serial): $Id: Serial.cpp,v 1.51 2008/06/03 09:07:56 iamcamiel Exp $
%IDE-I-INIT: New IDE emulator initialized.
pci0.1(cirrus): $Id: Cirrus.cpp,v 1.23 2008/05/31 15:47:09 iamcamiel Exp $
pci0.7(ali): $Id: AliM1543C.cpp,v 1.66 2008/05/31 15:47:07 iamcamiel Exp $
kbc: $Id: Keyboard.cpp,v 1.10 2008/05/31 15:47:09 iamcamiel Exp $
%SYS-I-READROM: Reading decompressed ROM image from rom/decompressed.rom.
%SYM-I-PATCHROM: Patching ROM for speed.
%SYS-I-ROMLOADED: ROM Image loaded successfully!
%DPR-F-NOREST: DPR could not be restored from rom/dpr.rom
sys0(tsunami): $Id: DPR.cpp,v 1.23 2008/06/12 07:29:44 iamcamiel Exp $
This is the ES40 interactive debugger. To start non-interactively, run es40,
Or run this executable (es40_idb) with a last argument of @<script-file>
IDB 0000000000008000 P>run
%IDB-F-NOBRKP: No breakpoint set, press Ctrl-C to end run.
Arbitration 0000000000010000 from CPU 0 (@13e39)... won  0000000800010000
Arbitration clear from CPU 0 (@13f55).
Arbitration 0000000000010000 from CPU 0 (@13351)... won  0000000800010000
Arbitration clear from CPU 0 (@133b9).
Arbitration 0000000000010000 from CPU 0 (@13351)... won  0000000800010000
Arbitration clear from CPU 0 (@133b9).
Arbitration 0000000000010000 from CPU 0 (@13351)... won  0000000800010000
Arbitration clear from CPU 0 (@133b9).
cirrus: VGABios $Id: vgabios.c 226 2020-01-02 21:36:23Z vruppert $
cirrus: VBE Bios $Id: vbe.c 228 2020-01-02 23:09:02Z vruppert $
cirrus: vgabios call ah00 al03 bx95FA cx0000 dx03C5
cirrus: mode search 03 found line 03

Program received signal SIGSEGV, Segmentation fault.
0x00000000004e0f96 in bx_sdl_gui_c::palette_change (this=0x552a70, index=0, red=0, green=0, blue=0) at /home/calvin/src/axpbox/src/gui/sdl.cpp:1136
1136	  palette[index] = SDL_MapRGB(sdl_screen->format, palred, palgreen, palblue);
Missing separate debuginfos, use: dnf debuginfo-install SDL-1.2.15-43.fc32.x86_64 libX11-1.6.9-3.fc32.x86_64 libXau-1.0.9-3.fc32.x86_64 libgcc-10.1.1-1.fc32.x86_64 libpcap-1.9.1-3.fc32.x86_64 libstdc++-10.1.1-1.fc32.x86_64 libxcb-1.13.1-4.fc32.x86_64
(gdb) where
#0  0x00000000004e0f96 in bx_sdl_gui_c::palette_change (this=0x552a70, index=0, red=0, green=0, blue=0) at /home/calvin/src/axpbox/src/gui/sdl.cpp:1136
#1  0x000000000049c682 in CCirrus::write_b_3c9 (this=0x55a330, value=<optimized out>) at /home/calvin/src/axpbox/src/Cirrus.cpp:1564
#2  0x000000000049cc41 in CCirrus::io_write_b (this=<optimized out>, address=<optimized out>, data=<optimized out>) at /home/calvin/src/axpbox/src/Cirrus.cpp:896
#3  0x000000000049cd82 in CCirrus::io_write (this=0x55a330, address=969, dsize=<optimized out>, data=0) at /home/calvin/src/axpbox/src/Cirrus.cpp:849
#4  0x000000000049fb03 in CCirrus::WriteMem_Legacy (this=0x55a330, index=<optimized out>, address=<optimized out>, dsize=<optimized out>, data=<optimized out>) at /home/calvin/src/axpbox/src/Cirrus.cpp:509
#5  0x00000000004af22f in CPCIDevice::WriteMem (this=0x55a330, index=2, address=9, dsize=<optimized out>, data=0) at /home/calvin/src/axpbox/src/PCIDevice.cpp:397
#6  0x00000000004bd338 in CSystem::WriteMem (this=0x554c30, address=8804615848905, dsize=dsize@entry=8, data=0, source=source@entry=0x7ffff33d5010) at /home/calvin/src/axpbox/src/System.cpp:761
#7  0x00000000004157bc in CAlphaCPU::execute (this=0x7ffff33d5010) at /home/calvin/src/axpbox/src/AlphaCPU.cpp:842
#8  0x00000000004bc377 in CSystem::SingleStep (this=0x554c30) at /home/calvin/src/axpbox/src/System.cpp:575
#9  0x00000000004c0af3 in CTraceEngine::parse (this=this@entry=0x7ffff2d20010, command=command@entry=0x7fffffffaa30) at /home/calvin/src/axpbox/src/TraceEngine.cpp:989
#10 0x00000000004c21e1 in CTraceEngine::run_script (this=0x7ffff2d20010, filename=filename@entry=0x0) at /home/calvin/src/axpbox/src/TraceEngine.cpp:818
#11 0x000000000049b6e4 in main_sim (argc=argc@entry=1, argv=argv@entry=0x7fffffffd660) at /home/calvin/src/axpbox/src/AlphaSim.cpp:338
#12 0x00000000004ae098 in main (argc=2, argv=0x7fffffffd660) at /home/calvin/src/axpbox/src/Main.cpp:21

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions