GNOME Bugzilla – Bug 755380
validate:reporter: crash when argument is NULL
Last modified: 2016-01-14 03:25:32 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
Created attachment 311817 [details] [review] validate: reporter: check arguments
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.
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.
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?
(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?
(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.
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.
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.
@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
+ Trace 235485
$1 = (GstValidateIssue *) 0x0
What's up with this? :)
I checked it with the up-to-date version and it's not reproduced anymore, let me close this one.