Error reading message!

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
Search

Post Reply
29 posts • Page 3 of 3
Gertjan van Schijndel
Posts: 634
Joined: Mon Aug 02, 2010 10:37 am

Re: Error reading message!

Post by Gertjan van Schijndel »

The error looks to be a crash. You should configure your system to create a crashdump and not an error dialog, if you are not working on your development machine.

The heartbeat to the event and data managers are handled by the driver framework, you do not need to worry about that. A heartbeat to the device should be managed yourself, but there are some classes available to help you with this like 'AliveTimer'.

User avatar
CyaNn
Posts: 97
Joined: Tue Nov 23, 2010 9:48 am

Re: Error reading message!

Post by CyaNn »

Well. I have tried to debug. But the problem came visibly from multiple access due to thread architecture.
The toDp is encapsulated on a mutex (declared static) but I have a question.
Can I have access to a sub-layer synchronisation resource (mutex or another) ? To be sure to sync with all other processes !

User avatar
CyaNn
Posts: 97
Joined: Tue Nov 23, 2010 9:48 am

Re: Error reading message!

Post by CyaNn »

Well, I have just found where came from my mistake.
I imagined fixe the problem of multi-tread by using a QMutex but the message acquisition was still in another thread than the main one.
To fix it I have created a QQueue with messages. Threads enqueue and workproc dequeue and store in db. It's work great now. ;) ;) ;)

Thanks a lot for your various supports. B) B) B) B)

Another question (simpler this time) : how to detect if driver in on the active chain to desactivate the communication ?

Thanks a lot in advance.
Best
Yann :woohoo:

User avatar
leoknipp
Posts: 2926
Joined: Tue Aug 24, 2010 7:28 pm

Re: Error reading message!

Post by leoknipp »

Hello,

I had a look at the additional question but I didn't understand it.
What is meant with "active chain"?
Which communication shall be deactivated?

Best Regards
Leopold Knipp
Senior Support Specialist

Gertjan van Schijndel
Posts: 634
Joined: Mon Aug 02, 2010 10:37 am

Re: Error reading message!

Post by Gertjan van Schijndel »

I think he wants to disable the communication on the passive server.

You can check if your are on the active server with 'Resources::isRedActive()' or use the redundant system messages as shown below:

Code: Select all

void YourDrvManager::SysMsg &sysMsg)
{
  // Always call the baseclass
  DrvManager::doReceive(sysMsg);

  switch (sysMsg.getSysMagType())
  {
    case REDUNDANCY_SYS_MSG:
    {
      // The messages come from Data und Event. Ignore Data,
      // only use the status of the Event manager
      if (sysMsg.getSource() != Manager::eventId)
        break;

      // A Redu-SysMsg has multiple subtypes.
      // REDUNDANCY_SYS_MSG has the subtype RedundancySubType
      switch ((RedundancySubType)sysMsg.getSysMsgSubType())
      {
        case REDUNDANCY_ACTIVE:   // Here we become aktive
        break;

        case REDUNDANCY_PASSIVE :  // Here we become passive
        break;
      }
    }
  }
}

User avatar
CyaNn
Posts: 97
Joined: Tue Nov 23, 2010 9:48 am

Re: Error reading message!

Post by CyaNn »

Hello.

Yes ! that's exactly what I was looking for.

Thanks a lot and I wish you a pleasant afternoon.
Yann

User avatar
CyaNn
Posts: 97
Joined: Tue Nov 23, 2010 9:48 am

Re: Error reading message!

Post by CyaNn »

Another little problem.

Driver crashes again with a new message :
PVSS00TCPComm2:R6025
PVSS00TCPComm2:- pure virtual function call

:unsure: :unsure: :unsure: :unsure:

Please can you indicate me what does it mean ?

Thank you in advance ;)
Best regards
Yann

User avatar
mpoint
Posts: 49
Joined: Thu Oct 28, 2010 11:28 am

Re: Error reading message!

Post by mpoint »

If a method is declared like "virtual void foo() = 0;", then it is a pure virtual function, meaning that you cannot instantiate a type that has such methods, and you have to override these methods in a derived class. In the vtable of the type, the MSVC compiler directs the slots of pure virtual methods to the built-in __purecall() function, which generates this error. See this link for a more detailed explanation: http://blogs.msdn.com/b/oldnewthing/arc ... 22037.aspx

One possible cause is that you call a pure virtual method in a constructor or destructor. My suggestion is to attach a debugger and check which method was called when this happened.

User avatar
CyaNn
Posts: 97
Joined: Tue Nov 23, 2010 9:48 am

Re: Error reading message!

Post by CyaNn »

Thanks Marcus.
The difficulty to debug it that this error not append with regularity.
I am suspecting that a thread try to access to derived object constructor that is not totally created....

Thanks again, I will study this problem soon. ;-)

Post Reply
29 posts • Page 3 of 3