Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authentication-Warning: slinky.cs.nyu.edu: Unknown UID 1537 owned process doing -bs Date: Wed, 14 Jul 2004 15:52:10 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: Dave Korn cc: cygwin AT cygwin DOT com Subject: RE: cat /proc/registry/HKEY_PERFOMANCE_DATA/@ hangs In-Reply-To: <20040714184540.GZ1389@cygbert.vinschen.de> Message-ID: References: <20040714184540 DOT GZ1389 AT cygbert DOT vinschen DOT de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.39 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 AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT 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/