Bug#857873: [libgtksourceview-3.0-1] documentation for "query-tooltip-text" and "query-tooltip-markup" wrong

Alex alexander.schwinn at gmx.de
Wed Mar 15 21:29:48 UTC 2017


Package: libgtksourceview-3.0-1
Version: 3.22.2-1
Severity: normal
Tags: patch

--- Please enter the report below this line. ---

The official documentation for the "query-tooltip-markup" and the
"query-tooltip-text" signal, says, that the user should free the
returned string with g_free() when done:
https://developer.gnome.org/gtksourceview/stable/GtkSourceMarkAttributes.html#GtkSourceMarkAttributes-query-tooltip-text

However libgtksourceview as well calls "g_free(text)" on the string,
after evoking the callback-method ( See gtksourcegutterrenderermarks.c,
line 313 )

So whenever the user tries to free the string again, a double-free
seg-fault will happen. Here as well my Stack Overflow question which
describes the problem in detail:
https://stackoverflow.com/questions/42805994/gtksourceview-usage-of-query-tooltip-text

By checking the source-code of libgtksourceview, it looks like the doc
was copy+pasted from the caller-method
"gtk_source_mark_attributes_get_tooltip_text ". For this method the doc
is actually very correct.

Attached a patch to fix the doc for both signals.

Cheers,
Alex

--- System information. ---
Architecture:
Kernel: Linux 4.8.0-2-amd64

Debian Release: 9.0
500 testing www.deb-multimedia.org
500 testing ftp.de.debian.org

--- Package information. ---
Depends (Version) | Installed
=============================================-+-==============
libatk1.0-0 (>= 1.32) | 2.22.0-1
libc6 (>= 2.14) |
libcairo2 (>= 1.4.10) |
libgdk-pixbuf2.0-0 (>= 2.22.0) |
libglib2.0-0 (>= 2.47.1) |
libgtk-3-0 (>= 3.19.12) |
libpango-1.0-0 (>= 1.18.0) |
libpangocairo-1.0-0 (>= 1.14.0) |
libxml2 (>= 2.7.4) |
libgtksourceview-3.0-common (>= 3.22.2-1) |


Package's Recommends field is empty.

Package's Suggests field is empty.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20170315/38529a7c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixQueryTooltipDoc.patch
Type: text/x-patch
Size: 1384 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20170315/38529a7c/attachment-0001.bin>


More information about the pkg-gnome-maintainers mailing list