Skip to content

GObject Introspection from Python: inf_io_add_watch: socket gets passed integer value instead of pointer. #8

@vasiliyl

Description

@vasiliyl

I'm trying to rewrite inf-test-browser in python using gobject introspection and what I've encountered looks like a bug. Here is snippet code:

from gi.repository import Infinity

io = Infinity.StandaloneIo.new()
io.add_watch(0, Infinity.IoEvent.INCOMING | Infinity.IoEvent.ERROR, lambda *args, **kwargs: None, None)
io.add_watch(0xBEEF, Infinity.IoEvent.INCOMING | Infinity.IoEvent.ERROR, lambda *args, **kwargs: None, None)

I've added printf("%p\n", socket); to add_io_watch to confirm my guess and here is the output:

socket = (nil)

** (process:30884): CRITICAL **: inf_io_add_watch: assertion 'socket != NULL' failed
socket = 0xbeef
zsh: segmentation fault

I'm using python3 if that matters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions