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 617972 - Handle destroy callbacks of type other than GDestroyNotify
Handle destroy callbacks of type other than GDestroyNotify
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2010-05-06 21:46 UTC by Owen Taylor
Modified: 2010-05-07 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Handle destroy callbacks of type other than GDestroyNotify (1.52 KB, patch)
2010-05-06 21:46 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2010-05-06 21:46:39 UTC
It's not necessary that a destroy callback is literally of type
GDestroyNotify - we can handle any 'void (*function) (void *)'

So instead of checking against the type of the callback to
see what to skip, look for a callback that was previously used as
a GDestroyNotify for another callback.
Comment 1 Owen Taylor 2010-05-06 21:46:41 UTC
Created attachment 160467 [details] [review]
Handle destroy callbacks of type other than GDestroyNotify
Comment 2 Colin Walters 2010-05-06 21:51:07 UTC
Review of attachment 160467 [details] [review]:

Right, looks OK assuming we've validated the destroy notify index in the scanner.
Comment 3 Owen Taylor 2010-05-06 23:24:45 UTC
(In reply to comment #2)
> Review of attachment 160467 [details] [review]:
> 
> Right, looks OK assuming we've validated the destroy notify index in the
> scanner.

Doesn't look easy to do - we parse the included gir's, but then we dump the parsed results other than the type names, so at the point where we are parsing annotations, we have no idea what GLib.FreeFunc is.

It's not like there aren't a million other ways to segfault if you have bad annotations...
Comment 4 Colin Walters 2010-05-07 02:03:40 UTC
Hmm.  Ok.
Comment 5 Owen Taylor 2010-05-07 16:11:50 UTC
Attachment 160467 [details] pushed as 62cf04d - Handle destroy callbacks of type other than GDestroyNotify