#434 closed defect (fixed)
segmentation fault when indexing inline the result from IncludeBDT
Reported by: | Jorge | Owned by: | Víctor de Buen Remiro |
---|---|---|---|
Priority: | highest | Milestone: | |
Component: | SetAlgebra | Version: | head |
Severity: | blocker | Keywords: | |
Cc: |
Description
The following code cause a segmentation fault
Set BDTFile( Serie SubSer(Gaussian(0,1),y2000m1, y2000m2)?, "tmp_ser.bdt");
Serie ser = IncludeBDT("tmp_ser.bdt")[1];
Real FileDelete("tmp_ser.bdt");
Change History (3)
comment:1 Changed 19 years ago by
Status: | new → assigned |
---|
comment:2 Changed 19 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Problem has been fixed in CVS HEAD
BSourcePath behaviour has been simplifyied and ensured to avoid some integrity problems but that didn't be the problem here.
Problem was that BTimeSerie used a member file_ to point the BSyntaxOBject set object IncludeBDT("...") to read its data when needed, but in this moment the set had been deleted already and an invalid memory access made a TOL crash.
BDT series is no more lazy, so file_, File() and PutFile() members has been eliminated. If lazy behaviour is needed in future solution should be to inherite a class as is done with BSI series, but I think this is not an usefull feature in BDT's due to usually there are no very big BDT files that could be a problem.
Thanks to report
comment:3 Changed 18 years ago by
bug_file_loc: | → http://cvs.tol-project.org/viewcvs.cgi/tol_tests/tol/Bugzilla/bug_000434 |
---|
If you write
Set ser_all = IncludeBDT("tmp_ser.bdt");
Serie ser = ser_all[1];
then no TOL crash happens.
So, I think problem is due to an invalid access to the object IncludeBDT("tmp_ser.bdt") when TOL tries to put the sourcePath_ member to IncludeBDT("tmp_ser.bdt")[1].
I'm revisiting BSourcePath and BSetFromFile classes to solve this and some other problems related to handling with theses objects.
Thanks to report it.