Kdenlive   bug tracker Home page

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002001KdenliveEffectspublic2011-02-03 13:372011-11-01 18:56
ReporterGranjow 
Assigned Tottill 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSOS Version
Product VersionRecent git 
Target VersionFixed in Version0.8.2 
Summary0002001: Crash in Bézier curves (frei0r) when processing frame
DescriptionI can add a clip to the timeline and apply the Bézier curves effect to it, but as soon as I move the timeline cursor over the clip kdenlive crashes.

Backtrace below.
Additional Information0 __strcmp_ssse3 strcmp.S 100 0x7ffff1dfc35a
1 f0r_set_param_value /usr/lib64/frei0r-1/curves.so 0 0x7fffd033eb8e
2 process_frei0r_item frei0r_helper.c 114 0x7fffdfdaae87
3 filter_get_image filter_frei0r.c 40 0x7fffdfdaa6d6
4 mlt_frame_get_image mlt_frame.c 389 0x7ffff7bc5f7a
5 producer_get_image mlt_tractor.c 275 0x7ffff7bd614b
6 mlt_frame_get_image mlt_frame.c 389 0x7ffff7bc5f7a
7 consumer_play_video consumer_sdl_still.c 477 0x7fffe171867f
8 consumer_thread consumer_sdl_still.c 577 0x7fffe171867f
9 start_thread pthread_create.c 300 0x7ffff5f318ba
10 clone clone.S 112 0x7ffff1dbe02d
11 ?? 0
TagsNo tags attached.
Build/Install MethodManual build from SVN
Attached Files

- Relationships

-  Notes
(0006385)
Granjow (developer)
2011-02-04 20:31

frei0r, curves.c:332, f0r_set_param_value():
    default:
      if (param_index > 5)
        inst->points[param_index - 6] = *((f0r_param_double *)param); //Assigning value to curve point

Segfault at frei0r, frei0r_helper.c:114:
                    case F0R_PARAM_STRING:
                    {
                        f0r_param_string val = mlt_properties_get(prop, pinfo.name);
                        if (val) f0r_set_param_value(inst, &val, i); // <-- here
                        break;
                    }

val seems to be a string ("-64"), yet is put into a double.

You honestly don't get a crash here?
(0006387)
ttill (developer)
2011-02-05 15:19

No I do not get a crash.
There are several things I do not understand:

The Bézier spline is a string parameter and is handled in case 5 in f0r_set_param_value which ties in with the backtrace you posted since in case 5 there is a call to strcmp. So I wonder why the default case (l.332) is used.

-64 isn't a valid value for any parameter available. So what created it?
(0006388)
Granjow (developer)
2011-02-06 17:38

I cannot find the point where the parameters are transferred. Can you give me a hint?

param_index (i) is set to 6 in frei0r_helper.c, therefore the default case (> 5).
(0006407)
ttill (developer)
2011-02-12 23:53

