OpenViBE forum

The OpenViBE community
It is currently Fri May 24, 2013 7:34 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Feb 16, 2012 10:31 pm 
Offline

Joined: Tue Apr 19, 2011 7:58 pm
Posts: 90
I am working with the box from Tutorial 2: http://openvibe.inria.fr/tutorial-2-imp ... -in-boxes/

In ovp_main I have:
OVP_Declare_New(OpenViBEPlugins::SignalProcessing::CBoxAlgorithmSignalMaximumDesc)

It can not create the algorithm:
m_pMatrixMaximumAlgorithm=&this->getAlgorithmManager().getAlgorithm(this->getAlgorithmManager().createAlgorithm(OVP_ClassId_Algorithm_MatrixMaximum));

Method: IPluginObjectT* CPluginManager::createPluginObjectT
File: ovkCPluginManager

Code:
map < IPluginObjectDesc*, IPluginModule* >::const_iterator i;
   for(i=m_vPluginObjectDesc.begin(); i!=m_vPluginObjectDesc.end(); i++)
   {
      if(i->first->getCreatedClass()==CIdentifier(l_ui64TargetClassIdentifier))
      {
         l_pPluginObjectDesc=i->first;
      }
   }
   if(!l_pPluginObjectDesc)
   {
      return NULL;
   }


It goes into the return NULL and then crashes. It does not find l_ui64TargetClassIdentifier, but it should I suppose.

Any hints?


Top
 Profile  
 
PostPosted: Fri Feb 17, 2012 11:35 pm 
Offline

Joined: Tue Apr 19, 2011 7:58 pm
Posts: 90
Problem turn-up to be easily fixable.

Algorithms are registered the same ways as Boxes are:

#include "ovpCAlgorithmMatrixMaximum.h"

OVP_Declare_New(OpenViBEPlugins::SignalProcessing::CAlgorithmMatrixMaximumDesc)

in ovp_main.cpp

The "OVP_Declare_New" macro adds both types to the list of available boxes and algorithms.


Top
 Profile  
 
PostPosted: Sun Feb 19, 2012 8:08 am 
Offline

Joined: Tue Apr 19, 2011 7:58 pm
Posts: 90
Hi again,

Unfortunately I still can not complete Tutorial 2 - MatrixMaximum

I get an access violation invalid memory read in the following code in ovkCAlgorithm.cpp (line:365) when I click on "Play" scenario:

My source is here: http://adastra.googlecode.com/svn/trunk/src_cpp/OpenVibe/SignalMaximum
It includes: the box and algorithm from Tutorial 2 and the test scenario.

This is the problematic part:

Code:
boolean CAlgorithm::process(void)
{
   __proxy_func_0__(process, "process callback", this->setAllOutputTriggers(false), this->setAllInputTriggers(false));
}


I have replaced __proxy_func_0__ macro with a real function call, but still I can not figure-out which object is corrupted and when this is happening in the workflow.

The log from Microsoft Application verifier http://www.microsoft.com/download/en/details.aspx?id=20028
shows this:

Code:
First-chance exception at 0x73371ed7 in OpenViBE-designer-dynamic.exe: 0xC0000005: Access violation writing location 0x00000000.

<avrf:logEntry Time="2012-02-19 : 09:41:40" LayerName="Heaps" StopCode="0x13" Severity="Error">
  <avrf:message>First chance access violation for current stack trace.</avrf:message>
  <avrf:parameter1>0 - Invalid address causing the exception.</avrf:parameter1>
  <avrf:parameter2>73371ed7 - Code address executing the invalid access.</avrf:parameter2>
  <avrf:parameter3>d2e760 - Exception record.</avrf:parameter3>
  <avrf:parameter4>d2e7b0 - Context record.</avrf:parameter4>
  <avrf:stackTrace>
  <avrf:trace>vrfcore!VfCoreRedirectedStopMessage+81 (d:\avrf\source\base\avrf\avrf30\vrfcore\stopredirect.cpp @ 103)</avrf:trace>
  <avrf:trace>vfbasics!VerifierStopMessage+292 (d:\avrf\source\base\avrf\avrf30\providers\basics\basics.c @ 1214)</avrf:trace>
  <avrf:trace>vfbasics!AVrfpCheckFirstChanceException+c8 (d:\avrf\source\base\avrf\vrfcommon\support.c @ 1108)</avrf:trace>
  <avrf:trace>vfbasics!AVrfpVectoredExceptionHandler+16 (d:\avrf\source\base\avrf\vrfcommon\support.c @ 323)</avrf:trace>
  <avrf:trace>ntdll!RtlGetProcessHeaps+49d ( @ 0)</avrf:trace>
  <avrf:trace>ntdll!RtlCaptureContext+187 ( @ 0)</avrf:trace>
  <avrf:trace>ntdll!LdrRemoveLoadAsDataTable+c0b ( @ 0)</avrf:trace>
  <avrf:trace>ntdll!KiUserExceptionDispatcher+f ( @ 0)</avrf:trace>
  </avrf:stackTrace>
</avrf:logEntry>


Full log from Application Verifier is attached.


Attachments:
File comment: Full log from Application Verifier with the access violation error in the end.
OpenViBE-designer-dynamic.exe.15.dat.zip [28.5 KiB]
Downloaded 8 times
Top
 Profile  
 
PostPosted: Sun Feb 19, 2012 7:35 pm 
Offline

Joined: Tue Apr 19, 2011 7:58 pm
Posts: 90
I was able to load the debugging symbols for all required modules (dlls).

So problem turned up to be in:

void CStreamedMatrixDecoder::processChildData(const void* pBuffer, const EBML::uint64 ui64BufferSize)

where memcpy fails because destination is NULL.

Actually the problem is in the tutorial:

It says:
Code:
ip_pMatrixMaximumAlgorithm_Matrix->setDimensionCount(3);

but this contradicts with:

Code:
if( dimCount != 2)
{
   this->getLogManager() << LogLevel_Error << "The input matrix must have 2 dimensions";
   return false;
}


If I leave dimensions to 3 then the check above prevents the algorithm from doing any real work.

If I set dimensions to 2 then check is OK, but it terminates with the above error.

Which is the right way to code the tutorial?


Top
 Profile  
 
PostPosted: Mon Feb 20, 2012 10:25 am 
Offline
Site Admin

Joined: Wed Oct 07, 2009 12:11 pm
Posts: 413
Hi everyone !

The Tutorial has indeed a mistake.

Code:
ip_pMatrixMaximumAlgorithm_Matrix->setDimensionCount(3);

Is totally irrelevant. This line should not be present... I added it to test the dimension verification in the Algorithm, and forgot to remove it when writing the tutorial on the website. My fault, sorry.

Quote:
If I leave dimensions to 3 then the check above prevents the algorithm from doing any real work.

If I set dimensions to 2 then check is OK, but it terminates with the above error.


Indeed, happens to me also.
When you re-set the dimension count into a matrix, it gets re-initialized (buffer deleted, resized, etc.).
Simply delete the line:
Code:
if(m_oSignalDecoder.isHeaderReceived())
{
    ip_pMatrixMaximumAlgorithm_Matrix->setDimensionCount(3);
    if(!m_pMatrixMaximumAlgorithm->process(OVP_Algorithm_MatrixMaximum_InputTriggerId_Initialize))
    {
        return false;
    }
    m_oSignalEncoder.encodeHeader(0);
    l_rDynamicBoxContext.markOutputAsReadyToSend(0, l_rDynamicBoxContext.getInputChunkStartTime(0, i),
                                                                l_rDynamicBoxContext.getInputChunkEndTime(0, i));
}


And it should be ok.

thank you for bringing this to our attention !

If you find another mistake in the tutorials or documentation, please tell us :)

Laurent-

_________________
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !


Top
 Profile  
 
PostPosted: Mon Feb 20, 2012 9:55 pm 
Offline

Joined: Tue Apr 19, 2011 7:58 pm
Posts: 90
Hello Laurent,

Thank you for your feedback.

I removed:

Code:
ip_pMatrixMaximumAlgorithm_Matrix->setDimensionCount(3);


What box do you use to visualize the output from SignalMaximum box? Is it a standard one - signal display?

These tutorials really help getting started with OpenVibe!

Cheers,
Anton


Top
 Profile  
 
PostPosted: Thu Feb 23, 2012 10:05 am 
Offline

Joined: Tue Nov 02, 2010 8:51 am
Posts: 216
Location: Inria Rennes FR
As long as the output of a box is of type "signal" and is not epoched (by a previous epoching box) you can display it by a signal display box.

_________________
My Weblog Follow me on Twitter


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
POWERED_BY
Translated by MaĆ«l Soucaze © 2009 phpBB.fr