Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

Access violation errors in TSiSession.enterMethod()


I’ve noticed some access violations in enterMethod(). Here are some excerpts from eurekalog file:

2.5 Type : EAccessViolation
2.6 Message : Access violation at address 00403C2D in module ‘CTIServer.exe’. Read of address 00000000.

|004F6B93|CTIServer.exe|SmartInspect.pas |TSiSession |EnterMethod |22467[8]|
|004F6B44|CTIServer.exe|SmartInspect.pas |TSiSession |EnterMethod |22459[0]|
|004F6B3D|CTIServer.exe|SmartInspect.pas |TSiSession |EnterMethod |22454[1]|
|004F6B34|CTIServer.exe|SmartInspect.pas |TSiSession |EnterMethod |22454[1]|

another exception:

2.6 Message : Access violation at address 004F6B35 in module ‘CTIServer.exe’. Read of address 0000001C.

*Exception Thread: ID=10208; Priority=0; Class=; [Main]

Is enterMethod thread safe?


Hello Piotr,

I have a few questions:

  • Which delphi version do you use?
  • Which overload of EnterMethod did you call to get this exceptions?

Looking at the read addresses (00000000 and 0000001C), it looks a bit like you are trying to use a session variable which has been set to nil. Might this be possible? Or are you using the overloaded version of EnterMethod that allows you to pass a format string and an array parameter, and one of the array parameters is nil?

Yes, EnterMethod (and all other methods of the TSiSession and TSmartInspect classes) is threadsafe.


It’s Delphi 6. I use following version:

SiMain.EnterMethod(Self, methodName );

How could I set session variable (you mean SiMain) to nil?


I thought that you are maybe using a custom session instead of SiMain and delete it somewhere and set it to nil. However, is the exception reproducible or does it occur sometimes at random? I assume you are using the latest SmartInspect version (3.0.6)?


No I stick to use SiMain only. I think it’s not easy to reproduce the problem. By the way, after last exception, logging to *.sil file died.
I’m using 3.0.6


Could you please contact me directly via email about this ( )? It would be great if you could also attach the full Eurekalog report. Solving this issue will probably require going a bit back and forth, so it would be better to take this offline.