GNOME Bugzilla – Bug 327587
use of popt causes critical warning which crashes gnome-volume-manager
Last modified: 2008-01-18 17:23:40 UTC
Steps to reproduce: 1. start the session Stack trace: Other information: Attaching a patch which fixes this by moving to the GOptions API
Created attachment 57611 [details] [review] Ports the popt command line parsing code to use GOptions instead
cool, thanks j5 - feel free to commit. Do you have any idea what is causing the popt crash tho?
Committed. There was a NULL somewhere that was causing an assert to be triggered. Ray and I thought the poptResetContext () API might not actually work but since GOptions is now the recommended way of doing things we figured why not just update it.
fair enough. thanks fort he patch
*** Bug 326908 has been marked as a duplicate of this bug. ***
I filed dupe 326908. I can confirm this fixed the problem for me.
I'm gonna reopen this for myself since unfortunately the fix makes it not build against gnome-2.12 which I need it to :( Since this didn't crash for me on gnome-2.12 and it *seems* (can anyone confirm?) that this only crashed for people running gnome-2.13, perhaps something in libgnome got broken? the other possibility is a that some versions of popt, other than what I have, got broken?
ok, now fixed in CVS by using GOption if available, else falling back to popt.
ok, finally found the real problem... gnome_program_init() calls a pre_args_parse() callback for each module before parsing args. after parsing args it calls a post_args_parse() callback for each. The problem was that libbonoboui was freeing a temp variable that was used in one of its own popt option callbacks. since g-v-m was resetting the context to parse its own args after gnome_program_init() finished, the libbonoboui popt option callback was getting called (for --screen as passed by the session manager) with the tenmp variables already cleaned up, which then caused an abort().
oh yea, and Really Truly Fixed For Real(tm) in 1.5.12
*** Bug 330688 has been marked as a duplicate of this bug. ***
this bug is linked to from http://live.gnome.org/GnomeGoals/PoptGOption implying popt has been replaced by GOption in g-v-m, but AFAIK popt is still used here.
[luis@alcor gnome-volume-manager]$ grep -Ri popt * --include="*.c" src/manager.c:static const struct poptOption options[] = { src/manager.c: { "version", 'v', POPT_ARG_NONE | POPT_ARGFLAG_ONEDASH, &print_version, 'v', src/manager.c: { "daemon", 'd', POPT_ARG_STRING | POPT_ARGFLAG_ONEDASH, (char **) &daemon_arg, 'd', src/manager.c: { "no-daemon", 'n', POPT_ARG_NONE | POPT_ARGFLAG_ONEDASH, &no_daemon, 'n', src/manager.c: { "secret-mode", 's', POPT_ARG_NONE | POPT_ARGFLAG_ONEDASH, &secret_mode, 's', src/manager.c: GNOME_PARAM_POPT_FLAGS, POPT_CONTEXT_POSIXMEHARDER, src/manager.c: GNOME_PARAM_POPT_TABLE, options, Reopening, as it seems popt is still used...
Note that Goption isn't even used at all...
now fixed by http://svn.gnome.org/viewvc/gnome-volume-manager/trunk/src/manager.c?r1=1302&r2=1301&pathrev=1302 thanks fejj.