Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
gobject-introspection
gobject-introspection
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 227
    • Issues 227
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 18
    • Merge Requests 18
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GNOME
  • gobject-introspectiongobject-introspection
  • Issues
  • #129

Closed
Open
Opened Apr 07, 2015 by bugzilla-migration@bugzilla-migrationReporter

gobject-introspection should annotate pointer plus GDestroyNotify, e.g. in g_memory_input_stream_new_from_data()

Submitted by Philip Chimento @ptomato

Link to original bug (#747431)

Description

Consider the following GJS program:

const Gio = imports.gi.Gio;
let stream = Gio.MemoryInputStream.new_from_data('', -1, null);

This segfaults. I believe it's because GJS frees the string data before freeing the GMemoryInputStream at the end of the program. PyGObject seems to copy the data and doesn't segfault.

However, I don't think it's possible to properly use this function in introspected bindings; really, no-one should have to pass in a GDestroyNotify to introspected API. (This was kind of a side effect of https://bugzilla.gnome.org/show_bug.cgi?id=589887 which was eventually closed with no changes.) And there's really no sensible value to pass besides NULL.

Now that we have g_memory_input_stream_new_from_bytes() I think ..._new_from_data() should be annotated with (skip).

Edited Feb 08, 2018 by Philip Chimento
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: GNOME/gobject-introspection#129