[Top][All Lists]

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

Embedding octave - clean_up but Dont exit

From: tails_naf
Subject: Embedding octave - clean_up but Dont exit
Date: Wed, 1 Apr 2015 00:06:12 -0700 (PDT)

I am trying to embed the octave library within a larger program. It is
required that I can start and stop the octave interpreter at will from this
larger program. However, the only function to stop the octave interpreter
cleanly also calls exit(), which kills the larger program also. The octave
library function is clean_up_and_exit().

Ideally I would like to call just the cleanup part (do_octave_atexit), and
skip the call to exit.

I tried the following:

1) calling do_octave_atexit, however the symbol is not exported in the
octave library. I Tried to access it anyway but to no avail.

2) I tried hooking into the call to exit, and replacing it with a function
that does not exit, via ld_preload. This messed up everything as all other
calls to exit were hooked also.

3) I tried to detect when exit was being called by octave only to prevent it
only then, by detecting the calling function with a call to backtrace. This
for some reason did not show what i would expect to be the true call
hierarchy. For some reason it only showed the main function, and no contents
of the call hierarchy through the octave library. So in was not able to
detect the call coming from octave.

So at this point I am out of ideas. I could recompile octave, but this
solution is supposed to work with a stock octave install.

This only had to work on a linux/gcc environment.

Any and all suggestions to this very tricky issue greatly appreciated.

View this message in context:
Sent from the Octave - General mailing list archive at

reply via email to

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