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 756492 - gl: fix leak in gst_gl_insert_debug_marker
gl: fix leak in gst_gl_insert_debug_marker
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.7.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-13 10:53 UTC by Guillaume Desmottes
Modified: 2015-10-14 07:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gl: fix leak in gst_gl_insert_debug_marker() (930 bytes, patch)
2015-10-13 10:53 UTC, Guillaume Desmottes
committed Details | Review

Description Guillaume Desmottes 2015-10-13 10:53:21 UTC
.
Comment 1 Guillaume Desmottes 2015-10-13 10:53:43 UTC
Created attachment 313170 [details] [review]
gl: fix leak in gst_gl_insert_debug_marker()

The string allocated by g_vasprintf() was leaked.

Reproduced using the
validate.file.compositor.simple.play_15s.synchronized validate scenario.
Comment 2 Sebastian Dröge (slomo) 2015-10-13 11:48:28 UTC
The spec does not say if the string is copied internally or needs to be valid forever... what should we do? :)
Comment 3 Guillaume Desmottes 2015-10-13 12:20:46 UTC
The header in mesa is defined as "void APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker);". The "const" is making clear that the string isn't consummed but yeah, I didn't check the opengl spec.
Comment 4 Sebastian Dröge (slomo) 2015-10-13 12:25:09 UTC
The const might also mean that it assumes the string pointer to be valid forever.
Comment 5 Matthew Waters (ystreet00) 2015-10-13 22:36:08 UTC
I don't see any cases where the passed data would need to be live forever.  This functionality would be entirely CPU side so does not need any synchronisation on the GPU.  If there's a debug callback (which gstgl adds), the message is passed directly to the callback otherwise it will be copied when added to the debug message queue (retrieved by glGetDebugMessageLog).

Typically the convention is that most data that is passed to GL can be freed when the GL function finishes so this patch is correct.  The only cases I know of where this is false are related to buffer transfers.
Comment 6 Matthew Waters (ystreet00) 2015-10-13 23:01:55 UTC
commit 5b30a8e9b23578ea5c7a327d6bb8307f9b7de63f
Author: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Date:   Tue Oct 13 12:40:04 2015 +0200

    gl: fix leak in gst_gl_insert_debug_marker()
    
    The string allocated by g_vasprintf() was leaked.
    
    Reproduced using the
    validate.file.compositor.simple.play_15s.synchronized validate scenario.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756492
Comment 7 Guillaume Desmottes 2015-10-14 07:16:25 UTC
Isn't that something we'd to fix in the stable branch as well?
Comment 8 Matthew Waters (ystreet00) 2015-10-14 07:25:53 UTC
gst_gl_insert_debug_marker doesn't exist in stable.