[Bug 355254] New: Windowmaker segfaults on startup
https://bugzilla.novell.com/show_bug.cgi?id=355254 Summary: Windowmaker segfaults on startup Product: openSUSE 11.0 Version: Alpha 1 Platform: i386 OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: X11 Applications AssignedTo: nadvornik@novell.com ReportedBy: kmachalkova@novell.com QAContact: sndirsch@novell.com Found By: --- This is alpha1 (DVD version), minimal + X installation, Windowmaker && Windowmaker-applets (0.92.0-128) with its dependencies installed additionally via zypper. I've set /etc/sysconfig/windowmanager's DEFAULT_WM to windowmaker, restarted X and after logging in, I receive a nice popup telling me that Windowmaker received SIGSEGV and offering possibility to restart WM, abort and something else I don't recall now. Restarting WM (not surprisingly) does not help. Please let me know what additional info (strace, bt,...) do you need -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=355254 User nadvornik@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=355254#c1 Vladimir Nadvornik <nadvornik@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nadvornik@novell.com AssignedTo|nadvornik@novell.com |rguenther@novell.com --- Comment #1 from Vladimir Nadvornik <nadvornik@novell.com> 2008-01-22 09:58:32 MST --- This seems to be a gcc problem. Package built with -O2 segfaults, with -O0 works OK. gdb shows this: sphinx:/ # gdb wmaker [...] (gdb) run --for-real [...] Program received signal SIGSEGV, Segmentation fault. 0x0806e051 in handleExtensions (event=0x10) at event.c:490 490 if (wShapeSupported && event->type == (wShapeEventBase+ShapeNotify)) { (gdb) where #0 0x0806e051 in handleExtensions (event=0x10) at event.c:490 #1 0x080b5c6e in WMHandleEvent (event=0xffecbf08) at wevent.c:235 #2 0x0808fb07 in StartUp (defaultScreenOnly=1) at startup.c:1018 #3 0x080745a8 in main (argc=Cannot access memory at address 0x1 ) at main.c:867 The value of event is just passed and is not modified anywhere in the code. Maybe there is some problem with the declaration: static void handleExtensions(); [...] static void handleExtensions(XEvent *event) { [...] } -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=355254 User rguenther@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=355254#c2 Richard Guenther <rguenther@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenther@novell.com AssignedTo|rguenther@novell.com |nadvornik@novell.com --- Comment #2 from Richard Guenther <rguenther@novell.com> 2008-01-22 10:22:57 MST --- You need to debug this further. while (XPending(dpy)) { XEvent ev; WMNextEvent(dpy, &ev); WMHandleEvent(&ev); } does a meaningful event reach WMHandleEvent? If yes, where does it get broken? Etc. For example try zeroing the XEvent structure in this loop. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=355254 User nadvornik@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=355254#c3 Vladimir Nadvornik <nadvornik@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |rguenther@novell.com --- Comment #3 from Vladimir Nadvornik <nadvornik@novell.com> 2008-01-23 02:34:45 MST --- After changing static void handleExtensions(); to static void handleExtensions(XEvent *event); it started to work. I thought that both declarations are correct. Is it a gcc bug? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=355254 User rguenther@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=355254#c4 Richard Guenther <rguenther@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW Info Provider|rguenther@novell.com | --- Comment #4 from Richard Guenther <rguenther@novell.com> 2008-01-23 03:02:28 MST --- It depends on the context. The standard says that "An empty list in a function declarator ... that is not part of a definition of that function specifies that no information about the number or types of the parameters is supplied." and this usage is an obsolescent feature (it isn't a true prototype). So what static void handleExtensions(); .. call handleExtensions with arguments ... static void handleExtensions(XEvent *event); does is that it is "valid" in that it doesn't need to be diagnosed, but invokes undefined behavior at runtime if the passed arguments after applying default argument promotions are not compatible with the actual argument types in the function definition. A very common error is for example calling handleExtensions(0) in the above case where a 32bit int is passed instead of a 64bit pointer on 32bit archs. What exactly happens in your case I did not investigate. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=355254 User prusnak@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=355254#c5 Pavol Rusnak <prusnak@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |prusnak@novell.com, matz@novell.com Summary|Windowmaker segfaults on startup |Empty parameter list in function declarator | |causes segfault when using gcc optimizations --- Comment #5 from Pavol Rusnak <prusnak@novell.com> 2008-01-23 03:33:44 MST --- I encountered similar bug in mcrypt and fixed the package by correcting prototypes. I could investigate behavior of mcrypt code if windowmaker example is not enough. I am not a GCC guru, but I think that GCC uses optimizations where it is not appropriate (or it might indicate problem with aliasing). Anyway, I think that GCC should issue a warning about empty list (as it could lead to unexpected results) and we should also create check for rpmlint to remove all these deprecated prototypes from our packages. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=355254 User nadvornik@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=355254#c6 Vladimir Nadvornik <nadvornik@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|nadvornik@novell.com |rguenther@novell.com --- Comment #6 from Vladimir Nadvornik <nadvornik@novell.com> 2008-01-23 03:40:48 MST --- There is just a 32 bit pointer that should be passed to the function, but there appears some random value instead, see the backtrace above. static void handleExtensions(); void DispatchEvent(XEvent *event) { [...] handleExtensions(event); [...] } [...] static void handleExtensions(XEvent *event) { [...] } -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=355254 User nadvornik@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=355254#c7 Vladimir Nadvornik <nadvornik@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |coolo@novell.com --- Comment #7 from Vladimir Nadvornik <nadvornik@novell.com> 2008-01-23 03:43:48 MST --- IMHO this problem is quite dangerous and I agree with comment #5, we should check it in abuild. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=355254 User coolo@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=355254#c8 --- Comment #8 from Stephan Kulow <coolo@novell.com> 2008-01-23 03:56:42 MST --- first the compiler needs to warn, no? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=355254 User prusnak@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=355254#c9 --- Comment #9 from Pavol Rusnak <prusnak@novell.com> 2008-01-23 03:59:10 MST --- (In reply to comment #8 from Stephan Kulow)
first the compiler needs to warn, no? Yes, gcc warning is mentioned in comment #5.
-- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=355254 User kmachalkova@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=355254#c10 --- Comment #10 from Katarina Machalkova <kmachalkova@novell.com> 2008-01-23 04:03:44 MST --- Can you please fix windowmaker in the meantime? (if I get it correctly, it is one-liner patch) I'd like to keep using it, as it, unlike e.g. fvwm ;-) suits my needs best -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=355254 User nadvornik@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=355254#c11 --- Comment #11 from Vladimir Nadvornik <nadvornik@novell.com> 2008-01-23 04:46:22 MST --- Fixed windowmaker is submitted. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=355254 User rguenther@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=355254#c12 --- Comment #12 from Richard Guenther <rguenther@novell.com> 2008-01-23 04:51:46 MST --- There is -Wstrict-prototypes we could add to RPM_OPT_FLAGS (this is not enabled by -Wall). It will then say t.c:1: warning: function declaration isn't a prototype -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=355254 Richard Guenther <rguenther@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|rguenther@novell.com |nadvornik@novell.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=355254 User nadvornik@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=355254#c13 --- Comment #13 from Vladimir Nadvornik <nadvornik@novell.com> 2008-01-23 08:02:06 MST --- This warning is printed on each "old style" function declaration. I doubt we are able to get rid of them completely. We need something less generic. Any idea? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=355254 User rguenther@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=355254#c14 --- Comment #14 from Richard Guenther <rguenther@novell.com> 2008-01-23 08:10:20 MST --- Sure it does - that's its purpose. We could invent a new warning that is only triggered if you actually _call_ a function with such a prototype. No idea if that will cut down the number of warnings significantly... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=355254 User prusnak@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=355254#c15 --- Comment #15 from Pavol Rusnak <prusnak@novell.com> 2008-01-23 08:18:06 MST --- I think that Vladimir wanted something like this: declaration: int f(); definition: int f() { ... } => OK, although declaration should be "int f(void)" declaration: int f(); definition: int f(something) { ... } => warning/error That means warning with similar behaviour to -Wstrict-prototypes but ignoring cases where function parameter is void. But I really do not know how much are we messing with C standards. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=355254 User rguenther@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=355254#c16 --- Comment #16 from Richard Guenther <rguenther@novell.com> 2008-01-23 08:35:54 MST --- I have now something like int foo(); int bar(void) { return foo(0); } gcc-4.3 -S t.c -Wall t.c: In function 'bar': t.c:5: warning: call to function 'foo' without a real prototype t.c:1: note: 'foo' was declared here which will not warn if you call it as foo() instead. And it will also not warn for int foo(); int foo(int i) { return i; }; int bar(void) { return foo(0); } But it will warn for each call, not only if it encounters a real definition. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=355254 User nadvornik@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=355254#c17 Vladimir Nadvornik <nadvornik@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #17 from Vladimir Nadvornik <nadvornik@novell.com> 2008-09-09 03:14:53 MDT --- IMHO the fix is sufficient. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com