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 19 years ago

Closed 19 years ago

Last modified 18 years ago

#439 closed defect (fixed)

Segmentation fault with local structs

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

Description

Try the following code:

Set s1 = {

Struct strA {

Text tt

};
strA("aa")

};

Set View(s1?, "Std");

A segmentation fault is generated when ejecuting "View", the same happens when doing

Text StructName(s1);

It seems to be related with Struct strA being local. It could be related to other bugs in tolbase/toltcl because when a doing tol::forallchild if an item of a Set is an structured Set the following is executed for that item:

ptrSet->Struct()->Name();

and that expresion will fail if the Struct does not exists, ie. point to an invalid address.

Change History (2)

comment:1 Changed 19 years ago by Víctor de Buen Remiro

Resolution: fixed
Status: newclosed

Problem has been fixed in CVS and a test is added to

tol_tests/tol/bugzilla/bug_000439

Local structure is not accessible out of scope, so, set created in this way will work as non structured sets. Also, an error like this will be sent to the user:

Attempt to access local Struct ...

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

bug_file_loc: http://cvs.tol-project.org/viewcvs.cgi/tol_tests/tol/Bugzilla/bug_000439
Note: See TracTickets for help on using tickets.