Issue Details (XML | Word | Printable)

Key: GROOVY-2182
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jochen Theodorou
Reporter: Tom Popovich
Votes: 0
Watchers: 0
Operations

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

groovy.sql.Sql printing row in closure causes java.lang.StackOverflowError

Created: 08/Oct/07 12:25 PM   Updated: 26/Oct/07 10:02 AM
Component/s: None
Affects Version/s: 1.1-beta-2
Fix Version/s: 1.1-rc-2

Time Tracking:
Not Specified

File Attachments: 1. File t.groovy_test_fails.groovy (0.9 kB)
2. File t.groovy_test_passes.groovy (1.0 kB)

Environment: Windows XP running groovy 1.1-beta-2 and 1.1-beta-3 JVM: 1.6.0_02-b05

Testcase included: yes


 Description  « Hide
java.lang.StackOverflowError generated by using this simple closure:
db.eachRow( 'sql select ' )  {  row -> 
  println row           //  <<== change row  to  row[0] and  java.lang.StackOverflowError will disappear
}

Test case files that will be attached deal with oracle thin client, however this is probably a generic bug.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Tom Popovich added a comment - 08/Oct/07 12:26 PM
t.groovy_test_fails.groovy will fail with msg: Caught: java.lang.StackOverflowError

Tom Popovich added a comment - 08/Oct/07 12:29 PM
This passing test case has 3 chars added ( row[0] vs row ) and runs fine

Tom Popovich added a comment - 08/Oct/07 12:34 PM
t.groovy_test_passes.groovy will run fine.

It differs in only 3 characters from the failing test. Here we use row[0] in the closure to print only the first column. If you change it to row you get a Stack Overflow.


Paul King added a comment - 13/Oct/07 08:48 PM
This appears to be fixed - awaiting confirmation from Jochen on whether some problematic code I removed was needed for other reasons.

Jochen Theodorou added a comment - 26/Oct/07 10:02 AM
fixed