Bug 3042

Summary: bounded sequence allocation problem
Product: TAO Reporter: Stanislaw Trytek <tryteks>
Component: otherAssignee: DOC Center Support List (internal) <tao-support>
Status: RESOLVED FIXED    
Severity: major    
Priority: P1    
Version: 1.5.9   
Hardware: All   
OS: All   
Attachments: regression test

Description Stanislaw Trytek 2007-08-14 06:41:41 CDT
Bounded sequences allocate memory for all its values at the creation time. As a result an apllication using complex/long bounded sequences needs and wastes much more resorces. In case of recursive bounded sequences it leads to stock recursion (finally segmentation fault). This problem does not occure with unbouded sequences.
Comment 1 Johnny Willemsen 2007-08-14 06:45:22 CDT
please provide an automated regression test as reproducer. Use one of the existing tests as base and don't use anything like stl, streams.
Comment 2 Stanislaw Trytek 2007-08-14 06:59:13 CDT
Created attachment 845 [details]
regression test

This test creates very simple recursive bounded sequence and exits with SEGV fault
Comment 3 Johnny Willemsen 2007-08-14 14:06:21 CDT
thanks for the regression test, I will have a look
Comment 4 Johnny Willemsen 2007-08-15 06:23:26 CDT
Wed Aug 15 11:21:12 UTC 2007  Johnny Willemsen  <jwillemsen@remedy.nl>

        * tao/Bounded_Array_Allocation_Traits_T.h:
        * tao/Bounded_Reference_Allocation_Traits_T.h:
        * tao/Bounded_Value_Allocation_Traits_T.h:
        * tao/Valuetype/Bounded_Valuetype_Allocation_Traits_T.h:
          Don't preallocate all sequence members when using bound sequences,
          this could lead to a stack overflow when using recursive types
          as described in bugzilla 3042. Thanks to Stanislaw Trytek
          <tryteks at pit dot edu dot pl> for reporting this.

        * tests/Bug_3042_Regression/*:
          New regression test for bug 3042, thanks to Stanislaw Trytek
          <tryteks at pit dot edu dot pl> for creating this one