This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: malloc-bzero and /proc/pid/statm reading bug
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 13 Sep 2010 15:03:56 +0200
- Subject: Re: malloc-bzero and /proc/pid/statm reading bug
- References: <722657.29232.qm@web25502.mail.ukl.yahoo.com>
- Reply-to: cygwin at cygwin dot com
On Sep 12 20:38, Marco Atzeri wrote:
> on the ngspice development list one of the developer
> find a likely cygwin bug, see description an test case
>
> --- Dom 12/9/10, Robert Larice ha scritto:
>
> > Hello All,
> >
> > Â I need some help with a cygwin Problem.
> > Â Trying to find a bug reported for ngspice,
> > Â Â I finally could boil the problem down
> > Â Â to what seems to be a plain cygwin bug.
> >
> > Â The attached very small C file, fails
> > Â Â after some iterations to open a
> > Â Â certain /proc/.. entry
> >
> [cut]
> >
> > Â Here I get:
> > Â ÂÂÂmalloc -> 0x7fd30008
> > Â ÂÂÂmalloc -> 0x7fab0008
> > Â ÂÂÂmalloc -> 0x7f830008
> > Â ÂÂÂmalloc -> 0x7f470008
> > Â ÂÂÂmalloc -> 0x7f1f0008
> > Â ÂÂÂmalloc -> 0x7ef70008
> > Â ÂÂÂ/proc/3044/statm: No error
> > Â ÂÂÂmalloc -> 0x7ecf0008
> > Â ÂÂÂ/proc/3044/statm: No error
> > Â ÂÂÂ...
> >
> > Â { No error, nevertheless means,
> > Â ÂÂÂthe thing can't be read ... }
> >
> > Thanks,
> > Â Robert Larice
>
> I checked and both 1.7.7 and the latest 20100912
> show the issue.
> Are we assuming something wrong and missing something else
> or is it a bzero bug ?
It's not a bzero bug, but a bug in the implementation of /proc/$PID/statm.
The function needs to allocate memory itself to fetch the memory pages
working set information from the OS, and the allocation itself wasn't
foolproof. Should be fixed in CVS now.
Thanks for the testcase,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple