From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19299 invoked by alias); 14 Jul 2004 19:52:17 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 19280 invoked from network); 14 Jul 2004 19:52:16 -0000 Received: from unknown (HELO slinky.cs.nyu.edu) (128.122.20.14) by sourceware.org with SMTP; 14 Jul 2004 19:52:16 -0000 Received: from slinky.cs.nyu.edu (localhost [127.0.0.1]) by slinky.cs.nyu.edu (8.12.10+Sun/8.12.10) with ESMTP id i6EJqEVZ001004; Wed, 14 Jul 2004 15:52:14 -0400 (EDT) Received: from localhost (Unknown UID 1537@localhost) by slinky.cs.nyu.edu (8.12.10+Sun/8.12.2/Submit) with ESMTP id i6EJqARX001001; Wed, 14 Jul 2004 15:52:14 -0400 (EDT) X-Authentication-Warning: slinky.cs.nyu.edu: Unknown UID 1537 owned process doing -bs Date: Wed, 14 Jul 2004 21:42:00 -0000 From: Igor Pechtchanski Reply-To: cygwin@cygwin.com To: Dave Korn cc: cygwin@cygwin.com Subject: RE: cat /proc/registry/HKEY_PERFOMANCE_DATA/@ hangs In-Reply-To: <20040714184540.GZ1389@cygbert.vinschen.de> Message-ID: References: <20040714184540.GZ1389@cygbert.vinschen.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.39 X-SW-Source: 2004-07/txt/msg00535.txt.bz2 On Wed, 14 Jul 2004, Dave Korn wrote: > [some comments snipped below] > > -----Original Message----- > > From: Igor Pechtchanski > > Sent: 14 July 2004 19:30 > > > > > However, the fix is not as simple as inserting a "size = > > > > bufalloc;" just before the RegQueryValueEx. When I do that, I get > > > > a SIGSEGV in the guts of iasperf.dll, which I have yet to track > > > > down. > > That'll be the performance monitor dll, then, presumably in some > routine where it's gathered some data from somewhere and is writing it > to your buffer. Presumably it's writing the data to an invalid address. > Or there's a discrepancy somehow between the actual allocated buffer > size and the value you end up passing in *size, and the dll is writing > past the end of the buffer. That's what I figured. What's suspicious is that this happens for three completely different ranges of addresses -- automatic, dynamic (using malloc), and static (yes, that too). There must be something I'm doing wrong here. > > ...or we have some differences in user permissions, operating systems, > > environments, setup, etc, etc, etc. In any case, the above does *NOT* > > work for me. > > How bizarre. Did you verify in gdb that the variable *was* being > correctly set? Yep. It gets set correctly, but as soon as the buffer is large enough and RegQueryValueEx attempts to write to it, it bails out. > > I'm reasonably sure I've rebuilt everything from scratch (I even did a > > "make clean" - ouch). > > Yep, although that wouldn't help if you'd not pressed Ctrl+S in your > editor yet.... I use vi. :-p I've quit it, which is usually a good indication that the file is saved. :-D > > I believe you. It just doesn't work for me. :-( In fact, I'm getting > > a segfault whenever the RegQueryValueEx call attempts to write > > anything to a buffer, whether realloc()'d or automatic > > (stack-allocated). I haven't tried a static array, that's next on my > > list. I'll try to get to the bottom of this eventually. > > How bizarre. It might be worth running the whole thing under windbg, > which will give you symbols for the windoze dlls. Then you'll know what > routine you're in in iasperf.dll. I don't have windbg installed... If I can't figure things out, I'll do that eventually. > > Can't for a while. Can you do me a favor and submit this as a fix, if > > you have a copyright assignment for Cygwin? > > Not yet, unfortunately. Well, as Corinna said, this qualifies as trivial, so you don't need one. > > If it makes you feel better, feel free to mention me in the ChangeLog > > as well. > > Will do! > > > FWIW, there's another buglet (redundant piece of code, actually): > > "type" is never used, so doesn't need to be passed in. Might as well > > fix that (just pass NULL), and the typo in the file name > > (HKEY_PERFO*R*MANCE_DATA), in this patch. > > Heh. Patches that cross in the mail. I don't believe you fixed the "&type" thing in yours... On Wed, 14 Jul 2004, Corinna Vinschen wrote: > On Jul 14 14:29, Igor Pechtchanski wrote: > > > Can't for a while. Can you do me a favor and submit this as a fix, if you > > have a copyright assignment for Cygwin? If it makes you feel better, feel > > free to mention me in the ChangeLog as well. > > David has no copyright assignment on file so far. But that doesn't matter > since the below is definitely a "trivial" patch. Just a ChangeLog entry, > please. Dave, can you please send in an updated patch and a ChangeLog entry (with your name as the contributor, for various legal reasons)? Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha@cs.nyu.edu ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "I have since come to realize that being between your mentor and his route to the bathroom is a major career booster." -- Patrick Naughton -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/