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 796578 - discoverer: Don't crash when running with -v if channel-mask==0 and >7 channels
discoverer: Don't crash when running with -v if channel-mask==0 and >7 channels
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: Normal normal
: 1.14.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-06-13 12:39 UTC by Vivia Nikolaidou
Modified: 2018-07-18 13:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
discoverer: Don't crash when running with -v if channel-mask==0 and >7 channels (1.83 KB, patch)
2018-06-13 12:39 UTC, Vivia Nikolaidou
committed Details | Review

Description Vivia Nikolaidou 2018-06-13 12:39:24 UTC
See commit message
Comment 1 Vivia Nikolaidou 2018-06-13 12:39:30 UTC
Created attachment 372668 [details] [review]
discoverer: Don't crash when running with -v if channel-mask==0 and >7 channels

For e.g. 16-channel audio, if the channel mask is 0 (which it usually
is), gst_audio_channel_positions_from_mask would get confused,
ultimately leading into a crash.
Comment 2 Thibault Saunier 2018-06-13 12:52:13 UTC
How does the crash looks like? It shouldn't crash in the first place I think.
Comment 3 Vivia Nikolaidou 2018-06-13 12:55:19 UTC
Done discovering file:///home/vivia/delme.wav

Topology:
  audio: audio/x-wav
0:00:00.944417687 25062 0x5555557c5b80 ERROR         audio-channels audio-channels.c:390:gst_audio_channel_positions_from_mask: no channel-mask property given

Thread 1 "gst-discoverer-" received signal SIGSEGV, Segmentation fault.
0x0000555555557a3c in format_channel_mask (ainfo=0x5555559e4260 [GstDiscovererAudioInfo]) at gst-discoverer.c:169
169         my_g_string_append_printf (s, 0, "%s%s", value->value_nick,
(gdb) print s
$1 = (GString *) 0x5555557c3b20
(gdb) print value
$2 = (GEnumValue *) 0x0
(gdb)
Comment 4 Vivia Nikolaidou 2018-06-13 12:57:42 UTC
My first approach was to print "unknown" in that case, but then it looked bad:

    Channels: 16 (front-left, front-left, unknown, unknown, unknown, unknown, rear-center, front-left, unknown, unknown, unknown, front-left, front-left, front-left, unknown, unknown)

Whatever values are there are just default guesses anyway, the channel-mask is 0 so that looked wrong to me. That's why I thought about this approach.
Comment 5 Sebastian Dröge (slomo) 2018-06-14 11:24:44 UTC
Comment on attachment 372668 [details] [review]
discoverer: Don't crash when running with -v if channel-mask==0 and >7 channels

Seems fine to me. Unless Thibault has any actual objections, let's get this in
Comment 6 Thibault Saunier 2018-06-14 11:38:30 UTC
Review of attachment 372668 [details] [review]:

Look good then
Comment 7 Vivia Nikolaidou 2018-06-14 12:16:30 UTC
Review of attachment 372668 [details] [review]:

commit effd8920217923ef314f71fe90f41e005d2f92ef (HEAD -> master, dev/master)
Author: Vivia Nikolaidou <vivia@ahiru.eu>
Date:   Wed Jun 13 15:29:46 2018 +0300

    discoverer: Don't crash when running with -v if channel-mask==0 and >7 channels

    For e.g. 16-channel audio, if the channel mask is 0 (which it usually
    is), gst_audio_channel_positions_from_mask would get confused,
    ultimately leading into a crash.

    https://bugzilla.gnome.org/show_bug.cgi?id=796578