noreply at rubyforge.org
2006-May-29 15:20 UTC
[Win32utils-devel] [ win32utils-Bugs-4598 ] possible wrong condition
Bugs item #4598, was opened at 2006-05-29 11:20
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=411&aid=4598&group_id=85
Category: win32-eventlog
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Nobody (None)
Assigned to: Nobody (None)
Summary: possible wrong condition
Initial Comment:
Is this condition right?
(eventlog.rb, line 494
if flags | EVENTLOG_SEEK_READ > 0
offset = buf[8,4].unpack(''L'').first + 1
end
To me it seems that it is always true as E_S_R == 2.
Maybe this is how it was meant:
unless flags & EVENTLOG_SEEK_READ > 0
I haven''t understood the rest of the code, so I''m not sure
about the solution.
Jano Svitok
----------------------------------------------------------------------
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=411&aid=4598&group_id=85
noreply at rubyforge.org
2006-May-29 17:38 UTC
[Win32utils-devel] [ win32utils-Bugs-4598 ] possible wrong condition
Bugs item #4598, was opened at 2006-05-29 08:20 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=4598&group_id=85 Category: win32-eventlog Group: None Status: Open>Resolution: AcceptedPriority: 3 Submitted By: Nobody (None)>Assigned to: Daniel Berger (djberg96)Summary: possible wrong condition Initial Comment: Is this condition right? (eventlog.rb, line 494 if flags | EVENTLOG_SEEK_READ > 0 offset = buf[8,4].unpack(''L'').first + 1 end To me it seems that it is always true as E_S_R == 2. Maybe this is how it was meant: unless flags & EVENTLOG_SEEK_READ > 0 I haven''t understood the rest of the code, so I''m not sure about the solution. Jano Svitok ---------------------------------------------------------------------->Comment By: Daniel Berger (djberg96)Date: 2006-05-29 10:38 Message: Not only is the code wrong, some testing revealed that code was the source of another bug. Specifically, a seek + backwards read would loop infinitely. I believe this is the proper code: if flags & EVENTLOG_SEEK_READ > 0 if flags & EVENTLOG_FORWARDS_READ > 0 offset = buf[8,4].unpack(''L'').first + 1 else offset = buf[8,4].unpack(''L'').first - 1 end end I''ll add some more tests for this. Many thanks for the report! - Dan ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=4598&group_id=85
noreply at rubyforge.org
2006-Jun-18 17:07 UTC
[Win32utils-devel] [ win32utils-Bugs-4598 ] possible wrong condition
Bugs item #4598, was opened at 2006-05-29 08:20
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=411&aid=4598&group_id=85
Category: win32-eventlog
Group: None
Status: Open
Resolution: Accepted
Priority: 3
Submitted By: Nobody (None)
Assigned to: Daniel Berger (djberg96)
Summary: possible wrong condition
Initial Comment:
Is this condition right?
(eventlog.rb, line 494
if flags | EVENTLOG_SEEK_READ > 0
offset = buf[8,4].unpack(''L'').first + 1
end
To me it seems that it is always true as E_S_R == 2.
Maybe this is how it was meant:
unless flags & EVENTLOG_SEEK_READ > 0
I haven''t understood the rest of the code, so I''m not sure
about the solution.
Jano Svitok
----------------------------------------------------------------------
>Comment By: Daniel Berger (djberg96)
Date: 2006-06-18 10:07
Message:
Here was the final patch, applied to CVS:
if flags & EVENTLOG_BACKWARDS_READ > 0
offset = buf[8,4].unpack(''L'').first - 1
else
offset = buf[8,4].unpack(''L'').first + 1
end
This will be in the next release.
Dan
----------------------------------------------------------------------
Comment By: Daniel Berger (djberg96)
Date: 2006-05-29 10:38
Message:
Not only is the code wrong, some testing revealed that code was the source of
another bug. Specifically, a seek + backwards read would loop infinitely.
I believe this is the proper code:
if flags & EVENTLOG_SEEK_READ > 0
if flags & EVENTLOG_FORWARDS_READ > 0
offset = buf[8,4].unpack(''L'').first + 1
else
offset = buf[8,4].unpack(''L'').first - 1
end
end
I''ll add some more tests for this. Many thanks for the report!
- Dan
----------------------------------------------------------------------
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=411&aid=4598&group_id=85
noreply at rubyforge.org
2006-Jun-18 17:08 UTC
[Win32utils-devel] [ win32utils-Bugs-4598 ] possible wrong condition
Bugs item #4598, was opened at 2006-05-29 08:20 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=4598&group_id=85 Category: win32-eventlog>Group: Code >Status: ClosedResolution: Accepted Priority: 3 Submitted By: Nobody (None) Assigned to: Daniel Berger (djberg96) Summary: possible wrong condition Initial Comment: Is this condition right? (eventlog.rb, line 494 if flags | EVENTLOG_SEEK_READ > 0 offset = buf[8,4].unpack(''L'').first + 1 end To me it seems that it is always true as E_S_R == 2. Maybe this is how it was meant: unless flags & EVENTLOG_SEEK_READ > 0 I haven''t understood the rest of the code, so I''m not sure about the solution. Jano Svitok ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2006-06-18 10:07 Message: Here was the final patch, applied to CVS: if flags & EVENTLOG_BACKWARDS_READ > 0 offset = buf[8,4].unpack(''L'').first - 1 else offset = buf[8,4].unpack(''L'').first + 1 end This will be in the next release. Dan ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2006-05-29 10:38 Message: Not only is the code wrong, some testing revealed that code was the source of another bug. Specifically, a seek + backwards read would loop infinitely. I believe this is the proper code: if flags & EVENTLOG_SEEK_READ > 0 if flags & EVENTLOG_FORWARDS_READ > 0 offset = buf[8,4].unpack(''L'').first + 1 else offset = buf[8,4].unpack(''L'').first - 1 end end I''ll add some more tests for this. Many thanks for the report! - Dan ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=411&aid=4598&group_id=85