[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: user type segfault
From: |
Andy Adler |
Subject: |
Re: user type segfault |
Date: |
Tue, 11 Feb 2003 15:34:02 -0500 (EST) |
On Tue, 11 Feb 2003, Paul Kienzle wrote:
> Here's a foolproof method of generating a segfault:
>
> octave> x = make_int(1)
> octave> clear functions
> octave> x
>
> It fails with any user defined type, since once
> the oct-file is unloaded the virtual octave_value
> functions are no longer available. The following
> code works around this:
>
> symbol_record *fn = fbi_sym_tab->lookup("myconstructor")
> fn->unprotect();
> fn->make_eternal();
> fn->make_as_static();
> fn->protect();
>
> Now the constructor is no longer cleared so the oct-file
> is no longer unloaded so the virtual functions are
> still available.
>
> I've defined lock_function(string) in variables.cc
> which does this. Call lock_function("myconstructor")
> when you call mytype::register_type().
Won't this prevent unloading of functions for those
who are doing the compile-run-debug cycle of code
development?
Is there any way then to force the unloading of
the oct file?
Andy