Hi All,

I'm running a C code on cygwin compiled with gcc, the code basically does file processing, it runs fine on my PC, but when run on a Solaris machine, it gives Bus error and core dumps. Is it a known issue? If not, is there any way i can debug the core file?

The file i'm trying to process is 45MB in size.
I'm newbie with using the debuggers. Any suggestions are welcome

Thanks
Santosh

Recommended Answers

All 13 Replies

Did you recompile all the code on your solaris machine?

Or did you simply copy the .exe file and hoped it would work. IT WON'T.

> Is it a known issue?
Yes, your code has bugs.

yes you have to compile code for solaris platform also.

Hi,

I did recompile.

Is it possible for the code to have bugs, if yes, y didn't it core dump on the cygwin too?

it seems platform dependency issue

>Is it possible for the code to have bugs
Yes.

>y didn't it core dump on the cygwin too?
Different platform, different system, different architecture.

But if you *really* want to find out the reason, you'll have to post some code, because our guessing isn't going to get you very far.

commented: random guessing is the fun part of debugging +9

Hi,

Its a 800 line code, can i post it here? Or could i send it as a attachment?

Definitely better as an attachment, but 800 lines is probably a bit much for a forum.

Some of us would probably have a quick look for some of the obvious mistakes. But if it's involved, it's several hours work on just one problem.

Do you have a debugger on the solaris box?

Yes, you can use a debugger to examine (not interact with) a core file, but this is "last resort" territory. It's a post mortem on a corpse.

Compiling the code with debug, then running that in the debugger will tell you a lot more (the patient is intensive care, but still alive).
Setting breakpoints at suspect areas of code for example will allow you to see what's really going on.

the problem is the code is working fine until a certain point.. I mean it processes about 24,000 records before it fails.. So will it help setting breakpoints.. N i'm not familiar with debugging

I'm in the process of installing the gdb debugger..

sanushks> So will it help setting breakpoints..
gdb tutorial

Hey thanks for the tutorial.. interestingly written...

the problem is the code is working fine until a certain point.. I mean it processes about 24,000 records before it fails..

Debugging is indeed the answer. But I also what to place a bet on what could be wrong. Are you using dynamic memory? Does the PC on which it runs have (a lot) more memory then your Solaris PC?

Yep i'm using malloc and free, Not sure how to find the memory in the Solaris box, its not a PC. Its a server running on Sun OS 5.9

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.