[Win32utils-devel] [Fwd: [win32utils-help] Eventlog problem]
djberg96 at gmail.com
Sun Jan 8 12:31:13 EST 2006
Park Heesob wrote:
>On Sat, 07 Jan 2006 11:37:11 -0700, Daniel Berger wrote
>>No, it didn't work for me. It looks more like a problem with the
>>allocation scheme, i.e calling eventlog_allocate() directly. That's
>>what changed from 0.2.4 to 0.2.5. It doesn't look like instance
>>variables set in open_backup are getting set properly. When I try to
>>print out @source in eventlog_iread, it's null, and I don't know why.
>>I'm actually confused in general by what the proper way to instantiate
>>an object is on the C side now, since there are now about 6 different
>>approaches one could take, and I don't know what the best one is.
>>I'll have to find a way to add tests for this into the tc_eventlog.rb
>>test case, though I had problems making it work last time.
>>I'll keep hammering at it.
>If your @source is null, it's because you omitted it.
>You must specify source like this:
>e = EventLog.open_backup("c:\\system.bak","System")
>win32utils-devel mailing list
>win32utils-devel at rubyforge.org
I finally narrowed the segfault down to this in the GetDescription
method in eventlog.h:
value = rb_str_new2("The description for Event ID cannot be
The following information is part of the event:\r\n");
if(NIL_P(va_list)) /* BOOM */
rb_str_cat(value, "Event LogFile Corrupted",
strlen("Event LogFile Corrupted"));
rb_str_cat(value, va_list, strlen(va_list));
So, to prevent a segfault that line should be changed to:
On a side note, it appears that I can't even open this file using the
GUI tool - it says "select a type for this log".
So, is the solution then to allow the user to set the log type
("Application", "Security", etc"), and default to "Application"? Is
that what you've been saying all along and I'm just thick?
Well, if anything, at least I was able to narrow down the segfault. :)
More information about the win32utils-devel