Segfault on access to user data passed to action callback
Bug #314675 reported by
kriomant
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
notify-python (Ubuntu) |
Triaged
|
Medium
|
Unassigned |
Bug Description
Ubuntu Intrepid
python-
Trying to access user data passed to notification action callback leads to segfault.
Testcase is attached, it is slightly modified example program.
The reason is that refcount isn't incremented on 'user_data' argument in 'add_action', so it may be
garbage collected between calling 'add_action' and calling action callback.
Changed in notify-python: | |
importance: | Undecided → Medium |
status: | Confirmed → Triaged |
tags: | added: patch |
To post a comment you must log in.
As a workaround instead of:
notification. add_action( id, name, callback, data)
use:
notification. add_action( id, name, lambda n, id: callback(n, id, data))