close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 15 years ago

Closed 15 years ago

#752 closed defect (fixed)

crash when loading oza containing instances without Class definition

Reported by: Jorge Owned by: Víctor de Buen Remiro
Priority: highest Milestone: OOP Implementation
Component: OOP Version: head
Severity: major Keywords:
Cc:

Description (last modified by Jorge)

Evaluate file1.tol in one tol session then in other session evaluate file2.tol, the session 2 will fail with a segmentation fault because Class A is not defined.

file1.tol
============================

Class A {
  Real v = 1
};

A objA;

Real Ois.Store( [[ objA ]], "/tmp/objA.oza" );

file2.tol, to be executed in other sesion
===========================================

Set Include( "/tmp/objA.oza" );

Change History (2)

comment:1 Changed 15 years ago by Jorge

Description: modified (diff)

comment:2 Changed 15 years ago by Víctor de Buen Remiro

Resolution: fixed
Status: newclosed

In new release TOL doesn't fail with a segmentation fault.
It gives these error messages

ERROR: [1] OIS: 
No se puede cargar del OIS NameBlock objADebido a que su ascendiente Class @A no existe

ERROR: [2] OIS: 
BOisLoader::ReadNextObject: NULL element of set 

ERROR: [3] Intento de acceso al elemento 1-esimo de un conjunto de 0 elementos

ERROR: [4] Tipo de fichero desconocido "objA.oza"

The Class A is not stored nor reloaded and objA cannot be rebuilt.

Other auxiliar information is stored in OIS as the dating of a time series or the structure of a set, but the calss of an instance is a more complex task, due it can be inherited from other classes.

So, you should insert the class in the OIS or load it from another prebuilt OIS or from original source, as described in this test

Note: See TracTickets for help on using tickets.