#1 2019-02-13 14:28:57

Daniel
Member
Registered: 2016-12-08
Posts: 23

Service startup exception: TSynLog.AutoTable VMT entry already set

We have a service application which contains two WebSocket servers.
This morning the service didn't start and the following windows event log was logged:

TSynLog.AutoTable VMT entry already set

So that only gets raised in

class function TSynLog.FamilyCreate: TSynLogFamily;
...
    if PPointer(PVMT)^<>nil then
      raise ESynException.CreateUTF8('%.AutoTable VMT entry already set',[self]);


We can not reproduce the problem locally and from looking at the code I can't figure out how can it possibly happen, except if both services access TSynLog.Family at the same time.

Do you have any pointers/suggestions as to what could be the problem or how to avoid it ?

We have since added the following as first code in DPR file

begin
  TSynLog.Family.Level := [sllException, sllExceptionOS];
  TSynLog.Family.AutoFlushTimeOut := 10;

Will that perhaps indirectly fix the problem by ensuring Family is created as first thing the app does ?

Thanks for your time.

Offline

#2 2019-02-13 17:05:52

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

Re: Service startup exception: TSynLog.AutoTable VMT entry already set

Yes, calling TSynLog.Family in one of your early initialization section would do the trick.

For a full fix, please try https://synopse.info/fossil/info/59ca8ded8f

Offline

#3 2019-02-13 17:27:45

Daniel
Member
Registered: 2016-12-08
Posts: 23

Re: Service startup exception: TSynLog.AutoTable VMT entry already set

Excellent, thanks for the help and quick reply.

Offline

Board footer

Powered by FluxBB