History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: COR-714
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Unassigned
Reporter: Vidisha Sharma
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
db4o Core

StackOverflowException Occured when soda query executed using IConstraint

Created: 11/Jul/07 10:04 AM   Updated: 22/Aug/07 07:47 PM
Component/s: Queries
Affects Version/s: None
Fix Version/s: Denmark - v6.3

Time Tracking:
Original Estimate: Not Specified
Remaining Estimate: 0h
Time Spent - 9.67h
Time Spent: 9.67h
Time Spent - 9.67h

File Attachments: 1. Zip Archive ComplexTestCase.zip (265 kb)
2. Zip Archive ComplexTestCase.zip (265 kb)
3. Zip Archive TestApplication.zip (262 kb)

Issue Links:
Duplicate
 
Related
 

Order: 3
Resolution Date: 22/Aug/07 07:47 PM
First Response Date: 12/Jul/07 12:36 AM
Labels:
Participants: Patrick Roemer, Vidisha Sharma and Vidyadhar Nirantar
Number of Attachments: 3
Number of Comments: 11


 Description  « Hide
for version db4o v6.1.602
-------------------------------------

A simple sode query as follows throws stackoverflow exception.

 IQuery query = db.Query();
 IConstraint a = query.Constrain(typeof(A));
 IConstraint b = query.Descend("Arry").Descend("B_Name").Constrain("BName");
 IConstraint c = query.Descend("Arry").Descend("C_Name").Constrain("CName");
a.And(b);
a.And(c);

If the order of ANDing is changed and writen as,
  a.And(c);
  a.And(b);

the query is executed sucessfully.

If more complex query is writen for example
   IQuery query = db.Query();
            IConstraint a = query.Constrain(typeof(A));
            IConstraint b = query.Descend("Arry").Descend("B_Name").Constrain("BName");
            IConstraint c = query.Descend("Arry").Descend("C_Name").Constrain("CName");
            IConstraint x1 = a.And(c);
            IConstraint x2 = a.And(b);
            IConstraint x3 = x1.And(x2);

            IConstraint a1 = query.Constrain(typeof(A));
            IConstraint b1 = query.Descend("Arry1").Descend("B_Name").Constrain("BNamex");
            IConstraint c1 = query.Descend("Arry1").Descend("C_Name").Constrain("CNamey");
            IConstraint x11 = a1.And(c1);
            IConstraint x21 = a1.And(b1);
            IConstraint x31 = x11.And(x21);
            x31.And(x3);

            IObjectSet result = query.Execute();

It always throws stack overflow exception. A testcase to show both these scenario is attached alongwith.






 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Vidisha Sharma - 11/Jul/07 10:06 AM
Testcase attached

Patrick Roemer - 12/Jul/07 12:36 AM
Reproducible in Java, too.

Patrick Roemer - 17/Jul/07 11:02 PM
The problem was a circular "tree" created through candidate filtering. Fixed for this specific case, but IMO the Tree API/design should be changed to avoid scenarios like this - see COR-727.

Vidisha Sharma - 18/Jul/07 06:24 AM
Hi Patrick,

When will the db4o v6.1 be availaibe with this fix?

Regards,
Vidisha

Vidisha Sharma - 03/Aug/07 09:06 AM
Hi Parrick,

This issue seems to be still there for the following query

  IQuery query = db.Query();
            IConstraint a = query.Constrain(typeof(A));
            IConstraint b = query.Descend("Arry").Descend("B_Name").Constrain("BName");
            IConstraint c = query.Descend("Arry").Descend("C_Name").Constrain("CName");

            a.And(b);
            a.And(c);

            IConstraint b1 = query.Descend("Arry1").Descend("B_Name").Constrain("BNamex");
            IConstraint c1 = query.Descend("Arry1").Descend("C_Name").Constrain("CNamey");

            a.And(c1);
            a.And(b1);

 IObjectSet result = query.Execute();

Vidisha Sharma - 09/Aug/07 07:15 AM
Hi Patrick,

my class hierarchy is little complex. My problem is if I write constraints in one sequence the query works appropriately. If the change the sequence of constraints the querys stops working. I am attaching a testcase along which demonstrates this kind of behaviour.

Regards
Vidisha

Vidyadhar Nirantar - 09/Aug/07 07:24 AM
I am reopening this issue as I have encountered one more isse which I am uploading as testcase.

Vidisha Sharma - 09/Aug/07 07:29 AM
check the attached file 'ComplexTestCase.zip' which demonstrates this testcase.

Patrick Roemer - 13/Aug/07 11:34 AM
The reopened case looks like a completely different issue to me. Re-checked in as COR-768.

Vidisha Sharma - 17/Aug/07 02:07 PM
Hi Patrick,

Now this issue is reproducible at your end. This is a very critical issue and causing lots of problem to us. Can this be taken on priority.

Regards,
Vidisha

Patrick Roemer - 19/Aug/07 01:08 PM
Fixed, ported back to 6.3 and 6.1 branches.