Program crashes on reaching a certain size

Program crashes on reaching a certain size

Post by arizv » Wed, 02 Mar 2005 07:07:14


Hi,

Can anyone tell me how to reduce application size of a Turbovision
program compiled with djgpp. A medium sized TV application easily
becomes 1MB in size, and I need my executable to be much less in size.
Can I modify the TV libraries ? I dont need any internationalization.
If I dont need the mouse, how can I remove mouse handling.

The reason I need this is that whenever I reach a certain line of code,
my program crashes. I have identified the exact line in my code on
reaching which the program crashed. This line of code itself is not the
culprit (no illegal memory access) because when I reduce the
application size by deleting the lines before this line, the
application does not crash.

The crash dump 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

Any help will be appreciated!!

Thank you,
ARIZVI
 
 
 

Program crashes on reaching a certain size

Post by Eli Zarets » Wed, 02 Mar 2005 08:12:22

> From: "arizvi" < XXXX@XXXXX.COM >

Did you strip the executable, or does it still include debug info?


If that's the reason, I'd suggest to debug the cause of the crashes,
not to sweep the bug under the carpet. I'm sure you have a real bug
on your hand, and even if you make the program smaller somehow, that
bug will eventually raise its ugly head.

 
 
 

Program crashes on reaching a certain size

Post by Andrew Cot » Wed, 02 Mar 2005 19:21:54

>> Can anyone tell me how to reduce application size of a Turbovision

I suggest you ensure that you have the latest TV used in the Rihde
1.5.01, this way there will be less bugs in it.

Andrew
 
 
 

Program crashes on reaching a certain size

Post by arizv » Thu, 03 Mar 2005 03:12:35

Hi Eli,
Thanks for the reply.


I had not stripped the executable. Now, I have compiled using the -s
option, and my exe size is much reduced. But the program still crashes.

The only thing I can think of is that I am compiling my program on XP,
and then later running it on a DOS environment. I did this only out of
convenience -
my XP had everything to compile and link TV. I guess I will have to
install TV on a pure DOS machine.

Can it be that slightly different .exe formats expected by DOS and
WinXP are the cause of the problem?


Thanks,
Ahmad
 
 
 

Program crashes on reaching a certain size

Post by Andrew Cot » Thu, 03 Mar 2005 06:23:14


I have not seen this. It usuaully happens the other way (works in DOS
and crashes in XP).

With Rhide there are issues with the video bios that TV uses. To work
arround the Bios bugs you need to start Rhide with a -S (upper case)
option. I suggest that you grab the Rhide source code and see what
this does and do and add this option to your program to see if it
works. It's a long shot.

Andrew
 
 
 

Program crashes on reaching a certain size

Post by Eli Zarets » Thu, 03 Mar 2005 06:58:41

> From: "arizvi" < XXXX@XXXXX.COM >

That's expected: the debug info only bloats the .exe file on the disk,
but does not affect in any way how the code is layed out in memory.


No, the same .exe file is produced and runs on all supported opertaing
systems.

However, since you mentioned XP, is it possible that your program
crashes because of some known problem with XP related to DJGPP? Are
you using the latest djdev203.zip? And what is the exact code
fragment where it crashes?
 
 
 

Program crashes on reaching a certain size

Post by arizv » Thu, 03 Mar 2005 23:51:35

Thanks to those who replied. I was able to find the error. It was due
to incorrect order of my initialization statements. This would lead to
program crash eventually at different points in the program. It was
hard to debug, but I did it finally :)