1748123 Members
3299 Online
108758 Solutions
New Discussion юеВ

fgets dumps core

 
Rajesh Rajguru
Occasional Contributor

fgets dumps core

Hi,

fgets dumps core after couple of month
The code is like this
while ((status = fgets(buffer, blen, file)) && *buffer == '#')
; // NULL statement

and core stack shows below output
(gdb) where
#0 0x5c55b8 in real_malloc ()
#1 0x5c30f8 in _malloc ()
#2 0x5c8454 in malloc ()
#3 0x5ed1e0 in _findbuf ()
#4 0x5ec0c8 in _filbuf ()
#5 0x5ebd14 in __fgets_unlocked ()
#6 0x5ebefc in fgets ()
...
...
...

Any pointers on this will be of great help
Thanks

Regards,
Rajesh
3 REPLIES 3
Steve Steel
Honored Contributor

Re: fgets dumps core

Hi


Thats a memory error probably a slight leak in it.

Look at
ftp://eh:spear9@hprc.external.hp.com/memory.htm
for memory info.

Use the command
file core
to see what signal was received

Patch Name: PHCO_31903

Patch Description: s700_800 11.11 libc cumulative patch

Creation Date: 04/09/02

Post Date: 04/09/23

Hardware Platforms - OS Releases:
s700: 11.11
s800: 11.11


Fixes on 11.11


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Rajesh Rajguru
Occasional Contributor

Re: fgets dumps core

Hi,

Thanks

I am not able to see
ftp://eh:spear9@hprc.external.hp.com/memory.htm for memory info.

Can you please give it again ?

Do you mean to say that in fgets there is slight mem leak and that is fixed with the patch that you have mentioned ?

Thanks
Steve Steel
Honored Contributor

Re: fgets dumps core

Hi

That patch fixes a malloc error similar to yours

The ftp site is extenal and should work

Memory Usage - ├в What is using all of the memory?├в

by:eric.herberholz@hp.com

Last modified: October 18, 2004

Full document is available at external ftp site: ftp://eh:spear9@hprc.external.hp.com/memory.htm
The "Table of Contents" is available in ITRC doc id MEMORYKBAN00000975


Try it again


Steve
If you want truly to understand something, try to change it. (Kurt Lewin)