octave-maintainers
[Top][All Lists]
Advanced

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

Weird behavior with mislocked: oct-file is unloaded while checking lock


From: Michael Goffioul
Subject: Weird behavior with mislocked: oct-file is unloaded while checking lock state...
Date: Mon, 1 Sep 2008 17:34:09 +0200

Hi,

While still trying to lock FLTK backend code when it is loaded (to avoid
crash on "clear -f"), I added the following in __init_fltk__:

    octave_call_stack::top()->lock();

Then I use the following test code:

   backend('fltk');  <-- this calls __init_fltk__
   mislocked('__init_fltk__')

After that, I noticed that the backend behave strangely, especially
the fact that one bool static variable contained in fltk_backend.oct
was reset to false (while __init_fltk__ set it to true). After debugging,
I ended up in out_of_date_check_internal (symtab.cc) around line 208

                  if (file.empty ())
                    {
                      // Can't see this function from current
                      // directory, so we should clear it.

                      function = octave_value ();
                    }

After this piece of code, the module fltk_backend.oct is unmapped
from memory, losing the value of the internal static variable. Later on,
I guess the module is reloaded again and the static variable gets its
default value. I found this weird as __init_fltk__ is locked, so I had hoped
this would prevent unloading fltk_backend.oct.

I'm a little bit confused about this. John, could you give me a hint?

Michael.


reply via email to

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