Bug 178618 - dosbox crashes IMGMOUNTing floppy image
Summary: dosbox crashes IMGMOUNTing floppy image
Alias: None
Product: Fedora
Classification: Fedora
Component: dosbox   
(Show other bugs)
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Andreas Bierfert
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2006-01-22 16:43 UTC by Andy Burns
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-01-25 21:43:55 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
updated spec file with history and new patch (3.23 KB, text/plain)
2006-01-24 21:29 UTC, Andy Burns
no flags Details
patch file for gcc4.1 (463 bytes, patch)
2006-01-24 21:30 UTC, Andy Burns
no flags Details | Diff

Description Andy Burns 2006-01-22 16:43:56 UTC
Description of problem:

My desktop machine has no dos/windows partition and no floppy drive, therefore
to perform flash BIOS updates I usually prepare a suitable floppy on a windows
laptop then transfer an image of that floppy (using winimage and winscp) into
/boot/floppy/disk.img and boot from it using grub+memdisk, this works well :-)

I'd prefer to tackle the whole process without involving the laptop to  prepare
the floppy, so I downloaded the DOS executable for the latest flash upgrade for
the desktop into /home/andy/bios and copied a known working 1.44MB floppy image
into /home/andy/bios/disk.img then fired up dosbox, and did

MOUNT C /home/andy/bios

and then ran the downloaded .EXE, this succesfully extracts the files from the
zip2exe package, so far so good.

At this stage there is a RUN.BAT which expects to be able to write to a floppy
disk, so I did 

IMGMOUNT A C:\disk.img -t floppy

to provide an emulated floppy for the next phase
unfortuantely at this point dosbox crashes.

Version-Release number of selected component (if applicable):

dosbox 0.6.3-6 on x86_64

How reproducible:


Steps to Reproduce:
1. MOUNT C /home/xxx
2. IMGMOUNT A C:\disk.img
Actual results:

Fatal signal: Segmentation Fault (SDL Parachute Deployed)

Expected results:

disk.img is mounted as A: within dosbox

Comment 1 Andreas Bierfert 2006-01-22 20:48:21 UTC
Looking into it. Seems like dosbox just needs a proper rebuild on devel.

Comment 2 Andy Burns 2006-01-24 21:29:10 UTC
Created attachment 123634 [details]
updated spec file with history and new patch

I've created  simple patch to make dosbox build with gcc 4.1 on FC5
it gets not errors, but a good few warnings, not sure if they are new or not

I will add the patch and spec files as attachments

Comment 3 Andy Burns 2006-01-24 21:30:14 UTC
Created attachment 123635 [details]
patch file for gcc4.1

Comment 4 Andy Burns 2006-01-24 21:33:13 UTC
The version of dosbox built with my patch installs and runs OK, but it doesn't
fix the original problem of crashing at the IMGMOUNT :-(

Comment 5 Michael Schwendt 2006-01-24 22:37:07 UTC
Can you install the dosbox-debuginfo package and attach a backtrace?

Comment 6 Andy Burns 2006-01-24 22:58:38 UTC
I presume that I should uninstall my own build of dosbox and re-install the
extras one to be in sync with dosbox-debuginfo?

Comment 7 Andy Burns 2006-01-24 23:05:18 UTC
Hmmm :-( 

# yum install dosbox-debuginfo
No Match for argument: dosbox-debuginfo

Is there an easy procedure for me to build my own debuginfo package?

Comment 8 Andy Burns 2006-01-24 23:23:47 UTC
OK, I build a debug package by adding %debug_package to the .spec file
then I rebuilt and reinstalled my own binary and debug packages

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47269815820352 (LWP 1775)]
0x000000000044e369 in IMGMOUNT::Run (this=0x2b051d0) at dos_programs.cpp:634
634                             if(((fatDrive *)newdrive)->loadedDisk->hardDrive) {

Thread 2 (Thread 1084229984 (LWP 1780)):
#0  0x0000003d5bbc2812 in __select_nocancel () from /lib64/libc.so.6
#1  0x0000003d65556375 in SDL_Delay () from /usr/lib64/libSDL-1.2.so.0
#2  0x0000003d655563a3 in SDL_Delay () from /usr/lib64/libSDL-1.2.so.0
#3  0x0000003d6555541c in SDL_RunThread () from /usr/lib64/libSDL-1.2.so.0
#4  0x0000003d655557f9 in SDL_SYS_CreateThread ()
   from /usr/lib64/libSDL-1.2.so.0
#5  0x0000003d5f90615a in start_thread () from /lib64/libpthread.so.0
#6  0x0000003d5bbc92bd in clone () from /lib64/libc.so.6
#7  0x0000000000000000 in ?? ()

Thread 1 (Thread 47269815820352 (LWP 1775)):
#0  0x000000000044e369 in IMGMOUNT::Run (this=0x2b051d0)
    at dos_programs.cpp:634
#1  0x0000000000491f48 in PROGRAMS_Handler () at programs.cpp:82
#2  0x00000000004055ab in Normal_Loop () at dosbox.cpp:127
#3  0x000000000040554a in DOSBOX_RunMachine () at dosbox.cpp:170
#4  0x000000000040640d in CALLBACK_RunRealInt (intnum=Variable "intnum" is not
) at callback.cpp:102
#5  0x000000000049c8b7 in DOS_Shell::Execute (this=Variable "this" is not available.
) at shell_misc.cpp:434
#6  0x0000000000498ffc in DOS_Shell::DoCommand (this=0x2b04d80,
    line=0x7fffffcc9a08 " a: c:disk.img -t floppy") at shell_cmds.cpp:98
