[Botan-devel] Re: botan-devel Digest, Vol 13, Issue 10

Carlton Davis carlton at cs.mcgill.ca
Fri Dec 16 18:19:59 EST 2005

On Fri, 16 Dec 2005, Jack wrote:
> Hrm... you said you have checked that the initializer runs... are you
> certain
> that the shutdown function is not being called until the very end? I'm
> not
> seeing anything obvious here, so that's pretty much my best guess at
> this point.

Yes, I am certain that shutdown function doesn't get called
at all because the program crashes before
the Terminate() function (where I added the line
"Init::deinitialize()") is executed.

I think it is a scope issue. In the simulator code, the
initialization function (where I added the line
"Init::initialize()") which sets up the necessary C++ stuff,
runs and exits. This is follows by the execution of many other
C++ routines.

I have a function (generateKeys()) which generates RSA key
pairs. This function gets executed before the C++ initiator
function terminates. When I add the line "LibraryInitializer init"
in the header file for generateKeys(), the keys get generated
before the program crashes. However, when I comment out the
"LibraryInitializer init" line in the header file and add
"Init::initialize()" to the initiator function, the program crashes
before the keys are generated.

Any idea on why this occurs?

Thanks again and best regards,


> I am actually able to get the simulator to execute C++ code
> during the simulation initialization time. I indicated that the
> first thing I want to do (before any other C++ code is
> executed) is to execute the following line:
> Init::initialize();
> Similarly, I directed it to execute "Init::deinitialize()"
> as the last line of C++ code.
> The "Init::initialize()" line get executed but it is still
> throwing the Botan Invalid_State exception, ie I got the following
> output:
> "Botan::Invalid_State'
>   what():  Botan: LibraryInitializer not created, or it failed"
> What am I doing incorrect here?
> Your help is greatly appreciated.
> Best regards,
> -Carlton

More information about the botan-devel mailing list