This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: cat /proc/registry/HKEY_PERFOMANCE_DATA/@ hangs


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]