After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 755380 - validate:reporter: crash when argument is NULL
validate:reporter: crash when argument is NULL
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-devtools
git master
Other Linux
: Normal minor
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-09-22 03:08 UTC by Wonchul Lee
Modified: 2016-01-14 03:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
validate: reporter: check arguments (5.65 KB, patch)
2015-09-22 03:15 UTC, Wonchul Lee
reviewed Details | Review
check if the plugin is installed (5.94 KB, patch)
2015-09-22 04:09 UTC, Vineeth
rejected Details | Review

Description Wonchul Lee 2015-09-22 03:08:05 UTC
I tested validate.file.glvideomixer.simple.fast_forward.bgra scenario on my machine.
The problem was missing glvideomixer plugin, but It crashed when reporting error.
So I just add code to check valid value.

--------------------------------------------------------------------------------
GST_GL_XINITTHREADS=1 DISPLAY=:0 GST_VALIDATE_SCENARIO=fast_forward gst-validate-1.0  glvideomixer name=_mixer !  deinterlace ! videoconvert ! fakesink sync=true videotestsrc ! video/x-raw, framerate=\(fraction\)10/1, width=100, height=100 ! _mixer. videotestsrc ! video/x-raw, framerate=\(fraction\)5/1, width=320, height=240 ! _mixer. 

=========================================
Running scenario fast_forward on pipeline pipeline0
=========================================
Starting pipeline
Pipeline started
Executing  stop: 
  critical : All the actions were not executed before the program stopped
             Detected on <fast_forward>

Segmentation fault
Comment 1 Wonchul Lee 2015-09-22 03:15:41 UTC
Created attachment 311817 [details] [review]
validate: reporter: check arguments
Comment 2 Vineeth 2015-09-22 04:09:06 UTC
Created attachment 311818 [details] [review]
check if the plugin is installed

Hi, i guess the better option here will be, not to test the cases where the plugin is not installed.

Attaching a patch for the same to add to the test generator only when the plugin is installed.
Comment 3 Thibault Saunier 2015-09-22 05:49:48 UTC
Review of attachment 311818 [details] [review]:

::: testsuites/validate.py
@@ +24,3 @@
 import os
 from testsuiteutils import update_assets
+from gi.repository import Gst

We do not want to depend on GI in the launcher.
Comment 4 Thibault Saunier 2015-09-22 05:52:57 UTC
Review of attachment 311817 [details] [review]:

OK

::: validate/gst/validate/gst-validate-report.c
@@ -411,2 +415,3 @@
 gst_validate_issue_from_id (GstValidateIssueId issue_id)
 {
+  g_return_val_if_fail (issue_id > 0, NULL);

Can't it be 0 too?

@@ -575,3 +587,3 @@
 /**
  * gst_validate_print_action:
- * @action: (allow-none): The source object to log
+ * @action: The source object to log

That makes me think it was on purpose, are you sure?
Comment 5 Vineeth 2015-09-22 05:57:25 UTC
(In reply to Thibault Saunier from comment #3)
> Review of attachment 311818 [details] [review] [review]:
> 
> ::: testsuites/validate.py
> @@ +24,3 @@
>  import os
>  from testsuiteutils import update_assets
> +from gi.repository import Gst
> 
> We do not want to depend on GI in the launcher.

it is already present for validateelements.py, so i thought it can be same added for validate.py :)
Ideally it should not even create the test case when plugins are not present right?
Comment 6 Thibault Saunier 2015-09-22 06:30:54 UTC
(In reply to Vineeth from comment #5)
> (In reply to Thibault Saunier from comment #3)
> > Review of attachment 311818 [details] [review] [review] [review]:
> > 
> > ::: testsuites/validate.py
> > @@ +24,3 @@
> >  import os
> >  from testsuiteutils import update_assets
> > +from gi.repository import Gst
> > 
> > We do not want to depend on GI in the launcher.
> 
> it is already present for validateelements.py, so i thought it can be same
> added for validate.py :)
> Ideally it should not even create the test case when plugins are not present
> right?

validateelements.py is not the default testsuite, so that is why I think it is fine there.

It should either not create the testcase or cleanly fail it explanning the user why it failed.

You can probably use gst-inspect in a subprocess.
Comment 7 Wonchul Lee 2015-09-22 06:41:34 UTC
Review of attachment 311817 [details] [review]:

::: validate/gst/validate/gst-validate-report.c
@@ -411,2 +415,3 @@
 gst_validate_issue_from_id (GstValidateIssueId issue_id)
 {
+  g_return_val_if_fail (issue_id > 0, NULL);

issus_id comes from g_quark_from_static_string. If the string is null before transform it to gquark, then it can be 0.

@@ -575,3 +587,3 @@
 /**
  * gst_validate_print_action:
- * @action: (allow-none): The source object to log
+ * @action: The source object to log

yes, the action value can not be NULL here, so I guessed it had been reversed though it is not that much useful to pass null to message.
If not, some codes need to be changed.
Comment 8 Vineeth 2015-09-22 07:36:57 UTC
by the way,
this crash does not seem to be related to missing plugins.

I just uninstalled 'glvideomixer' and ran the test.
It fails and a report is generated. But it does not crash.


@ Wonchul Lee
do you have callstack for the crash?
the root cause of the issue might be something else




PS: Even though it fails, it does not report that plugin is missing though(this is not related to this particular issue). It gives reason as not linked, and on checking full logs we can find out.
Comment 9 Wonchul Lee 2015-09-22 16:13:56 UTC
@Vineeth, that's a good point.

I can reproduce it 50% probability, can not reproduce it when enable debug log.
I noticed the patch what I attached prevents the crash, not to resolve the root cause.
I think it would be good to check argument values, anyway.

Here is the call stack.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7836948 in gst_validate_report_print_level (report=report@entry=0x7fffe4002010)
    at gst-validate-report.c:827
827	  gst_validate_printf (NULL, "%10s : %s\n",
(gdb) bt
  • #0 gst_validate_report_print_level
    at gst-validate-report.c line 827
  • #1 _do_report_synthesis
    at gst-validate-runner.c line 438
  • #2 gst_validate_runner_printf
    at gst-validate-runner.c line 477
  • #3 main
    at gst-validate.c line 642
$1 = (GstValidateIssue *) 0x0
Comment 10 Tim-Philipp Müller 2016-01-07 17:30:16 UTC
What's up with this? :)
Comment 11 Wonchul Lee 2016-01-14 03:25:32 UTC
I checked it with the up-to-date version and it's not reproduced anymore, let me close this one.