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 743291 - Core dump when calling VolumeMonitor() get_volumes()
Core dump when calling VolumeMonitor() get_volumes()
Status: RESOLVED DUPLICATE of bug 675581
Product: pygobject
Classification: Bindings
Component: gio
3.14.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2015-01-21 11:40 UTC by Damon Lynch
Modified: 2015-01-22 04:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Damon Lynch 2015-01-21 11:40:56 UTC
Mistakenly calling get_volumes() directly on a VolumeMonitor causes a core dump:

$ python3
Python 3.4.2 (default, Oct  8 2014, 13:08:17) 
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import Gio
>>> v = Gio.VolumeMonitor()
>>> v.get_volumes()
Segmentation fault (core dumped)

The correct way to call get_volumes() is to do this:
>>> v = Gio.VolumeMonitor().get()
>>> v.get_volumes()

The simple error of not including the .get() probably should not cause a core dump.
Comment 1 Christoph Reiter (lazka) 2015-01-21 12:08:12 UTC
This also segfaults when using the C API:

#include <gio/gio.h>

int main(int argc, char *argv[]) {  
  GVolumeMonitor *monitor = g_object_new(G_TYPE_VOLUME_MONITOR, NULL);
  g_volume_monitor_get_mounts (monitor);
  return 0;
}
Comment 2 Simon Feltman 2015-01-22 04:24:50 UTC
See: https://wiki.gnome.org/Projects/PyGObject/Analysis/Bug675581

*** This bug has been marked as a duplicate of bug 675581 ***