Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • pygobject pygobject
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 280
    • Issues 280
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 16
    • Merge requests 16
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOME
  • pygobjectpygobject
  • Issues
  • #158
Closed
Open
Created Jan 26, 2018 by Mikhail Fludkov@fludkov.meContributor

Memory corruption around PyGObjectData->closures list causes segfault (+patch)

The memory corruption occurs because of the race while accessing PyGObjectData->closures list.

It happens only when GC is running from a different thread than the g_signal_handle_disconnect code. See the attached traceback.

A brief explanation of what is happening. GC iterates PyGObjectData->closures list inside pygobject_traverse holding the GIL. At the same time, the other thread calls g_signal_handle_disconnect, which results in the pygobject_unwatch_closure call (not holding GIL) that modifies the list.

The proposed patch fixes the race by protecting access to the list by GIL inside pygobject_unwatch_closure.

gdb.txt

Assignee
Assign to
Time tracking