GNOME Bugzilla – Bug 349334
Calling close() from Gnome::Vfs::DirectoryHandle causes segfault
Last modified: 2011-01-16 23:36:12 UTC
Steps to reproduce: 1. Gnome::Vfs::DirectoryHandle dir_handle = Gnome::Vfs::DirectoryHandle::DirectoryHandle(); 2. dir_handle.open(uri); 3. dir_handle.close(); Stack trace:
+ Trace 69808
Other information:
Could we have an actual compileable test case please? You might be able to modify an example, for instance. Also, valgrind's memcheck might give interesting clues.
Created attachment 70052 [details] source codes and makefile
Attached here are the sources and makefile. Compilation is OK but the program segfaults whenever the following runs: dir_handle.close(); (N.B. dir_handle is an instance of Gnome::Vfs::DirectoryHandle) Commenting out the statement seems to avoid the problem. Matthias Kaeppler <nospam digitalraid com> encountered the same problem as me: http://www.mail-archive.com/gnomemm-list@gnome.org/msg00048.html
Thanks. I'll try to investigate this in the next few days.
By the way, I usually prefer test cases to be as small as possible while also demonstrating the problem, but I should be able to manage with this.
I have changed the close() function to set gobj_ to 0 so that it is not used later in the destructor. I believe that fixes this. Please reopen if I'm wrong.