[CinCV TNG] Debugging motion blur

Nicola Ferralis feranick at hotmail.com
Fri Apr 10 00:35:51 CEST 2015


Some further insight on this debugging motionblur. Some background first.

1. get_camera is called in plugins/motionblur/motionblur.C in lines 

2. this is defined in pluginclient.c as follow:

void get_camera(float *x, float *y, float *z, int64_t position)
	server->get_camera(x, y, z, position, direction);

3. The parent call in server is defined in pluginserver.C:

void PluginServer::get_camera(float *x, float *y, float *z,
	int64_t position, int direction)
	plugin->track->automation->get_camera(x, y, z, position, direction);

4. Now, this is where the crash takes place. If I define a debugging 
string in get_camera call that is defined in automation.C, I don't see 
it printed, meaning that the crash takes place not in the get_camera 
call in automation.C for for some reason in plugin->track->automation

For example, I can replace get_camera with something else, by retrieving 
for example:


and printing the return value. get_length is also defined in 
automation.C. The crash still takes place (not sure how) not in 
get_length(), but I guess in defining plugin->track->automation. I am 
very aware of my limited knowledge here, I hope this can make some sort 
of sense.

There is more. The method in the get_camera call in automation.C is 
empty. This means that get_camera shouldn't do absolutely nothing. In 
fact if you remove it completely, the crash doesn't obviously occur, but 
nothing happens either (no motion blur). Interestingly, an identical 
call in vautomation.C has a meaningful method for get_camera, that I 
would think it should be also replicated in automation.C as well. One 
could copy over the short piece of code in get_camera in vautomations.C 
into the blank get_camera call in automation.C, but that obviously 
doesn't prevent the crash, which, as I stated above, takes place 
*before* the get_camera is ever started.

What i am trying to say is that the crash takes place immediately before 
get_camera is initiated in automatic.C. If that crash is solved, there 
may still be an issue with the blank call in get_camera.

One last thing: this issue is only present in motionblur because it is 
the only plugin that uses get_camera. In fact, it is the only piece of 
code in cinelerra that uses it at all.

I am not sure how to proceed from here. I hope Hannes and Einar would 
have some comments/suggestions.

Thanks in advance,

On 4/6/15 2:06 PM, Nicola Ferralis wrote:
> Upon further testing with gdb (and further confirmed by adding debugging
> strings), it seems the crash takes places here in
> plugins/motionblur/motionblur.C, lines 356-360, in calling get_camera.
> Among the *blur plugins, motionblur seems to be the only one using it.
> Nicola
> On 4/3/15 4:22 PM, Johannes Sixt wrote:
>> Am 03.04.2015 um 06:05 schrieb Nicola Ferralis:
>>> Hi, I am checking if there is any clue from the coverity scan that can
>>> suggest why motion blur doesn't work. One interesting bit comes from:
>>> plugins/blur/blur.C, line 377:
>>> void BlurEngine::run()
>>> {
>>>          int i, j, k, l;
>>>          int strip_size;
>>>      while(1)
>>>      {
>>>          input_lock.lock();
>>>          ...
>>>     lock: lock locks this->input_lock.mutex.
>>>     CID 57861 (#1 of 1): Double lock (LOCK)322. double_lock: lock locks
>>> this->input_lock.mutex twice.
>>> Essentially, there might be an issue with the lock leading to a program
>>> hang...
>>> Not sure here, thoughts?
>> Indeed, that looks wrong. It looks like these objects should not be
>> Mutex, but Conditional. That does not explain why some of the blur
>> plugins that use BlurEngine work, though.
>> -- Hannes
>> _______________________________________________
>> Cinelerra mailing list
>> Cinelerra at lists.cinelerra-cv.org
>> http://lists.cinelerra-cv.org/cgi-bin/mailman/listinfo/cinelerra
> _______________________________________________
> Cinelerra mailing list
> Cinelerra at lists.cinelerra-cv.org
> http://lists.cinelerra-cv.org/cgi-bin/mailman/listinfo/cinelerra

More information about the Cinelerra mailing list