Hi,
I am facing an issue with the core dump, i am not exactly able to figure out why and where i am getting it and how should i resolve it
Please find the dbx run on the core
reading symbolic information ...
Segmentation fault in realloc_y at 0x900000000046980 ($t1)
0x900000000046980 (realloc_y+0x4fc) 90100000 stw r0,0x0(r16)
(dbx) where
realloc_y(??, ??, ??) at 0x900000000046980
realloc_y_heap(??, ??) at 0x9000000000475a0
sqlrlc(??, ??, ??, ??) at 0x800000000d6c764
sqlcopydfn(??, ??, ??, ??, ??) at 0x800000000d86250
sqlrdf(??, ??, ??, ??, ??, ??) at 0x800000000d865cc
sqlatm(??, ??, ??, ??, ??, ??, ??) at 0x800000000d88d74
sqlnst(??, ??, ??) at 0x800000000d82574
sqlcmex(??, ??, ??, ??, ??) at 0x800000000d74d18
sqlcxt(??, ??, ??, ??) at 0x800000000d74374
unnamed block $b297, line 7956 in "b_pc.c"
SelectSequenceActivity(??), line 7956 in "b_pc.c"
ProcessTravelDealRecord(pTravelDealRecord = 0x000000010007c290), line 5602 in "test.c"
ParseMainSec(??), line 818 in "a.c"
ParseBatch(??), line 192 in "a.c"
ProcessBatch(pBatch = 0x09001000a0003898), line 3198 in "test.c"
main(argc = 0, argv = (nil)), line 1108 in "test.c"
Most likely causes are writing too many bytes into a malloc'd/realloc'd/new'd/etc block, freeing a block multiple times, accessing a block after it's been freed.
Your best approach is to use some sort of memory debug/corruption detection tool. The best tool I know of is something like IBM's (originally Rational) Purify. IIRC, "realloc_y" is an indication you're running on AIX. I don't know for certain the Purify is available for AIX, but it probably is, and it'd probably be a good test case for a demo of Purify to see what it can do.
There are also others tools that provide similar memory-checking capabilities.
Thanks for the responses,
I have looked in the code but couldn't figure out the problem area
I am not having rational purifier.
Murphy i am attaching the file a_pc.c
Those were the only variables using of heap memory I noted in that code, and that code snippet tells me someone's trying everything they can think of to patch over the problem. I'd make sure every possible use of strcpy() or similar is changed to an equivalent strncpy() to make sure the buffers those variables point to aren't overwritten.
I'd probably also convert them to stack variables:
There's a good chance that even doing all that won't work - I didn't see anything in that code that ensures the heap is being corrupted in the code you provided - it could be getting corrupted somewhere else in your application. ANYWHERE else in your application.
So, if the problem persists after that, go to your boss and explain to him that he can keep paying you and however many others are working on this problem $X per hour, or he can just pay for a real memory checking tool. Guess which one is going to be cheaper.
Look at it this way: would you expect someone to fix a car using only two screwdrivers and a pair of pliers? There are tools that make jobs easier, faster, and cheaper. A LOT easier, faster, and cheaper.
Hi guys,
just want to know which core file pattern is best to set for core dumps:
1) per-process file name pattern
or
2) global file name pattern.
I will really appreciate an explanation why the chosen one is better.
Thanks a lot guys. (2 Replies)
how to view core dumped file using gdb and how to extract information from the coredumped file.can we get similar information from the other utilites like strace or ptrace. (2 Replies)
Hello all,
Iam new to unix while executing java program which finely working in windows know iam testing with unix ,but in unix while executing iam getting core dump, my application is in client server environment and it is menu drivrn application on clicking options no problem but after some time... (1 Reply)
Hi All
I am new for this forum. I have a core file by using gdb and bt cmd I got the function name but I want to the exact cause of the core dump because of I can not reproduse the binary so if any one know the cmd plz plz plz let me know. (0 Replies)
Hi All,
i am new to this forum.i want detail of reading the core file and trace the problem because of what the program get crashed.please help me.if any body knows any website or tutoril plese let me know.
sudhir (6 Replies)
I've got a core dump in my weblogic home directory, which i have tried to debug by initiating savecore from /etc/init.d/savecore start
but savecore failed to create the two files, that is vmcore.n and vmunix.n.
savecore is enable on my server to save vmcore and vmunix in /var/crash/hostname
1)... (4 Replies)
Hi ,
Working on AIX 4.3. An internal error from my apps engine suddenly causes the engine to die. During this time i do notice a core file being dumped in the directory from where I try to re-start my engine.
Q is how does one read this core file, or I should say 'what is this core file'?
thnx (2 Replies)
does any one have read a core dump?
is there any reader for that? or may i know what is the use of that core which takes sometimes memory in GBs?
:) (6 Replies)