The parameter with index 6 should not be handled at all since:
        for (i=0;i<info.num_params;i++){
            f0r_param_info_t pinfo;
            f0r_get_param_info(&pinfo,i);
            if (mlt_properties_get( prop , pinfo.name ) !=NULL ){

only paramters set (in the xml file) are passed on.
f0r_get_param_info handles i = 6 as:

  default:
    if (param_index > 5) {
      info->name = get_param_name(param_index - 6);
      info->type = F0R_PARAM_DOUBLE;

Which turns out as "Point 1 input value" (= pinfo.name for i = 6) which should not exist in your kdenlive document when using the Bézier color curves filter.

What is the name of your parameter with index = 6?
(0006410)
Granjow (developer)
2011-02-13 11:30

I have added this code at the end of f0r_get_param_info:
  printf("Parameter name of index %d is %s.\n", param_index, info->name);

On startup kdenlive shows me:
Parameter name of index 0 is Channel.
Parameter name of index 1 is Show curves.
Parameter name of index 2 is Graph position.
Parameter name of index 3 is Curve point number.
Parameter name of index 4 is Luma formula.
Parameter name of index 5 is Bézier spline.
Parameter name of index 6 is Point 1 input value.
Parameter name of index 7 is Point 1 output value.
Parameter name of index 8 is Point 2 input value.
Parameter name of index 9 is Point 2 output value.
Parameter name of index 10 is Point 3 input value.
Parameter name of index 11 is Point 3 output value.
Parameter name of index 12 is Point 4 input value.
Parameter name of index 13 is Point 4 output value.
Parameter name of index 14 is Point 5 input value.
Parameter name of index 15 is Point 5 output value.
No other output when applying the effect.

void f0r_set_param_value never seems to get called since I've got some printf there as well but never see them.

Is the original curves filter deprecated now perhaps?
(0006456)
ttill (developer)
2011-02-20 11:12

No it is not deprecated. In frei0r the parameters remained so that the filter is somewhat usable without a proper GUI. In Kdenlive the second GUI is still there for projects using it. But I have to think about a way to hide it from the effects list so that we can remove it in a future version of Kdenlive.
Anyways it should still work.

Are you sure f0r_set_param_value does not get called?
Your initial report says different:
0 __strcmp_ssse3 strcmp.S 100 0x7ffff1dfc35a
1 f0r_set_param_value /usr/lib64/frei0r-1/curves.so 0 0x7fffd033eb8e
(0006457)
Granjow (developer)
2011-02-20 13:24

Ok, it just crashed at the wrong position.

void f0r_set_param_value(f0r_instance_t instance,
                         f0r_param_t param, int param_index)
{
  printf("f0r_set_param_value called.\n");
  assert(instance);

  printf("Parameter index is %d\n", param_index);

  curves_instance_t* inst = (curves_instance_t*)instance;
  printf("Created curves instance\n");

  double tmp;
  f0r_param_string bspline;
  
  switch(param_index)
  {
    //...
  }
  printf("f0r_set_param_value has finished.\n");
}


gives


Parameter name of index 0 is Channel.
f0r_set_param_value called.
Parameter index is 0
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 1 is Show curves.
Parameter name of index 2 is Graph position.
Parameter name of index 3 is Curve point number.
Parameter name of index 4 is Luma formula.
f0r_set_param_value called.
Parameter index is 4
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 5 is Bézier spline.
f0r_set_param_value called.
Parameter index is 5
Created curves instance
kdenlive: Fatal IO error: client killed
KCrash: Application 'kdenlive' crashing...
sock_file=/home/simon/.kde/socket-lapL/kdeinit4__0
(0006458)
Granjow (developer)
2011-02-20 13:28

This is strange, I don't get this output at all when running in debug mode (qtcreator), only in normal mode. Debug mode still shows me i=6.
(0006459)
ttill (developer)
2011-02-20 14:13

Strange, strange...
So assuming it crashes in strcmp:
Could you please make sure that inst->bspline and bspline are not NULL?
Is "val seems to be a string ("-64")" still true?
Could you also add a debug message after effectstackedit.cpp: 730 printing the value of "setValue"
Maybe valgrind can provide a clue?
(0006460)
Granjow (developer)
2011-02-20 14:32

This will get a little bit longer … Therefore text first. I still had to run it in non-debug mode. Interestingly it did not crash immediately and I could even seek this time, the curve was also shown in the project monitor, but as soon as I changed the upper right bézier node, it again crashed. I pressed enter in the debugger to mark this place.

Regarding val, the debugger now shows -112 '\90' -- perhaps some value it tries to interpret both as signed something and as char, which is why I thought it was a string.



kdenlive(27910) Render::start: ----- MONITOR: "project" REFRESH
Parameter name of index 0 is Channel.
Parameter name of index 1 is Show curves.
Parameter name of index 2 is Graph position.
Parameter name of index 3 is Curve point number.
Parameter name of index 4 is Luma formula.
Parameter name of index 5 is Bézier spline.
Parameter name of index 6 is Point 1 input value.
Parameter name of index 7 is Point 1 output value.
Parameter name of index 8 is Point 2 input value.
Parameter name of index 9 is Point 2 output value.
Parameter name of index 10 is Point 3 input value.
Parameter name of index 11 is Point 3 output value.
Parameter name of index 12 is Point 4 input value.
Parameter name of index 13 is Point 4 output value.
Parameter name of index 14 is Point 5 input value.
Parameter name of index 15 is Point 5 output value.
Parameter name of index 0 is Channel.
Parameter name of index 1 is Show curves.
Parameter name of index 2 is Graph position.
Parameter name of index 3 is Curve point number.
Parameter name of index 4 is Luma formula.
Parameter name of index 5 is Bézier spline.
Parameter name of index 6 is Point 1 input value.
Parameter name of index 7 is Point 1 output value.
Parameter name of index 8 is Point 2 input value.
Parameter name of index 9 is Point 2 output value.
Parameter name of index 10 is Point 3 input value.
Parameter name of index 11 is Point 3 output value.
Parameter name of index 12 is Point 4 input value.
Parameter name of index 13 is Point 4 output value.
Parameter name of index 14 is Point 5 input value.
Parameter name of index 15 is Point 5 output value.
Parameter name of index 0 is Channel.
f0r_set_param_value called.
Parameter index is 0
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 1 is Show curves.
Parameter name of index 2 is Graph position.
Parameter name of index 3 is Curve point number.
Parameter name of index 4 is Luma formula.
f0r_set_param_value called.
Parameter index is 4
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 5 is Bézier spline.
Parameter name of index 6 is Point 1 input value.
Parameter name of index 7 is Point 1 output value.
Parameter name of index 8 is Point 2 input value.
Parameter name of index 9 is Point 2 output value.
Parameter name of index 10 is Point 3 input value.
Parameter name of index 11 is Point 3 output value.
Parameter name of index 12 is Point 4 input value.
Parameter name of index 13 is Point 4 output value.
Parameter name of index 14 is Point 5 input value.
Parameter name of index 15 is Point 5 output value.
Parameter name of index 0 is Channel.
f0r_set_param_value called.
Parameter index is 0
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 1 is Show curves.
Parameter name of index 2 is Graph position.
Parameter name of index 3 is Curve point number.
Parameter name of index 4 is Luma formula.
f0r_set_param_value called.
Parameter index is 4
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 5 is Bézier spline.
Parameter name of index 6 is Point 1 input value.
Parameter name of index 7 is Point 1 output value.
Parameter name of index 8 is Point 2 input value.
Parameter name of index 9 is Point 2 output value.
Parameter name of index 10 is Point 3 input value.
Parameter name of index 11 is Point 3 output value.
Parameter name of index 12 is Point 4 input value.
Parameter name of index 13 is Point 4 output value.
Parameter name of index 14 is Point 5 input value.
Parameter name of index 15 is Point 5 output value.
Parameter name of index 0 is Channel.
f0r_set_param_value called.
Parameter index is 0
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 1 is Show curves.
Parameter name of index 2 is Graph position.
Parameter name of index 3 is Curve point number.
Parameter name of index 4 is Luma formula.
f0r_set_param_value called.
Parameter index is 4
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 5 is Bézier spline.
Parameter name of index 6 is Point 1 input value.
Parameter name of index 7 is Point 1 output value.
Parameter name of index 8 is Point 2 input value.
Parameter name of index 9 is Point 2 output value.
Parameter name of index 10 is Point 3 input value.
Parameter name of index 11 is Point 3 output value.
Parameter name of index 12 is Point 4 input value.
Parameter name of index 13 is Point 4 output value.
Parameter name of index 14 is Point 5 input value.
Parameter name of index 15 is Point 5 output value.
Parameter name of index 0 is Channel.
f0r_set_param_value called.
Parameter index is 0
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 1 is Show curves.
Parameter name of index 2 is Graph position.
Parameter name of index 3 is Curve point number.
Parameter name of index 4 is Luma formula.
f0r_set_param_value called.
Parameter index is 4
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 5 is Bézier spline.
Parameter name of index 6 is Point 1 input value.
Parameter name of index 7 is Point 1 output value.
Parameter name of index 8 is Point 2 input value.
Parameter name of index 9 is Point 2 output value.
Parameter name of index 10 is Point 3 input value.
Parameter name of index 11 is Point 3 output value.
Parameter name of index 12 is Point 4 input value.
Parameter name of index 13 is Point 4 output value.
Parameter name of index 14 is Point 5 input value.
Parameter name of index 15 is Point 5 output value.
Parameter name of index 0 is Channel.
f0r_set_param_value called.
Parameter index is 0
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 1 is Show curves.
Parameter name of index 2 is Graph position.
Parameter name of index 3 is Curve point number.
Parameter name of index 4 is Luma formula.
f0r_set_param_value called.
Parameter index is 4
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 5 is Bézier spline.
Parameter name of index 6 is Point 1 input value.
Parameter name of index 7 is Point 1 output value.
Parameter name of index 8 is Point 2 input value.
Parameter name of index 9 is Point 2 output value.
Parameter name of index 10 is Point 3 input value.
Parameter name of index 11 is Point 3 output value.
Parameter name of index 12 is Point 4 input value.
Parameter name of index 13 is Point 4 output value.
Parameter name of index 14 is Point 5 input value.
Parameter name of index 15 is Point 5 output value.
Parameter name of index 0 is Channel.
f0r_set_param_value called.
Parameter index is 0
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 1 is Show curves.
Parameter name of index 2 is Graph position.
Parameter name of index 3 is Curve point number.
Parameter name of index 4 is Luma formula.
f0r_set_param_value called.
Parameter index is 4
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 5 is Bézier spline.
Parameter name of index 6 is Point 1 input value.
Parameter name of index 7 is Point 1 output value.
Parameter name of index 8 is Point 2 input value.
Parameter name of index 9 is Point 2 output value.
Parameter name of index 10 is Point 3 input value.
Parameter name of index 11 is Point 3 output value.
Parameter name of index 12 is Point 4 input value.
Parameter name of index 13 is Point 4 output value.
Parameter name of index 14 is Point 5 input value.
Parameter name of index 15 is Point 5 output value.
Parameter name of index 0 is Channel.
f0r_set_param_value called.
Parameter index is 0
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 1 is Show curves.
Parameter name of index 2 is Graph position.
Parameter name of index 3 is Curve point number.
Parameter name of index 4 is Luma formula.
f0r_set_param_value called.
Parameter index is 4
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 5 is Bézier spline.
Parameter name of index 6 is Point 1 input value.
Parameter name of index 7 is Point 1 output value.
Parameter name of index 8 is Point 2 input value.
Parameter name of index 9 is Point 2 output value.
Parameter name of index 10 is Point 3 input va

Bézier: setValue is "-1;-1#0;0#0.1;0.1|0.9;0.9#1;1#2;2"
Bézier: setValue is "-1;-1#0;0#0.1;0.1|0.86371;0.449223#1;1#1.3397;2.37281"
KCrash: Application 'kdenlive' crashing...
QSocketNotifier: Invalid socket 8 and type 'Read', disabling...
QSocketNotifier: Invalid socket 10 and type 'Read', disabling...
kdenlive: Fatal IO error: client killed
lue.
Parameter name of index 11 is Point 3 output value.
Parameter name of index 12 is Point 4 input value.
Parameter name of index 13 is Point 4 output value.
Parameter name of index 14 is Point 5 input value.
Parameter name of index 15 is Point 5 output value.
Parameter name of index 0 is Channel.
f0r_set_param_value called.
Parameter index is 0
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 1 is Show curves.
Parameter name of index 2 is Graph position.
Parameter name of index 3 is Curve point number.
Parameter name of index 4 is Luma formula.
f0r_set_param_value called.
Parameter index is 4
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 5 is Bézier spline.
Parameter name of index 6 is Point 1 input value.
Parameter name of index 7 is Point 1 output value.
Parameter name of index 8 is Point 2 input value.
Parameter name of index 9 is Point 2 output value.
Parameter name of index 10 is Point 3 input value.
Parameter name of index 11 is Point 3 output value.
Parameter name of index 12 is Point 4 input value.
Parameter name of index 13 is Point 4 output value.
Parameter name of index 14 is Point 5 input value.
Parameter name of index 15 is Point 5 output value.
Parameter name of index 0 is Channel.
f0r_set_param_value called.
Parameter index is 0
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 1 is Show curves.
Parameter name of index 2 is Graph position.
Parameter name of index 3 is Curve point number.
Parameter name of index 4 is Luma formula.
f0r_set_param_value called.
Parameter index is 4
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 5 is Bézier spline.
Parameter name of index 6 is Point 1 input value.
Parameter name of index 7 is Point 1 output value.
Parameter name of index 8 is Point 2 input value.
Parameter name of index 9 is Point 2 output value.
Parameter name of index 10 is Point 3 input value.
Parameter name of index 11 is Point 3 output value.
Parameter name of index 12 is Point 4 input value.
Parameter name of index 13 is Point 4 output value.
Parameter name of index 14 is Point 5 input value.
Parameter name of index 15 is Point 5 output value.
Parameter name of index 0 is Channel.
f0r_set_param_value called.
Parameter index is 0
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 1 is Show curves.
Parameter name of index 2 is Graph position.
Parameter name of index 3 is Curve point number.
Parameter name of index 4 is Luma formula.
f0r_set_param_value called.
Parameter index is 4
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 5 is Bézier spline.
Parameter name of index 6 is Point 1 input value.
Parameter name of index 7 is Point 1 output value.
Parameter name of index 8 is Point 2 input value.
Parameter name of index 9 is Point 2 output value.
Parameter name of index 10 is Point 3 input value.
Parameter name of index 11 is Point 3 output value.
Parameter name of index 12 is Point 4 input value.
Parameter name of index 13 is Point 4 output value.
Parameter name of index 14 is Point 5 input value.
Parameter name of index 15 is Point 5 output value.
Parameter name of index 0 is Channel.
f0r_set_param_value called.
Parameter index is 0
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 1 is Show curves.
Parameter name of index 2 is Graph position.
Parameter name of index 3 is Curve point number.
Parameter name of index 4 is Luma formula.
f0r_set_param_value called.
Parameter index is 4
Created curves instance
f0r_set_param_value has finished.
Parameter name of index 5 is Bézier spline.
f0r_set_param_value called.
Parameter index is 5
Created curves instance
sock_file=/home/simon/.kde/socket-lapL/kdeinit4__0
/data/cworkspace/kdenlive.git/qtcreator-build-2.81/src/cmake_bindir/kdenlive beendet, Rückgabewert 1
(0006466)
ttill (developer)
2011-02-20 21:02

In Kdenlive the value is valid:
setValue is "-1;-1#0;0#0.1;0.1|0.9;0.9#1;1#2;2"
setValue is "-1;-1#0;0#0.1;0.1|0.86371;0.449223#1;1#1.3397;2.37281"

So I wonder by what it is altered.
It did not crash because somehow the spline was not passed on at all (why??). The filter therefore (bcurve not available) used the cubic curve and also showed it on the monitor (which is not possible with the bcurve).

One last idea: Could we maybe face a locale problem here? What happens if you replace the é in frei0r_bezier_curves.xml and in curves.c?
(0006467)
Granjow (developer)
2011-02-21 10:20

What the ... o.O
(0006468)
Granjow (developer)
2011-02-21 10:39

I really cannot understand why it did not crash on your PC. According to my understanding it has to :P
(0006469)
Granjow (developer)
2011-02-21 10:42

This fixed the segfault here:

diff --git a/src/modules/frei0r/frei0r_helper.c b/src/modules/frei0r/frei0r_helper.c
index 3424748..542bc20 100644
--- a/src/modules/frei0r/frei0r_helper.c
+++ b/src/modules/frei0r/frei0r_helper.c
@@ -110,7 +110,7 @@ int process_frei0r_item( mlt_service service, double position, mlt_properties pr
                                        }
                                        case F0R_PARAM_STRING:
                                        {
- f0r_param_string val = mlt_properties_get(prop, pinfo.name);
+ f0r_param_string *val = mlt_properties_get(prop, pinfo.name);
                                                if (val) f0r_set_param_value(inst, &val, i);
                                                break;
                                        }

(Sorry for always blaming your code when I get a segfault :D)
(0006478)
Granjow (developer)
2011-02-22 15:24

Ok, wrong frei0r.h file was installed. My bad. Fix above invalid.

- Issue History
Date Modified Username Field Change
2011-02-03 13:37 Granjow New Issue
2011-02-03 13:37 Granjow Status new => assigned
2011-02-03 13:37 Granjow Assigned To => ttill
2011-02-04 20:31 Granjow Note Added: 0006385
2011-02-05 15:19 ttill Note Added: 0006387
2011-02-05 15:19 ttill Note View State: 0006387: public
2011-02-06 17:38 Granjow Note Added: 0006388
2011-02-12 23:53 ttill Note Added: 0006407
2011-02-13 11:30 Granjow Note Added: 0006410
2011-02-20 11:12 ttill Note Added: 0006456
2011-02-20 13:24 Granjow Note Added: 0006457
2011-02-20 13:28 Granjow Note Added: 0006458
2011-02-20 14:13 ttill Note Added: 0006459
2011-02-20 14:32 Granjow Note Added: 0006460
2011-02-20 21:02 ttill Note Added: 0006466
2011-02-21 10:20 Granjow Note Added: 0006467
2011-02-21 10:39 Granjow Note Added: 0006468
2011-02-21 10:42 Granjow Note Added: 0006469
2011-02-22 15:24 Granjow Note Added: 0006478
2011-02-22 15:24 Granjow Status assigned => resolved
2011-02-22 15:24 Granjow Resolution open => no change required
2011-07-05 12:15 j-b-m Fixed in Version => 0.8.2
2011-11-01 18:56 j-b-m Status resolved => closed


Copyright © 2000 - 2014 MantisBT Team
Powered by Mantis Bugtracker