delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/09/13/09:04:26

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 13 Sep 2010 15:03:56 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: malloc-bzero and /proc/pid/statm reading bug
Message-ID: <20100913130356.GV16534@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <722657 DOT 29232 DOT qm AT web25502 DOT mail DOT ukl DOT yahoo DOT com>
MIME-Version: 1.0
In-Reply-To: <722657.29232.qm@web25502.mail.ukl.yahoo.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019