Help with Crash Dump

A

arizvi

Hi,

My program crashes when it reaches a certain line. There is nothing
wrong with that particular line as I have changed it to something
simple like i=0, and it still crashes.

If I remove some paras of code from lines previous to this line, the
program run fine and does not crash. So I think that this has to do
with some kind of overflow. It seems to me that if the number of lines
of code accessed by my program goes above a limit, it crashes. So I
tried reducing the size of my program by removing the debug info during
compilation, but the program still crashes.

So I need help with understanding the crash dump. This is given below:

Exiting due to SIGSEGV
General protection fault at eip = 00002380

eax=01da2724 ebx=001190e4 ecx=001190e4
edx=00078500 esi=0011ed54 edi=00119060
ebp=00118fe8 esp=00118f60 program=a:\test.exe

cs: sel=00a7 base=10000000 limit=0012ffff
ds: sel=00af base=10000000 limit=0012ffff
es: sel=00af base=10000000 limit=0012ffff
fs: sel=00bf base=00000000 limit=0010ffff
gs: sel=00bf base=00000000 limit=0010ffff
ss: sel=00af base=10000000 limit=0012ffff

App stack: [0011912c..0009912c]
Exception stack: [00099080..00097140]

Call frame traceback EIPs:
0x00002380
0x000024a7
0x000094d3
0x0000267d
0x0003aa08

Btw, the program is written in C using the DJGPP compiler (GCC for DOS)
and compiled on a xp computer. Then I transfer the program on a floppy
to my DOS box, and run it - where it crashes. Can it have anything to
do with this XP->DOS transfer with subtly differing exe formats.

Any help is appreciated!!

Thanks,
Ahmad
 
D

Dmitry

It looks like 'some paras of code' is the source of error. Check it
carefully for array index running out of range, wrong pointer arithmetic
and so on.
 
C

CBFalconer

arizvi said:
My program crashes when it reaches a certain line. There is nothing
wrong with that particular line as I have changed it to something
simple like i=0, and it still crashes.

If I remove some paras of code from lines previous to this line,
the program run fine and does not crash. So I think that this has
to do with some kind of overflow. It seems to me that if the number
of lines of code accessed by my program goes above a limit, it
crashes. So I tried reducing the size of my program by removing the
debug info during compilation, but the program still crashes.

So I need help with understanding the crash dump. This is given
below:

Exiting due to SIGSEGV
General protection fault at eip = 00002380

eax=01da2724 ebx=001190e4 ecx=001190e4
edx=00078500 esi=0011ed54 edi=00119060
ebp=00118fe8 esp=00118f60 program=a:\test.exe

cs: sel=00a7 base=10000000 limit=0012ffff
ds: sel=00af base=10000000 limit=0012ffff
es: sel=00af base=10000000 limit=0012ffff
fs: sel=00bf base=00000000 limit=0010ffff
gs: sel=00bf base=00000000 limit=0010ffff
ss: sel=00af base=10000000 limit=0012ffff

App stack: [0011912c..0009912c]
Exception stack: [00099080..00097140]

Call frame traceback EIPs:
0x00002380
0x000024a7
0x000094d3
0x0000267d
0x0003aa08

Btw, the program is written in C using the DJGPP compiler (GCC
for DOS) and compiled on a xp computer. Then I transfer the
program on a floppy to my DOS box, and run it - where it crashes.
Can it have anything to do with this XP->DOS transfer with subtly
differing exe formats.

You are off-topic in c.l.c, which does not deal with compiler or
system specific things, but only the portable language. You have
shown no code. If you had included a minimal compilable program
that exhibited the problem, and was written in standard C, your
question would be topical.

At any rate I have set follow-ups and cross-posted to
comp.os.msdos.djgpp. Go there for any answers.
 
J

jacob navia

arizvi said:
Hi,

My program crashes when it reaches a certain line. There is nothing
wrong with that particular line as I have changed it to something
simple like i=0, and it still crashes.

If I remove some paras of code from lines previous to this line, the
program run fine and does not crash. So I think that this has to do
with some kind of overflow. It seems to me that if the number of lines
of code accessed by my program goes above a limit, it crashes. So I
tried reducing the size of my program by removing the debug info during
compilation, but the program still crashes.

So I need help with understanding the crash dump. This is given below:

Exiting due to SIGSEGV
General protection fault at eip = 00002380

This means that yhe program counter registerwas at 0x2380
when the fault occurred.
Now, you have to find out to which line of code corresponds
to that address.

There are several methods of finding that information:
1:
call the linker with some "map" option, that will print
a map of the gegerated program, specifying at which address
all procedures are loaded. Then you have to find 0x2380 in that
list of procedures.

2: Use some debugger to load the program in memory and try to
find out the addresses that are nearest to 0x2380.
eax=01da2724 ebx=001190e4 ecx=001190e4
edx=00078500 esi=0011ed54 edi=00119060
ebp=00118fe8 esp=00118f60 program=a:\test.exe

All those registers do not tell you much about the crash unless
you have pinned down the exact disassembly of the instruction
provoking the crash. In that case, it will allow you
to see which variables were involved in the crash. To read
that though, you will need a good knowledge of assembly language.
cs: sel=00a7 base=10000000 limit=0012ffff
ds: sel=00af base=10000000 limit=0012ffff
es: sel=00af base=10000000 limit=0012ffff
fs: sel=00bf base=00000000 limit=0010ffff
gs: sel=00bf base=00000000 limit=0010ffff
ss: sel=00af base=10000000 limit=0012ffff

App stack: [0011912c..0009912c]
Exception stack: [00099080..00097140]

Call frame traceback EIPs:
0x00002380
0x000024a7
0x000094d3
0x0000267d
0x0003aa08

This is a bonus information and very useful. You repeat the
steps you did to find out which procedure corresponds to
0x2380 and apply it to 0x24a7, 0x94d3, etc, and you will
be able to restitute the whole stack as it was when the
exception happened.
Btw, the program is written in C using the DJGPP compiler (GCC for DOS)
and compiled on a xp computer. Then I transfer the program on a floppy
to my DOS box, and run it - where it crashes. Can it have anything to
do with this XP->DOS transfer with subtly differing exe formats.

Unlikely since if the exe format was wrong, the program wouldn't be
loaded at all.
 
A

arizvi

Hi Jacob,

Thanks for your reply. I was able to find the source of error. It was
due to incorrect initialization.
The source of error was hard to debug, since the program had undefined
behavior - it crashed at different locations on different runs of the
program.

Thanks guys,
Ahmad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top