Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'FormatTest' Unit Tests crash when run under GC #70

Closed
tkarpinski opened this issue May 23, 2011 · 0 comments
Closed

'FormatTest' Unit Tests crash when run under GC #70

tkarpinski opened this issue May 23, 2011 · 0 comments

Comments

@tkarpinski
Copy link

Environment:
Xcode: 4.0.2
Mac OS: 10.6.7

When running the unit tests with the -fobjc-gc switch, the 'FormatTest' suite crashes with an EXC_BAD_ACCESS.

Test Suite 'FormatTest' started at 2011-05-23 15:56:03 -0400
Test Case '-[FormatTest testData]' started.
Test Case '-[FormatTest testData]' passed (0.023 seconds).
Test Case '-[FormatTest testString]' started.
EXC_BAD_ACCESS: Line 143 in SBJsonStreamWriter.m

The violations always point back to SBStackState.m. I've rewritten SBStackState.m to use an NSMutableArray which is probably less performant but passes the Unit Tests in both GC and non-GC environments.

Here's the commit on my branch for discussion: d94a98a57262d8acc8955bca777d3f72449b35b4

I discovered this issue while tracking down a memory leak in GC with the SBStackState object - a finalize method that calls free(_stack) is required to not leak the object.

@stig stig closed this as completed in 0d2e1f8 May 24, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants