VOGONS


Segmentation fault under Ubuntu 9.10

Topic actions

First post, by Varka

User metadata
Rank Newbie
Rank
Newbie

I have attempted to compile Dosbox from the source available from the "Download" link at www.dosbox.com.

http://prdownloads.sourceforge.net/dosbox/dos … tar.gz?download

I'm running 32-bit Ubuntu 9.10.

I've unzipped the package, ran autogen.sh, ran configure, make, and make install, no apparant errors. I passed no parameters at all to the configure/make/etc. processes.

It installed the executable to /usr/local/bin/dosbox, but when I attempt to run the program I briefly see the dosbox splash screen and then immediately receive a "Segmentation fault" error and dosbox closes.

Ubuntu has a packaged Dosbox that works fine, but I'm trying to compile a version with MT32 support.

THanks for any assistance you can offer!

Reply 2 of 32, by Varka

User metadata
Rank Newbie
Rank
Newbie
brikeener@ubuntu:~/Downloads/dosbox-0.73/src$ gdb dosbox
rGNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 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 "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/brikeener/Downloads/dosbox-0.73/src/dosbox...done.
(gdb) run
Starting program: /home/brikeener/Downloads/dosbox-0.73/src/dosbox
[Thread debugging using libthread_db enabled]
DOSBox version 0.73
Copyright 2002-2009 DOSBox Team, published under GNU GPL.
---
[New Thread 0xb3dc2b70 (LWP 9784)]
[Thread 0xb3dc2b70 (LWP 9784) exited]
[New Thread 0xb3dc2b70 (LWP 9785)]
CONFIG:Loading primary settings from config file /home/brikeener/.dosbox/dosbox-0.73.conf

Program received signal SIGSEGV, Segmentation fault.
PAGING (sec=0x9f749a8) at paging.cpp:878
878 PAGING_InitTLB();
(gdb) bt
#0 PAGING (sec=0x9f749a8) at paging.cpp:878
#1 PAGING_Init (sec=0x9f749a8) at paging.cpp:890
#2 0x08202a29 in Section::ExecuteInit (this=0x9f749a8, initall=true)
at setup.cpp:728
#3 0x08202a7b in Config::Init (this=0xbffff3f0) at setup.cpp:712
#4 0x08146bf5 in main (argc=1, argv=0xbffff504) at sdlmain.cpp:1807
(gdb)

Reply 3 of 32, by Varka

User metadata
Rank Newbie
Rank
Newbie

I re-configured with "./configure --disable-unaligned-memory" and it runs now.

It does complain that:

"opengl" is not a valid value for variable: output.
It might now be reset it to default value: surface

But I'm not losing too much sleep over that currently.

I don't really know what disable-unaligned-memory means, but since it seemed to be a memory problem I figured it was worth a shot.

Reply 6 of 32, by Varka

User metadata
Rank Newbie
Rank
Newbie
Program received signal SIGSEGV, Segmentation fault.
PAGING (sec=0x9f749a8) at paging.cpp:878
878 PAGING_InitTLB();
(gdb) step
PAGING_InitTLB (sec=0x9f749a8) at paging.cpp:650
650 paging.tlb.read[i]=0;
(gdb) step
[Thread 0xb3dc2b70 (LWP 18801) exited]

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.

No idea if this is what you wanted.

Program received signal SIGSEGV, Segmentation fault.
PAGING (sec=0x9f749a8) at paging.cpp:878
878 PAGING_InitTLB();
(gdb) bt
#0 PAGING (sec=0x9f749a8) at paging.cpp:878
#1 PAGING_Init (sec=0x9f749a8) at paging.cpp:890
#2 0x08202a29 in Section::ExecuteInit (this=0x9f749a8, initall=true)
at setup.cpp:728
#3 0x08202a7b in Config::Init (this=0xbffff3f0) at setup.cpp:712
#4 0x08146bf5 in main (argc=1, argv=0xbffff504) at sdlmain.cpp:1807
(gdb) step
PAGING_InitTLB (sec=0x9f749a8) at paging.cpp:650
650 paging.tlb.read[i]=0;
(gdb) bt
#0 PAGING_InitTLB (sec=0x9f749a8) at paging.cpp:650
#1 PAGING (sec=0x9f749a8) at paging.cpp:878
#2 PAGING_Init (sec=0x9f749a8) at paging.cpp:890
#3 0x08202a29 in Section::ExecuteInit (this=0x9f749a8, initall=true)
at setup.cpp:728
#4 0x08202a7b in Config::Init (this=0xbffff3f0) at setup.cpp:712
#5 0x08146bf5 in main (argc=1, argv=0xbffff504) at sdlmain.cpp:1807
(gdb) step

Reply 7 of 32, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Load the app in gdb, then use "break PAGING_InitTLB" then run until the breakpoint is hit.
Use step as you did to trace into the function, though it should break at the for loop
at first (be sure you have optimizations turned off when compiling dosbox).

You can use "p i" and similar to check the content of variables.

Reply 8 of 32, by Varka

User metadata
Rank Newbie
Rank
Newbie
brikeener@ubuntu:~/Downloads/dosbox-0.73/src$ gdb dosbox
GNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 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 "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/brikeener/Downloads/dosbox-0.73/src/dosbox...done.
(gdb) break PAGING_InitTLB
Breakpoint 1 at 0x8066198: file paging.cpp, line 650.
(gdb) run
Starting program: /home/brikeener/Downloads/dosbox-0.73/src/dosbox
[Thread debugging using libthread_db enabled]
DOSBox version 0.73
Copyright 2002-2009 DOSBox Team, published under GNU GPL.
---
[New Thread 0xb3dc2b70 (LWP 5342)]
[Thread 0xb3dc2b70 (LWP 5342) exited]
[New Thread 0xb3dc2b70 (LWP 5343)]
CONFIG:Loading primary settings from config file /home/brikeener/.dosbox/dosbox-0.73.conf

Program received signal SIGSEGV, Segmentation fault.
PAGING (sec=0x9f779a8) at paging.cpp:878
878 PAGING_InitTLB();
(gdb) step
PAGING_InitTLB (sec=0x9f779a8) at paging.cpp:650
650 paging.tlb.read[i]=0;
(gdb) step
[Thread 0xb3dc2b70 (LWP 5343) exited]

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb)

I don't think I did it right. I also couldn't figure out how to disable optimization during compile, googling it again right now.

Reply 10 of 32, by Varka

User metadata
Rank Newbie
Rank
Newbie

I'll get to the optimization a little later, but for now something strange:

If I install the Ubuntu dosbox package, I can execute it just fine.

BUT, if I copy the Ubuntu-supplied dosbox executable anywhere else on the system, I get a segmentation fault. Same executable, different location.

Just thought that was strange...

Reply 11 of 32, by Varka

User metadata
Rank Newbie
Rank
Newbie

OK, maybe this is useful.

bkeener@ubuntu:~/Downloads/dosbox-0.73/src$ gdb dosbox
GNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 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 "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/bkeener/Downloads/dosbox-0.73/src/dosbox...done.
(gdb) break PAGING_InitTLB
Breakpoint 1 at 0x8073a88: file paging.cpp, line 649.
(gdb) run
Starting program: /home/bkeener/Downloads/dosbox-0.73/src/dosbox
[Thread debugging using libthread_db enabled]
DOSBox version 0.73
Copyright 2002-2009 DOSBox Team, published under GNU GPL.
---
[New Thread 0xb3dc2b70 (LWP 10818)]
[Thread 0xb3dc2b70 (LWP 10818) exited]
[New Thread 0xb3dc2b70 (LWP 10819)]
CONFIG:Loading primary settings from config file /home/bkeener/.dosbox/dosbox-0.73.conf

Breakpoint 1, PAGING_InitTLB () at paging.cpp:649
649 for (Bitu i=0;i<TLB_SIZE;i++) {
(gdb) p i
$1 = 3221222120
(gdb) step
650 paging.tlb.read[i]=0;
(gdb) p i
$2 = 0
(gdb) step
651 paging.tlb.write[i]=0;
(gdb) p i
$3 = 0
(gdb) step
652 paging.tlb.readhandler[i]=&init_page_handler;
(gdb) p i
$4 = 0
(gdb) step
653 paging.tlb.writehandler[i]=&init_page_handler;
(gdb) p i
$5 = 0
(gdb) step
649 for (Bitu i=0;i<TLB_SIZE;i++) {
(gdb) p i
$6 = 0
(gdb) step
650 paging.tlb.read[i]=0;
(gdb) p i
$7 = 1
(gdb) step
651 paging.tlb.write[i]=0;
(gdb) p i
$8 = 1
(gdb) step
652 paging.tlb.readhandler[i]=&init_page_handler;
(gdb) p i
$9 = 1
Show last 42 lines
(gdb) step
653 paging.tlb.writehandler[i]=&init_page_handler;
(gdb) p i
$10 = 1
(gdb) step
649 for (Bitu i=0;i<TLB_SIZE;i++) {
(gdb) p i
$11 = 1
(gdb) step
650 paging.tlb.read[i]=0;
(gdb) p i
$12 = 2
(gdb) step
651 paging.tlb.write[i]=0;
(gdb) p i
$13 = 2
(gdb) step
652 paging.tlb.readhandler[i]=&init_page_handler;
(gdb) p i
$14 = 2
(gdb) step
653 paging.tlb.writehandler[i]=&init_page_handler;
(gdb) p i
$15 = 2
(gdb) step
649 for (Bitu i=0;i<TLB_SIZE;i++) {
(gdb) continue
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x08073a97 in PAGING_InitTLB () at paging.cpp:650
650 paging.tlb.read[i]=0;

(gdb) bt
#0 0x08073a97 in PAGING_InitTLB () at paging.cpp:650
#1 0x080761cf in PAGING (this=0xa102068, configuration=0xa0b69a8) at paging.cpp:878
#2 0x08073ffb in PAGING_Init (sec=0xa0b69a8) at paging.cpp:890
#3 0x08330854 in Section::ExecuteInit (this=0xa0b69a8, initall=true) at setup.cpp:728
#4 0x08330715 in Config::Init (this=0xbffff3cc) at setup.cpp:712
#5 0x081c5494 in main (argc=1, argv=0xbffff4d4) at sdlmain.cpp:1807
(gdb)

It looked like it was just looping on lines 649-652, so I got bored and looked up the "continue" command.

Oh, also, the value of "i" is consistently 268700 after the crash.

Program received signal SIGSEGV, Segmentation fault.
0x08073a97 in PAGING_InitTLB () at paging.cpp:650
650 paging.tlb.read=0;
(gdb) p i
$1 = 268700

I can arrange a VNC/ssh/nx machine session if that would make things easier.

Reply 13 of 32, by Varka

User metadata
Rank Newbie
Rank
Newbie

Even MORE strange things:

I configured and installed dosbox from source to /usr/bin/dosbox.

If I execute "dosbox" from a console, it runs.

If I execute /usr/bin/dosbox it crashes.

If I use "gdb dosbox" and then "run" from a console, it crashes.

What wierd crap.

bkeener@ubuntu:/$ which dosbox
/usr/bin/dosbox
bkeener@ubuntu:~$ md5sum /usr/bin/dosbox
224bfd311780410c69943bb44a02ece9 /usr/bin/dosbox
bkeener@ubuntu:~$ md5sum Downloads/dosbox-0.73/src/dosbox
224bfd311780410c69943bb44a02ece9 Downloads/dosbox-0.73/src/dosbox

I also moved /usr/bin/dosbox to /bin/dosbox, and it runs fine, UNTIL I explicitly specify /bin/dosbox as the executable, at which point it has the EXACT same problem.

I think it's something fudged up with Ubuntu 9.10. I don't have this problem with Mandriva, but this is a fresh, factory-default install of Ubuntu, so I don't know what could be wrong!

Reply 16 of 32, by Varka

User metadata
Rank Newbie
Rank
Newbie

Yeah, tell me about it. Makes NO damn sense at all.

I'm just gonna go back to Mandriva. This whole thing makes me cry a little on the inside.

Now I have to figure out why I get thousands of "buffer underrun" errors with Munt in Mandriva, though. Makes mt32d unusable.

Everything works perfectly under Windows, I installed timidity++ synth and munt, sounds magnificent, but I prefer to run with the LEENUX