GNOME Bugzilla – Bug 356667
g-p-m segfaults on startup unless '--debug' option set
Last modified: 2006-09-19 12:47:21 UTC
System: PPC running YDL-4.1 [FC4 clone], GARNOME-2.16.x, gcc-4.02 ==================================================================== g-p-m did not compile because of spurious compiler warnings. There were complaints about a dummy variable name, index, in the signature of function declarations in bus-gtype-specialized.h overshadowing a function name in <strings.h> I worked around this by removing the mandatory '-Werror' flag configure: --- gnome-power-manager-2.17.1/configure- 2006-09-18 21:48:48.000000000 -0400 +++ gnome-power-manager-2.17.1/configure 2006-09-18 21:50:10.000000000 -0400 @@ -19508,7 +19508,7 @@ fi -CPPFLAGS="$CPPFLAGS -Werror -Wall -Wshadow -Wcast-align -Wno-uninitialized" +CPPFLAGS="$CPPFLAGS -Wall -Wshadow -Wcast-align -Wno-uninitialized" #CPPFLAGS="$CPPFLAGS -Wall" CPPFLAGS="$CPPFLAGS -g" Once built and installed, g-p-m segfaults upon startup unless a '--debug' command line option is set. The segfault is the result of deferencing a NULL pointer in ./src/gpm-main.c at line 186: /* Add all of the options specified on the --debug line */ for (i = 0; debugoptions[i]; i++) { gpm_add_debug_option (debugoptions[i]); } -Joseph
>The segfault is the result of deferencing a NULL >pointer in ./src/gpm-main.c at line 186: Good catch. 2006-09-19 Richard Hughes <richard@hughsie.com> * src/gpm-main.c: Remove a potential null-dereference, spotted by Joseph Sacco. This fixes #356667 where g-p-m would crash on startup. >I worked around this by removing the mandatory '-Werror' flag configure: Instead of removing -Werror does removing -Wshadow also get rid of the compilation fail? I tend to run -Werror for development releases and not for stable ones.
Richard, I have verified that removing '-Wshadow' from CPPFLAGS instead of '-Werror' also gets rid of the compilation failure, as expected. Looking at the source, I see that g-p-m supports two configure arguments --enable-compile-warnings=[no/minimum/yes/maximum/error] --enable-more-warnings Maximum compiler warnings that control the level/actions of compiler options. Would it suffice to use these flags rather than using different definitions for CPPFLAGS for development and stable releases? -Joseph
2006-09-19 Richard Hughes <richard@hughsie.com> * configure.in: Remove -Wshadow as it causes compilation failure on YDL-4.1. Fixes #356667. I'll have to look more about enable-compile-warnings and enable-compile-warnings for a more suitable long-term fix. Do have any ideas?