octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"clear all" problem for classes defined in oct-files (Was: : bug) (Conce


From: Michael Goffioul
Subject: "clear all" problem for classes defined in oct-files (Was: : bug) (Concerns: SWIG)
Date: Mon, 26 May 2008 17:16:07 +0200

On Mon, May 26, 2008 at 9:58 AM, Michael Goffioul
<address@hidden> wrote:
>> I'm still hoping one of Octave's windows based developers will chime
>> in. In the meantime, does the same result occur when you type "clear
>> all" as the initial command, or does it only occur when in a script?
>
> I can reproduce this bug. Simply typing "clear all" at octave prompt
> makes octave crash. This does not occur with development branch.
> I'll try to find the reason, but this can take time as I have to recompile
> octave with debug enable.

OK, I could figure out what caused the crash, but unfortunately the fix
is not as easy as I thought. That's why I would like to hear comments
from John (for the symbol table stuff) and Xavier (for the SWIG stuff).

Note: this problem occurs in 3.0.1, but I could not check if it was present
in development code (it happens with SWIG-based code, but SWIG
support for octave is only available for 3.0.x branch, AFAIK).

Basically, the problem is that "clear all" at octave prompt makes octave
crash when a SWIG-based package like "database" is loaded in memory,
more specifically the SQLite3 support. When loaded by octave, this
package installs various global variables, whose class is contained in the
oct-file sqlite3.oct. When calling "clear all", octave does the following:
1) clear current symbol table (curr_sym_tab)
2) clear functions of fbi_sym_tab
3) clear global symbol table (global_sym_tab)

Now the problem is that step 2) unmaps sqlite3.oct from process address
space. This invalidates the virtual table of sqlite3 objects contained in the
global symbol table. In step 3), clearing some of those objects results in
calling functions in the invalid virtual table and produces a segmentation
fault.

A simple workaround for the user is to simply not load those SWIG-based
packages are startup: ftp, ann and database. This can be done by either
deselecting them at installation time, or by simply typing

pkg rebuild -noauto ftp database ann

at octave prompt, then restart octave. You can check that packages are
not loaded with "pkg list".

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]