[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Bug#2608: kcmdlineargs, segmentation fault when starting kdm (fwd)
From:       Harri Porten <porten () tu-harburg ! de>
Date:       2000-02-01 11:52:08
[Download RAW message or body]

Already fixed ?

Harri.

---------- Forwarded message ----------
Date: Tue, 01 Feb 2000 22:40:11 +1100
From: Ferdi Franceschini <ferdif@optusnet.com.au>
To: submit@bugs.kde.org
Subject: Bug#2608: kcmdlineargs, segmentation fault when starting kdm

Package: kdelibs
Version:  krash
Snapshot: kdelibs-20000131

When I run kdm it aborts before displaying the greeter.
I have located the bug in kcmdlineargs.cpp and I have attached a patch
that seems to fix the problem.

Basically the problem is that kgreeter creates an argv array with some
NULL pointers.  This causes a segmentation fault in
KCmdLineArgs::parseAllArgs() when it tries to dereference the
NULL entry.
I can fix the problem by getting parseAllargs() to skip the NULL entries
(see patch), you probably have a better solution.

Following is a transcript of the gdb debugging session

Program received signal SIGSEGV, Segmentation fault.
0x400d5565 in KCmdLineArgs::parseAllArgs () at kcmdlineargs.cpp:437
437           if ((argv[i][0] == '-') && inOptions)
Current language:  auto; currently c++
(gdb) p KCmdLineArgs::argv[i]
$1 = 0x0

If you need more info let me know.

With regards
Ferdi



["kcmdlineargs.diff" (TEXT/PLAIN)]

--- kcmdlineargs.cpp	Tue Feb  1 21:29:45 2000
+++ kcmdlineargs.cpp.new	Tue Feb  1 21:46:06 2000
@@ -434,6 +434,7 @@
    }
    for(int i = 1; i < argc; i++)
    {
+      if (argv[i]) /* skip NULL arguments */
       if ((argv[i][0] == '-') && inOptions)
       {
          bool enabled = true;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic