[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Weird behavior with mislocked: oct-file is unloaded while checking lock
From: |
John W. Eaton |
Subject: |
Weird behavior with mislocked: oct-file is unloaded while checking lock state... |
Date: |
Tue, 02 Sep 2008 15:13:14 -0400 |
On 1-Sep-2008, Michael Goffioul wrote:
| 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?
Probably there should be a check here to ensure that FUNCTION is not
locked, and not clear it if it is locked. Should we also warn here
about a locked function being out of date?
jwe
- Weird behavior with mislocked: oct-file is unloaded while checking lock state..., Michael Goffioul, 2008/09/01
- Weird behavior with mislocked: oct-file is unloaded while checking lock state...,
John W. Eaton <=
- Re: Weird behavior with mislocked: oct-file is unloaded while checking lock state..., Michael Goffioul, 2008/09/03
- Re: Weird behavior with mislocked: oct-file is unloaded while checking lock state..., Michael Goffioul, 2008/09/03
- Re: Weird behavior with mislocked: oct-file is unloaded while checking lock state..., John W. Eaton, 2008/09/03
- Re: Weird behavior with mislocked: oct-file is unloaded while checking lock state..., Michael Goffioul, 2008/09/04
- Re: Weird behavior with mislocked: oct-file is unloaded while checking lock state..., John W. Eaton, 2008/09/04
- Re: Weird behavior with mislocked: oct-file is unloaded while checking lock state..., Michael Goffioul, 2008/09/04
- Re: Weird behavior with mislocked: oct-file is unloaded while checking lock state..., John W. Eaton, 2008/09/04
- Re: Weird behavior with mislocked: oct-file is unloaded while checking lock state..., Michael Goffioul, 2008/09/05