Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#819 closed bug (fixed)

Calling a function (which loads a library) twice

Reported by: Johannes Hoffmann <johannes.hoffmann@…> Owned by: somebody
Priority: minor Milestone: 4-2-0 and higher
Component: dontKnow Version: 4-1-0
Keywords: LIB Cc:

Description

Create a library (let's call it error_test.lib) containing a function that loads another library:

proc f() {
  LIB "general.lib";
}

Calling

LIB "error_test.lib";
f();

loads the package general.lib as expected, but calling f(); again yields the following crash:

Singular : signal 11 (v: 4100):
current line:>>	LIB "general.lib"; <<
Segment fault/Bus error occurred at 696c2e74756f6e69 because of 10206 (r:1517828648)
please inform the authors
trying to restart...
Segmentation fault

I tried it with general.lib, dmod.lib and ncalg.lib with the same result.

Change History (1)

comment:1 Changed 6 years ago by hannes

Resolution: fixed
Status: newclosed

fixed with 1fef1dd8735faae2b22e848791acf5977f5a49fa In general, it is a bad idea to use LIB within a procedure: usually all objects defined within a procedure are local (to the procedure and to the library). And what should happen if you reload the currently active procedure? Managing all these special cases for all that is errorprone.

Last edited 6 years ago by hannes (previous) (diff)
Note: See TracTickets for help on using tickets.