[Win32utils-devel] Service.services bug (pure Ruby version)

Daniel Berger djberg96 at gmail.com
Sat Nov 3 09:37:02 EDT 2007


Hi all,

I've hit a curious bug in the Service.services method. This is in the 
pure Ruby version in CVS. Check it out and run this snippet:

Service.services{ |s|
    p s.service_name
    p s.display_name
}

That will segfault after about 14 entries for me. It appears to be a 
problem with memcpy on line 658, but I couldn't tell you why.

The interesting thing is that the more I use 'puts', the less likely 
this error is to occur. To show you what I mean, try this snippet:

Service.services{ |s|
    puts s.service_name
    p s.display_name
}

That gets further, but will still segfault. Now try this:

Service.services{ |s|
    puts s.service_name
    puts s.display_name
}

That one gets me through all services without segfaulting.

I know I've seen various reports over the years of a 'puts' that made 
bugs mysteriously disappear, so I'm wondering if I've hit upon 
something. Can anyone tell me what's going on?

Thanks,

Dan


More information about the win32utils-devel mailing list