c0000005 ACCESS_VIOLATION kbmMW Pro 64

Home Forums kbmMW c0000005 ACCESS_VIOLATION kbmMW Pro 64

Viewing 6 reply threads
  • Author
    Posts
    • #55268
      moctes
      Participant

      Hi,

      I’m doing tests compiling a kbmMW server for Win64, there haven’t been many problems so far, I have a batch process which is executed from the client, it runs fine without any issues, but when I close the server application, a main form and a datamodule with kbmMWServer,  kbmMWTCPIndyServerTransport, etc. we are getting c0000005 ACCESS_VIOLATION, the error triggers when the datamodule is being destroyed:

      destructor TkbmMWCustomTCPIPIndyServerTransport.Destroy;
      begin
      Close;
      {$IFDEF KBMMW_USING_INDY_10}
      FSocket.Scheduler:=nil;
      FSocket.OnException:=nil;
      FIndyScheduler.Free;
      {$ENDIF}
      FSocket.free;  <——  HERE !
      FSocket:=nil;
      inherited;
      end;

      This is a fragment of the call stack:

      thread $360:
      00410775 +15 Project.exe System TObject.Free
      00a66de8 +58 Project.exe IdCustomTCPServer TIdCustomTCPServer.Destroy
      00410775 +15 Project.exe System TObject.Free
      0101df94 +84 Project.exe kbmMWTCPIPIndyServerTransport 249 +7 TkbmMWCustomTCPIPIndyServerTransport.Destroy
      00410775 +15 Project.exe System TObject.Free
      0056b81a +8a Project.exe System.Classes TComponent.DestroyComponents
      0056affa +2a Project.exe System.Classes TComponent.Destroy
      0056e7bc +8c Project.exe System.Classes TDataModule.Destroy
      00410775 +15 Project.exe System TObject.Free
      0056b81a +8a Project.exe System.Classes TComponent.DestroyComponents
      007c8694 +44 Project.exe Vcl.Forms DoneApplication
      00481200 +30 Project.exe System.SysUtils DoExitProc
      004136a9 +79 Project.exe System @Halt0
      01cdd97e +de Project.exe Project 400 +13 initialization
      7ffafa05 +0e KERNEL32.DLL BaseThreadInitThunk
      7ffafbe7 +1b ntdll.dll RtlUserThreadStart

      thread $1ec:
      7ffaf9a6 +097 KERNELBASE.dll SleepEx
      00f0f26c +18c Project.exe kbmMWGlobal 17476 +75 TkbmMWEvent.WaitFor
      00f0cda7 +0c7 Project.exe kbmMWGlobal 14552 +31 TkbmMWCustomThread.WaitWork
      0100afed +03d Project.exe kbmMWServer 8778 +4 TkbmMWServerGarbageThread.Execute
      00f0c4bc +06c Project.exe kbmMWGlobal 14279 +6 TkbmMWInnerThread.Execute
      00508dd4 +024 Project.exe madExcept HookedTThreadExecute
      00568fc0 +040 Project.exe System.Classes ThreadProc
      004138ca +03a Project.exe System ThreadWrapper
      00508ca9 +049 Project.exe madExcept ThreadExceptFrame
      7ffafa05 +00e KERNEL32.DLL BaseThreadInitThunk
      7ffafbe7 +01b ntdll.dll RtlUserThreadStart

      thread $284c:
      7ffaf9a6 +097 KERNELBASE.dll SleepEx
      00f0f26c +18c Project.exe kbmMWGlobal 17476 +75 TkbmMWEvent.WaitFor
      00f0cda7 +0c7 Project.exe kbmMWGlobal 14552 +31 TkbmMWCustomThread.WaitWork
      00fcddca +05a Project.exe kbmMWCustomTransport 2069 +12 TkbmMWTransportIdleThread.Execute
      00f0c4bc +06c Project.exe kbmMWGlobal 14279 +6 TkbmMWInnerThread.Execute
      00508dd4 +024 Project.exe madExcept HookedTThreadExecute
      00568fc0 +040 Project.exe System.Classes ThreadProc
      004138ca +03a Project.exe System ThreadWrapper
      00508ca9 +049 Project.exe madExcept ThreadExceptFrame
      7ffafa05 +00e KERNEL32.DLL BaseThreadInitThunk
      7ffafbe7 +01b ntdll.dll RtlUserThreadStart

      But it only happens when the server is compiled as 64 bits binary,  the very same server on 32 bits run and ends its execution flawlessly, What can we do to resolve this issue ?  Can you help ?

      In other subjects:

      I extended my SAU for one year but it is not reflected on the portal

      To use the ORM and bindings one needs to have the enterprise version ?

      TIA

       

    • #55280
      moctes
      Participant

      Everything is alright ? This is worrying, it has been almost 5 days since I asked the question (and much more since my email), without any news so far.

      I hope it is because you are on vacation and not because you are sick or something like that, but you really should think about having at least one person who is aware of what is happening around here.

      I really need help with this and time flies, it would be great if I can have this resolved before the end of the year, if you need more information from me I am at your service.

      With best regards,
      Mocte

      • This reply was modified 5 years, 1 month ago by moctes.
    • #55282
      Babis Michael
      Participant

      moctes,

      From what i saw he’s usually answering to the forum once between 1 or 2 weeks (sometimes 3 weeks too).
      Kim, please improve the support on the forums!

      Thank you

       

    • #55286
      kimbomadsen
      Keymaster

      Hi,

      I have just tried it out with the Standard demo server, compiled with 10.4.1 as Win64, clicked listen, made a few requests and the closed the application without explicitly clicking on DontListen.

      I did not see any exceptions.

      So I wonder if there is something else going on. As it crashes within the Indy shutdown thread, indicates to me to be an Indy issue more than a as such a kbmMW issue.

      Can you provoke it every time, or only sometimes?

    • #55304
      moctes
      Participant

      Thanks for answering,

      If I run the server and make some calls to services and then I stop the server, all is well, the problem occurs every time I run a batch of calls which are supposed to be made at the end of each day, but only if  I run them with a compiled 64 bits binary.

      I’m actually evaluating the task of porting the code to a more recent version of Delphi ( 10.3.3 for the tests) thats the only reason I bought again a license of kbmMW pro, the project is being currently running in production ( and has been for a few years ) compiled with an older version of kbm and Delphi XE whithout issues, in fact, I can run a fresh compiled exe with Delphi 10.3.3 compiled as 32 bits and the problem is not present.

      This is the pattern used from the client application:

      client := nil;
      Try
      client := TMyKbmClient.Create(FConfigServer);
      ResultServer := client.execute(
      ‘ModuleSVC’, ‘MyService’,
      [param1, param2, param3] );
      Finally
      FreeAndNil(client);
      End;

      where
      TMyKbmClient.Create(

      basically wraps a TkbmMWTCPIPIndyClientTransport & TkbmMWSimpleClient for doing calls to the server with Execute which does among other stuff the call to the server with a Request:

      FSimpleClient.Request(ModuleSVC,”,MyService, Args);

      The client application executes a batch of this calls to different server functions a number of times which can be between 250 to 400 service calls depending on the day of the month, configuration, etc., after the client has been closed, if I go to the server application and close it,  everything seems to end fine, we have a procedure to stop the server that runs before closing the application which looks like this:

      mwServer.OnGarbageCollection := nil;
      mwServer.Shutdown;
      repeat
      sleep(100);
      until (mwServer.ShuttingDown);
      mwServer.Active := False;

      The shutdown & repeat cycle was added recently  just to see if it helped solve the problem, but no, the above code runs fine no errors whatsoever

      It is not until (Delphi) destroys the auto created data module that contains the Server, Transport, ConnectionPool, PooledSession that the problema arises and only on the 64 bits binary.

      You missed this part of my original post:

      I extended my SAU for one year but it is not reflected on the portal
      To use the ORM and bindings one needs to have the enterprise version ?

       

      • This reply was modified 5 years, 1 month ago by moctes.
    • #55410
      kimbomadsen
      Keymaster

      Hi,

      The portal should be updated.
      Correct, ORM and SmartBinding is Enterprise Edition features.

    • #55469
      kimbomadsen
      Keymaster

      Hi,

      client := TMyKbmClient.Create(FConfigServer);

      most likely makes your TMykbmClient owned by FConfigServer, but then you later free it yourself, and when FConfigServer dies, it will also attempt to free the now already freed TMykbmClient instance.

      best regards

      Kim/C4D

Viewing 6 reply threads
  • You must be logged in to reply to this topic.