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 768530 - shmsink: Check return values of functions operating on memory
shmsink: Check return values of functions operating on memory
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-07-07 18:21 UTC by Marcin Lewandowski
Modified: 2017-12-19 22:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
shmsink: Check return values of functions operating on memory (3.44 KB, patch)
2016-07-07 18:21 UTC, Marcin Lewandowski
none Details | Review
shmsink: Check return values of functions operating on memory (3.53 KB, patch)
2016-07-07 18:38 UTC, Marcin Lewandowski
needs-work Details | Review
shmsink: Check return values of functions operating on memory (3.54 KB, patch)
2016-07-07 18:41 UTC, Marcin Lewandowski
committed Details | Review

Description Marcin Lewandowski 2016-07-07 18:21:16 UTC
Created attachment 331014 [details] [review]
shmsink: Check return values of functions operating on memory

Well, checking whether functions succeeded is just nicer than not checking anything.
Comment 1 Marcin Lewandowski 2016-07-07 18:38:15 UTC
Created attachment 331015 [details] [review]
shmsink: Check return values of functions operating on memory
Comment 2 Marcin Lewandowski 2016-07-07 18:41:13 UTC
Created attachment 331017 [details] [review]
shmsink: Check return values of functions operating on memory
Comment 3 Nicolas Dufresne (ndufresne) 2016-07-07 19:06:26 UTC
Review of attachment 331015 [details] [review]:

::: sys/shm/gstshmsink.c
@@ +722,3 @@
+    if (!gst_memory_map (memory, &map, GST_MAP_WRITE)) {
+      GST_ELEMENT_ERROR (self, STREAM, FAILED,
+          (NULL),

The first string is the most important, please swap.
Comment 4 Nicolas Dufresne (ndufresne) 2016-07-07 19:06:47 UTC
Review of attachment 331017 [details] [review]:

Same.
Comment 5 Tim-Philipp Müller 2016-07-07 19:15:20 UTC
Actually, I think this is fine as is.

The first is the message that would be shown to a user. It should not contain any technical details really, and it should ideally be translated.

In this case "memory" and the fact that it couldn't be "mapped" are low-level details a normal user wouldn't understand, so they should go into the debug string (second string).

Leaving the first as (NULL) means the user gets to see some generic translated 'streaming failed' message, which is as good as it can be here I suppose.
Comment 6 Marcin Lewandowski 2016-07-08 09:10:25 UTC
Any clear resolution on this? Now patch is marked as needs-work.
Comment 7 Tim-Philipp Müller 2016-07-11 23:22:17 UTC
It's waiting for further comment from Nicolas, otherwise it will be pushed by someone else at some point.
Comment 8 Nicolas Dufresne (ndufresne) 2016-07-12 13:00:10 UTC
Well as you like. Why I'm nitpicking is because if a user didn't enable any trace at all, he will only see the first message, as it is set to NULL, it will be a generic message which will mean nothing and couldn't be "googled" to match any existing reported issues.

The message itself should indeed be formulated in less technical manner of course. It's a trivial tiny little change. I just think it's bad practice to not fill at least the first string.
Comment 9 Marcin Lewandowski 2016-07-12 13:19:27 UTC
When I was preparing the patch  I was looking  at the patterns in other  more mature elements at this is what I have found when message was rare, purely low level technical issue.

I'll do whatever you think it's fine, IMO there's a lack of clear coding standards in that matter.
Comment 10 Olivier Crête 2017-12-19 22:33:27 UTC
Fixed indentation and left the default translated error, patch is otherwise good.