Opened 6 years ago

Closed 5 years ago

#805 closed bug (fixed)

Reloading a library with a dependency of user-defined types

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

Description

Consider three libraries:

  1. base.lib
    version="version base.lib 1.0.0.0 Aug_2017 ";
    category="";
    info="";
    
    proc printInt(int i) { print(i); }
    
  2. objA.lib
    version="version objA.lib 1.0.0.0 Aug_2017 ";
    category="";
    info="";
    LIB "base.lib";
    static proc mod_init() {
    	newstruct("objA", "int data");
    	system("install", "objA", "print", printA, 1);
    }
    static proc printA(objA input) { print(printInt(input.data)); }
    
  3. objB.lib
    version="version objB.lib 1.0.0.0 Aug_2017 ";
    category="";
    info="";
    static proc mod_init() {
    	LIB "objA.lib";
    	newstruct("objB", "objA AData");
    	system("install", "objB", "print", printB, 1);
    }
    static proc printB(objB input) { print(input.AData); }
    

Loading objB.lib once via LIB works fine, but loading it again yields the following:

Singular : signal 11 (v: 4100):
current line:>>	LIB "Documents/Singular/objA.lib";<<
Segment fault/Bus error occurred at 746e656d75636f44 because of 10206 (r:1502272872)
please inform the authors
trying to restart...
// ** redefining blackbox type objB (534 -> 535)
Singular : signal 7 (v: 4100):
current line:>>	system("install", "objB", "print", printB, 1);<<
Segment fault/Bus error occurred at 7f1b474f77e0 because of 10206 (r:1502272872)
please inform the authors
trying to restart...
1
   ? error occurred in or before Documents/Singular/objB.lib::mod_init line 8: `system("install", "objB", "print", printB, 1);`
   ? last reserved name was `system`
   ? leaving Documents/Singular/objB.lib::mod_init
   skipping text from `;` error at token `)`
   ? leaving Documents/Singular/objB.lib::mod_init
Segmentation fault

Change History (1)

comment:1 Changed 5 years ago by hannes

Resolution: fixed
Status: newclosed

will not crash anymore, but redefinition of newstruct/blackbox is (currently) not possible: it will keep the old definition and warn:

// ** not redefining blackbox type objB (534)
Note: See TracTickets for help on using tickets.