#7  0x0000000000496d07 in DOS_Shell::ParseLine (this=0x2b04d80,
---Type <return> to continue, or q <return> to quit---
    line=0x7fffffcc9a00 "imgmount a: c:disk.img -t floppy") at shell.cpp:146
#8  0x0000000000497b4c in DOS_Shell::Run (this=0x2b04d80) at shell.cpp:215
#9  0x00000000004978e1 in SHELL_Init () at shell.cpp:418
#10 0x000000000047c2db in main (argc=Variable "argc" is not available.
) at sdlmain.cpp:1127
#11 0x0000003d5bb1cde4 in __libc_start_main () from /lib64/libc.so.6
#12 0x00000000004054a9 in _start ()
#13 0x00007fffffccad28 in ?? ()
#14 0x0000000000000000 in ?? ()

Comment 9 Andy Burns 2006-01-24 23:43:27 UTC
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47805550047296 (LWP 1874)]
0x000000000044e369 in IMGMOUNT::Run (this=0x2b05c00) at dos_programs.cpp:634
634                             if(((fatDrive *)newdrive)->loadedDisk->hardDrive) {

(gdb) print newdrive
$1 = (DOS_Drive *) 0x2aaaabcb4010

(gdb) print *newdrive
Cannot access memory at address 0x2aaaabcb4010

(gdb) whatis newdrive
type = DOS_Drive *

(gdb) x newdrive
0x2aaaabcb4010: Cannot access memory at address 0x2aaaabcb4010

Comment 10 Andreas Bierfert 2006-01-25 12:49:58 UTC
I will report this upstream and see what they say...

Comment 11 Michael Schwendt 2006-01-25 16:24:56 UTC
-debuginfo packages are kept in a lower-level repository.
Add directory "debug" at the end of the repository baseurl.

Cannot reproduce this problem on i386. Assuming it's x86_64 only.

Comment 12 Andreas Bierfert 2006-01-25 16:30:17 UTC
I think it probably is. Upstream is interested so if I can get the img file they
might be able to provide a fix for it...

While taking about this: I did build a new dosbox -8 with upstreams official
patch for 64bit and gcc4.1 so maybe try that as well to see if it still crashs.

Comment 13 Andy Burns 2006-01-25 18:20:39 UTC
OK, I'll try the new -8 first, if it still fails where should I send the .img
file, attach it here, or mail to you?

Comment 14 Andreas Bierfert 2006-01-25 18:22:14 UTC
Just mail me... should be enough :)

Comment 15 Andy Burns 2006-01-25 21:33:23 UTC
Ok, it's slight redface time for me :-(

I did a cat -v | more on the disk.img before zipping it or sending to you and
noticed the disk.img file that I'd created with winimage was actually already a
zipped image without me realising (an .imz file) but MEMDISK obviously supports
that so is quite happy to boot from from it, which convinced me it was a good image.

Of course dosbox doesn't like IMGMOUNT to receive a zipped FAT floppy instead!!
perhaps it shouldn't crash though and just give the user a slap?

So then I thought everything would work OK, but I was slightly disapointed,

inside dosbox I did 

MOUNT c: /home/andy/bios
IMGMOUNT A: C:/properdisk.ima

all mounted OK,

I ran the extract batch file and PKZIPSFX worked OK to extract it's contents, to
C: then rawwrite wrote to the emulated floppy, finally some config.sys etc files
are copied to the emulated floppy

I then exited dosbox and my properdisk.ima should have now contained 
a newly bootable freedos image ready to boot using MEMDISK and reflash my bios

But I noticed that my properdisk.ima had grown from 1.4M to 2.1MB during the
process, I would expect the size to say the same? do I need to pass some other
arguments to IMGMOUNT to prevent it growing like this?

Sorry about the confusing, at least I learnt more about rpmbuild and gdb!

Comment 16 Andy Burns 2006-01-25 21:37:09 UTC
After it has written to and has grown, the 2.1MB properdisk.ima file is still
mountable by IMGMOUNT, and dosbox still sees it as a 1.4MB disk with 1.2MB of
files and 200KB of free space, should I close this bug and relog that as a
different one?

Comment 17 Andreas Bierfert 2006-01-25 21:43:55 UTC
I would suggest closing this one (which I will do now ;) ) and submitting this
upstream (maybe add it to

Note You need to log in before you can comment on or make changes to this bug.