Operating System - HP-UX
1748217 Members
4273 Online
108759 Solutions
New Discussion юеВ

how to debug core file using wdb with my program

 
eric wang_2
Frequent Advisor

how to debug core file using wdb with my program


my program was stop
this is my core dump file
(gdb) bt
#0 0x60000000c03ff2f0:0 in _read_sys+0x30 () from /usr/lib/hpux32/libc.so.1
#1 0x60000000c0414880:0 in read+0x80 () from /usr/lib/hpux32/libc.so.1
#2 0x60000000c03db5e0:0 in _filbuf+0x1a0 () from /usr/lib/hpux32/libc.so.1
#3 0x60000000c01fe800:0 in __fgets_unlocked+0x200 ()
from /usr/lib/hpux32/libc.so.1
#4 0x60000000c01fe420:0 in fgets+0x140 () from /usr/lib/hpux32/libc.so.1
#5 0x4329ac0:0 in CHpuxPartition::Collect () at hpux/CHpuxPartition.cpp:107
#6 0x4328ad0:0 in CHpuxCmmPartitionUsage::Collect ()
at hpux/CHpuxCmmPartitionUsage.cpp:25
#7 0x4263c70:0 in cmm::Collect () at cmm.cpp:26
#8 0x408bb20:0 in das::DoingCMM () at das.cpp:1161
#9 0x4088520:0 in das::Routine () at das.cpp:1077
#10 0x4084570:0 in main () at das_main.cpp:284

in number 5 CHpuxPartition program call while
while (fgets(buf,sizeof(buf),fp)!=NULL)this line,
FILE *fp=NULL;
char buf[MAXLEN];
const char *cmdline="bdf|grep vg";

fp=popen(cmdline,"r");

while (fgets(buf,sizeof(buf),fp)!=NULL)
{
..........
}
How should i do to debug this or what wrong whith program

thanks


5 REPLIES 5
Dennis Handly
Acclaimed Contributor

Re: how to debug core file using wdb with my program

Your program is waiting on the pipe for more data. Perhaps the bdf is hanging? That's the process that you need to debug.
Horia Chirculescu
Honored Contributor

Re: how to debug core file using wdb with my program

Maybe you do have some NFS mounted volumes that caused bdf to hang.

After the NFS server would become on-line again, your program could go on as nothing happened.

Best regards,
Horia.
Best regards from Romania,
Horia.
eric wang_2
Frequent Advisor

Re: how to debug core file using wdb with my program


yes ,your are right ,bdf is hanged
I would like to know how to debug this,or solve the problem
change the bdf command ,replace another
but i don't know the command name
to do the same functin
#bdf|grep vg
or another command or api can do the same right thing to do the same function

I found bdf is hanged because bdf is try to mount a network disk, but the network disk is not in the same domain network, so it 's hanged




Dennis Handly
Acclaimed Contributor

Re: how to debug core file using wdb with my program

>I don't know the command name to do the same function ... or another command or API can do the same right thing to do the same function

What function?
If you want to see local disks, you can use:
bdf -t vxfs
And "-t hfs" if you have any of those.

>the network disk is not in the same domain network

Does it ever get mounted? If not, remove it from /etc/fstab.
Horia Chirculescu
Honored Contributor

Re: how to debug core file using wdb with my program

>I found bdf is hanged because bdf is try to mount a network disk

bdf never try to mount anything!

From man page:

"If no file system is specified, the free space on all of the normally mounted file systems is printed"

bdf hangs becouse the remote filesystem is not accesible.

Horia
Best regards from Romania,
Horia.