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 161667 - [PATCH][snapshot] seg fault in signal handler
[PATCH][snapshot] seg fault in signal handler
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins
0.8.6
Other Linux
: Normal normal
: 0.8.8
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-12-19 01:47 UTC by Paul Jack
Modified: 2005-01-09 01:43 UTC
See Also:
GNOME target: ---
GNOME version: 2.7/2.8


Attachments
Patch that removes snapshot_handler function. (1.10 KB, patch)
2004-12-19 01:49 UTC, Paul Jack
none Details | Review
different patch (against head) (2.87 KB, patch)
2005-01-06 00:14 UTC, Martin Eikermann
none Details | Review
proposed patch (3.30 KB, patch)
2005-01-07 17:16 UTC, Martin Eikermann
none Details | Review

Description Paul Jack 2004-12-19 01:47:51 UTC
TO REPRODUCE:

$ gst-launch-0.8 videotestsrc num-buffers=10 ! snapshot frame=5 location=z.png !
fakesink
RUNNING pipeline ...
Segmentation fault


EXPECTED BEHAVIOR:

A PNG snapshot of the test pattern appears in new file z.png


ACTUAL BEHAVIOR:

z.png is 0 bytes long, and gst-launch crashes with a seg fault.


SOURCE OF PROBLEM:

Looks like a stray signal handler:  The snapshot_handler function was setting a
flag to TRUE, so the gstsnapshot_chain function was trying to write the PNG
image twice.  After the first attempt, the PNG library structures are destroyed,
so the second attempt seg faults.  About to attach a patch...
Comment 1 Paul Jack 2004-12-19 01:49:51 UTC
Created attachment 34986 [details] [review]
Patch that removes snapshot_handler function.

Eliminates the snapshot_handler function.  The only thing that function did was
set the snapshot_asked flag to TRUE, which was causing the seg fault.
Comment 2 Ronald Bultje 2005-01-05 23:27:29 UTC
applied.
Comment 3 Martin Eikermann 2005-01-06 00:14:01 UTC
Created attachment 35516 [details] [review]
different patch (against head)

* removes recursive behaviour through the snapshot signal
* keeps signal usable for apps
* png structs are created where used ( and freed )
Comment 4 Ronald Bultje 2005-01-06 00:24:32 UTC
Hm, ok, reopening so I can apply agian.
Comment 5 Martin Eikermann 2005-01-07 17:16:46 UTC
Created attachment 35624 [details] [review]
proposed patch

Same patch as before, but fix caps to RGB instead of BGR.
Comment 6 Ronald Bultje 2005-01-09 01:43:55 UTC
applied again, thanks.