[Xastir-dev] Segfault on list close

Jason Godfrey godfreja at gmail.com
Thu Aug 19 00:08:38 EDT 2010


I think I might have a solution to this problem, but I don't know Motif
enough (ok, at all) to know if it is valid or not.

My fix was to remove the XtDestroyWidgets in the for loop
in station_list_destroy_shell(). The for loop becomes:

    for (i = 0; i < ROWS; i++) {
        if (SL_callback[type][i]) {
            printf( "SL_callback\n" );
            XtFree(SL_callback[type][i]);
            SL_callback[type][i] = NULL;
        }
    }

Like I said earlier, I don't Motif, but I made the change based on the fact
that destroy functions in interface_gui.c don't destroy the child widgets
and that dialog works. When I made the change I could close the station list
dialogs repeatedly without a crash.

- Jason, N0RPM

On Thu, Jul 22, 2010 at 7:47 PM, Robert Mead <rmead at justconnected.net>wrote:

> Hello all -
>
> Using the latest CVS of Xastir, I get a segfault on closing any of the
> station list dialog boxes. I'm running Mac OS X 10.6.4 on a multiprocessor
> machine, which I mention since it seems to be related to threading. While
> doing a GDB step-through of list_gui.c:station_list_destroy_shell, it does
> not crash.
>
> I can't find the offending line, since I think I'm segfaulting somewhere in
> the Xt code after something's been mistakenly free'd and my gdb-fu is not
> strong.
>
> Here's my backtrace:
>
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_INVALID_ADDRESS at address: 0x000000000000002e
> 0x00000001003e31d5 in SortChildren ()
> (gdb) backtrace
> #0  0x00000001003e31d5 in SortChildren ()
> #1  0x00000001003e2374 in DeleteChild ()
> #2  0x000000010079ab8b in XtPhase2Destroy ()
> #3  0x000000010079ad62 in _XtDoPhase2Destroy ()
> #4  0x000000010079e46f in XtDispatchEvent ()
> #5  0x000000010079e571 in XtAppMainLoop ()
> #6  0x00000001000bb397 in main (argc=1, argv=0x7fff5fbff3a0, envp=<value
> temporarily unavailable, due to optimizations>) at main.c:27947
>
>
> I was hoping to come to you all with a patch, but I'm not sufficiently
> familiar with the codebase yet, nor the Xt code. So, in lieu of a .patch,
> what can I help you guys with? What else do you need from me?
>
> Thanks a bunch - I love the program and am looking forward to hacking
> around with it...
>
> 73,
> KC2YWE Robert
> _______________________________________________
> Xastir-dev mailing list
> Xastir-dev at lists.xastir.org
> http://lists.xastir.org/cgi-bin/mailman/listinfo/xastir-dev
>



-- 
I have learned to use the word 'impossible' with the greatest caution.  --
Wernher von Braun



More information about the Xastir-dev mailing list