[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Segfault at quit with global and DLD type
From: |
Michael Goffioul |
Subject: |
Re: Segfault at quit with global and DLD type |
Date: |
Wed, 25 Feb 2009 22:36:43 +0000 |
On Wed, Feb 25, 2009 at 10:08 PM, Jason Riedy <address@hidden> wrote:
> I'm just a font of fun. The following script snippet triggers a segfault
> on quit when used with the appended (nigh trivial) tst.cc and PKG_ADD:
>
> global f;
> f = handle_open ();
> disp (f)
>
> Commenting out the first global f lets this run without segfaulting, so
> this likely is a race when destroying things. Tested on fresh tip builds
> (from tip about 4 hours ago) on Debian and Fedora.
I don't think it's really a race condition, but more the order in which
objects are destroyed. It's probably related to the problem already
reported that octave crashes on "clear all" when SWIG-based packages
are loaded.
More precisely, I think (John, could you confirm?) that DLD functions
are cleared before global variables. Clearing your oct-file will unmap
the octave_handle class code. When the global object is destroyed,
octave crashes because the object's vtable points to nowehere.
Michael.