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 693939 - sourcescanner: Fix symbolic references in enum members
sourcescanner: Fix symbolic references in enum members
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-02-16 05:48 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2015-02-07 16:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sourcescanner: Remove unused "id" field (682 bytes, patch)
2013-02-16 05:49 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
sourcescanner: Fix symbolic references in enum members (6.07 KB, patch)
2013-02-16 05:49 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-02-16 05:48:58 UTC
While debugging some Shell code, I found that one of our enum
members was wrong in introspection land. The enum in question
looked like:

    typedef enum {
      SHELL_KEYBINDING_MODE_NONE          = 0,
      SHELL_KEYBINDING_MODE_NORMAL        = 1 << 0,
      SHELL_KEYBINDING_MODE_OVERVIEW      = 1 << 1,
      /* ... */
    
      SHELL_KEYBINDING_MODE_ALL = ~SHELL_KEYBINDING_MODE_NONE,
    } ShellKeyBindingMode;

Looking into it, I found that the scanner was dealing with
symbolic references in enum members badly, overwriting previous
values if they existed. I don't know how memory is managed in
the source scanner (but we seem to create new symbols and reuse
old ones without refing in the same codepath, so I think it's
already broken), so this patch may leak.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-02-16 05:49:00 UTC
Created attachment 236347 [details] [review]
sourcescanner: Remove unused "id" field
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-02-16 05:49:02 UTC
Created attachment 236348 [details] [review]
sourcescanner: Fix symbolic references in enum members

We need to copy the source symbols, otherwise we'll
overwrite their values. This isn't good.
Comment 3 Colin Walters 2013-02-18 15:49:10 UTC
Review of attachment 236347 [details] [review]:

Sure.
Comment 4 Colin Walters 2013-02-18 15:49:50 UTC
Review of attachment 236348 [details] [review]:

This looks like a good fix; I'm not too concerned about leaking at this scale since we're just going to exit.
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-08-05 19:18:44 UTC
This was pushed at some point.
Comment 6 André Klapper 2015-02-07 16:49:59 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]