#1 2014-05-07 13:01:44

yoanq
Member
Registered: 2013-01-03
Posts: 24

Invalid Pointer Operation when close WebServer Api

Hi, I need your help. I am working with new project implementing Mormot Server with Interfaced Based Method register with

var
aServer: TSQLRestServerDB;

...
aServer.ServiceRegister(TReservas, [TypeInfo(IReservas)], sicPerSession);

All is working OK except when close server. In that moment I receive Invalid Pointer Operation Error.

This is my log

20140507 08484027  ! info  Server TSQLHttpServer(02FA6678) stopped by TSQLRestServerDB(00E95DB0)
20140507 08484027  ' trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB6B20)) ThreadID=3724 ThreadCount=31
20140507 08484028  & trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB6580)) ThreadID=604 ThreadCount=30
20140507 08484031  / trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB6DF0)) ThreadID=4632 ThreadCount=17
20140507 08484032  8 trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB74B0)) ThreadID=1552 ThreadCount=29
20140507 08484034  1 trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB7390)) ThreadID=2572 ThreadCount=12
20140507 08484035  ; trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB70C0)) ThreadID=5032 ThreadCount=25
20140507 08484036  2 trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB7420)) ThreadID=4736 ThreadCount=22
20140507 08484037  5 trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB71E0)) ThreadID=1408 ThreadCount=11
20140507 08484038  @ trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB7300)) ThreadID=3660 ThreadCount=2
20140507 08484039  3 trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB6BB0)) ThreadID=4704 ThreadCount=19
20140507 08484040  , trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB7150)) ThreadID=2944 ThreadCount=7
20140507 08484041  % trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB68E0)) ThreadID=4932 ThreadCount=15
20140507 08484042  %  +    TSQLDBOracleConnection(00F41BD0).001068C0 SynDBOracle.TSQLDBOracleConnection.Disconnect (1717) 
20140507 08484042  < trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB6A00)) ThreadID=3684 ThreadCount=23
20140507 08484042  * trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB6730)) ThreadID=1572 ThreadCount=26
20140507 08484042  0 trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB6C40)) ThreadID=4240 ThreadCount=27
20140507 08484042  ( trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB64F0)) ThreadID=4584 ThreadCount=28
20140507 08484042  = trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB6970)) ThreadID=4644 ThreadCount=21
20140507 08484042  ? trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB67C0)) ThreadID=4088 ThreadCount=18
20140507 08484042  > trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB63D0)) ThreadID=3448 ThreadCount=20
20140507 08484042  + trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB66A0)) ThreadID=4772 ThreadCount=24
20140507 08484042  A trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB6220)) ThreadID=3892 ThreadCount=14
20140507 08484042  - trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB6E80)) ThreadID=4588 ThreadCount=6
20140507 08484042  9 trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB6CD0)) ThreadID=496 ThreadCount=4
20140507 08484042  : trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB6850)) ThreadID=4564 ThreadCount=3
20140507 08484042  . trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB6460)) ThreadID=5044 ThreadCount=5
20140507 08484042  " trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB62B0)) ThreadID=4296 ThreadCount=1
20140507 08484042  6 trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB6F10)) ThreadID=2288 ThreadCount=0
20140507 08484042  7 trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB6D60)) ThreadID=3520 ThreadCount=10
20140507 08484042  ) trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB6A90)) ThreadID=1708 ThreadCount=13
20140507 08484042  $ trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB6610)) ThreadID=4228 ThreadCount=8
20140507 08484042  # trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB6340)) ThreadID=1624 ThreadCount=9
20140507 08484042  4 trace TSQLRestServerDB(00E95DB0).EndCurrentThread(THttpApiServer(00EB6FA0)) ThreadID=2064 ThreadCount=16
20140507 08484042  %  -    00.003.782
20140507 08484216  A EXC   EInvalidPointer ("Invalid pointer operation") at 00003925 System.TObject.FreeInstance  stack trace API 00046294 SynCommons.SynRtlUnwind (37621) 00004386 System.@ExceptionHandler 00003925 System.TObject.FreeInstance 0007C041 mORMot.TServiceFactoryServerInstance.SafeFreeInstance (34544) 
20140507 08484315  $ EXC   EInvalidPointer ("Invalid pointer operation") at 00003925 System.TObject.FreeInstance  stack trace API 00046294 SynCommons.SynRtlUnwind (37621) 00004386 System.@ExceptionHandler 00003925 System.TObject.FreeInstance 0007C041 mORMot.TServiceFactoryServerInstance.SafeFreeInstance (34544) 
20140507 08484315  #  +    TSQLDBOracleConnection(00F41AF0).001068C0 SynDBOracle.TSQLDBOracleConnection.Disconnect (1717) 
20140507 08484322  #  -    00.119.862

Thank´s Yoan

Offline

#2 2014-05-07 13:28:23

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Invalid Pointer Operation when close WebServer Api

How do you destroy the server instances?

Offline

#3 2014-05-07 13:32:01

yoanq
Member
Registered: 2013-01-03
Posts: 24

Re: Invalid Pointer Operation when close WebServer Api

This is my variable definitions

    /// the associated database model
    aModel: TSQLModel;
    /// the associated DB
    aServer: TSQLRestServerDB;
    /// the background Server processing all requests
    aHTTPServer: TSQLHttpServer;

Destroy:

  FreeAndNil(aHTTPServer);
  FreeAndNil(aServer);
  FreeAndNil(aModel);

Offline

#4 2014-05-08 07:45:56

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Invalid Pointer Operation when close WebServer Api

... and the TSQLDBOracleConnectionProperties?

Offline

#5 2014-05-08 12:55:50

yoanq
Member
Registered: 2013-01-03
Posts: 24

Re: Invalid Pointer Operation when close WebServer Api

I found the problems. We register one services using sicShared and in the destructor in the services class detect the problem. No problems with Mormot, its was our error.

Thank´s.

Offline

#6 2014-05-08 13:48:33

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Invalid Pointer Operation when close WebServer Api

Great!

Thanks for the update.
smile

Offline

Board footer

Powered by FluxBB