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 683476 - Segmentation Fault observed
Segmentation Fault observed
Status: VERIFIED INVALID
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-09-06 10:20 UTC by viranjan
Modified: 2012-09-06 10:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The code in which I am seeing the segmentation fault.... (5.23 KB, application/octet-stream)
2012-09-06 10:32 UTC, viranjan
Details

Description viranjan 2012-09-06 10:20:06 UTC
When I call the following functions for getting the position 

gst_element_query_position (pipeline, GST_FORMAT_TIME, &pos)
gst_element_query_duration (pipeline, GST_FORMAT_TIME, &len)

I see the segmentation fault. 
I am using the helloworld application at path
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-helloworld.html#section-helloworld

in which I have registered the callback for every 1000 ms. In this callback I call the above functions.
Please tell me what can be possible reason behind this. I have seen with running the gdb and could see the call back but of no use.

-Viranjan
Comment 1 Wim Taymans 2012-09-06 10:24:26 UTC
You need to us the code of your callback. My guess is that you define pos and len wrongly.
Comment 2 Tim-Philipp Müller 2012-09-06 10:25:35 UTC
Please provide all the code that you added, so we can see the context.

Also, please provide a stack trace for the crash (from gdb).
Comment 3 viranjan 2012-09-06 10:32:34 UTC
Created attachment 223622 [details]
The code in which I am seeing the segmentation fault....

The code in which I am seeing the segmentation fault....
Comment 4 viranjan 2012-09-06 10:33:52 UTC
Please find attached file for the code.
stack trace comes till query functions from main and nothing thereafter.
Comment 5 Tim-Philipp Müller 2012-09-06 10:36:05 UTC
The bug is in your code:


  if (gst_element_query_position (pipeline, (GstFormat *)GST_FORMAT_TIME, &pos)

You can't just cast like that, it needs to be (in 0.10):

 GstFormat format = GST_FORMAT_TIME;

  if (gst_element_query_position (pipeline, &formt, &pos)) {
   ...
  }

I'm sure you could have found working sample code somewhere ;)

(Admittedly the API is a bit weird, we've fixed it in 1.0).
Comment 6 viranjan 2012-09-06 10:42:10 UTC
Thanks a lot for such a fast resolution :-)