Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002889 [JEDI VCL] 00 JVCL Components minor always 2005-04-20 03:49 2006-06-07 03:46
Reporter dbond View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.00
Summary 0002889: Access Violation with JvNTEventLog
Description The JvNTEventLog component repeatedly causes an access violation when used to access the local client 'System' Event log (see attached "JvNTEventLog-ScreenShot.gif"). The project used was the distributed example "JVCL\examples\JvNTEventLog\EventViewer.dpr".

Error appears to be generated by line 510 of "JvNTEventLog.pas":
" if LookupAccountSID(nil, SID, UserName, UserNameLen, DomainName, DomainNameLen, Use) then
    Result := string(DomainName) + '\' + string(UserName);"
in "function TJvNTEventLogRecord.GetUsername: string;"

Error Message =
"Project EventViewer.exe raised exception class EAccessViolation with message 'Access violation address 77E7F912 in module 'RPCRT4.dll'.
Read of address 00934000'. Process stopped. Use Step or Run to continue."

RPCRT4.dll has file version "5.1.2600.2180 (xpsp_sp2_rtm.040803-2158)" (Creation Date 10 December 2004).
Additional Information Client/Build Operating System=Windows XP Pro (Build 2600: Service Pack 2)
Compiler=Delphi 7.0 Enterprise (Build 8.1)

JCL Build=JCL1.95-Build1848 (Clean Install)
JVCL Build=JVCL300CompleteJCL195-Build1848 (Clean Install)
Tags No tags attached.
Attached Files gif file icon JvNTEventLog-ScreenShot.gif [^] (72,264 bytes) 2005-04-20 03:49

- Relationships
related to 0002970resolvedobones JvNTEventLog hangs if OnChange is assigned 

-  Notes
(0007045)
obones (administrator)
2005-04-22 06:30

Same here, under WinXP SP1, I'm looking into it.
(0007046)
obones (administrator)
2005-04-22 07:15

This seems to be a big bug with the LookupAccountSID function as if you pass it 0 for the lenghts of the parameters, it does return False, but does not fill up the parameters with the required lengths.
Further, it sometimes fails at item 263, then 1252...
I'm not clear as to what I can do about this.
(0008764)
obones (administrator)
2006-03-30 07:35

Could you try again with a patched windows and the latest version of the JVCL?
I tried here compiled with BDS2006 and I don't get an AV anymore.
(0009008)
dbond (reporter)
2006-04-06 06:28

Hi there, tried with Windows XP SP2 fully patched, and JVCL 3.2 (still using Delphi Enterprise Version 7 Build 8.1) - problem still there.
(0009270)
vorxio (reporter)
2006-05-10 09:22

Hi,
I SOLVED the problem:

function TJvNTEventLogRecord.GetSID: PSID;
begin
  if PEventLogRecord(FCurrentRecord)^.UserSidLength = 0 then
    Result := nil
  else
    Result := PSID( PChar(FCurrentRecord) + PEventLogRecord(FCurrentRecord)^.UserSidOffset);
end;


function TJvNTEventLogRecord.GetUsername: string;
...
...

  if SID = nil then // SID can be nil
  begin
    Result := 'N/A';
    Exit;
  end;

  try
    if LookupAccountSID(nil, SID, UserName, UserNameLen, DomainName, DomainNameLen, Use) then
      Result := string(DomainName) + '\' + string(UserName);
  except
    result := '???';
  end;
end;

Bye,
  Vor
(0009271)
vorxio (reporter)
2006-05-10 09:26

Reminder sent to: dbond, obones

I solved 0002889

Bye
(0009272)
dbond (reporter)
2006-05-10 10:47

Hi all,
Yes, the fix from Vorxio fixed the problem - I managed to compile a couple of test programs looking at different logs with no issues.
Many thanks to all involved (especially Vorxio) for all their hard work.
Cheers,
David
(0009406)
obones (administrator)
2006-06-07 03:46

This is now fixed in SVN

- Issue History
Date Modified Username Field Change
2005-04-20 03:49 dbond New Issue
2005-04-20 03:49 dbond File Added: JvNTEventLog-ScreenShot.gif
2005-04-22 06:30 obones Note Added: 0007045
2005-04-22 06:30 obones Status new => confirmed
2005-04-22 07:15 obones Note Added: 0007046
2005-05-20 08:02 obones Relationship added has duplicate 0002970
2005-05-20 08:03 obones Relationship deleted has duplicate 0002970
2005-05-20 08:03 obones Relationship added related to 0002970
2006-03-30 07:35 obones Note Added: 0008764
2006-03-30 07:35 obones Status confirmed => feedback
2006-04-06 06:28 dbond Note Added: 0009008
2006-05-10 09:22 vorxio Note Added: 0009270
2006-05-10 09:23 vorxio Issue Monitored: vorxio
2006-05-10 09:26 vorxio Issue Monitored: obones
2006-05-10 09:26 vorxio Note Added: 0009271
2006-05-10 10:41 dbond Issue Monitored: dbond
2006-05-10 10:47 dbond Note Added: 0009272
2006-06-07 03:46 obones Status feedback => resolved
2006-06-07 03:46 obones Resolution open => fixed
2006-06-07 03:46 obones Assigned To => obones
2006-06-07 03:46 obones Note Added: 0009406


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker