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

RapidJSON with MemoryPoolAllocator results in crash #252

Closed
Leandros opened this issue Feb 25, 2015 · 7 comments
Closed

RapidJSON with MemoryPoolAllocator results in crash #252

Leandros opened this issue Feb 25, 2015 · 7 comments
Assignees

Comments

@Leandros
Copy link

Trying to parse anything with the build-in MemoryPoolAllocator results in a EXC_BAD_ACCESS while trying to allocate the Stack.

StackTrace from Xcode: http://i.imgur.com/KQp1lGY.png

Works with CrtAllocator, though.

Xcode & clang version:

# Xcode 6.1 (6A1052c, 6A1052d)
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix

Edit:
I ran the tests, they passed (except the valgrind one, for obvious reasons).

Running tests...
Test project /Users/arvidgerstmann/Github/rapidjson/build
    Start 1: perftest
1/3 Test #1: perftest .........................   Passed   83.84 sec
    Start 2: unittest
2/3 Test #2: unittest .........................   Passed    2.67 sec
@miloyip
Copy link
Collaborator

miloyip commented Feb 25, 2015

Did the unit tests also fail?

@Leandros
Copy link
Author

Nope. Here is the full result:

Running tests...
Test project /Users/arvidgerstmann/Github/rapidjson/build
    Start 1: perftest
1/3 Test #1: perftest .........................   Passed   83.84 sec
    Start 2: unittest
2/3 Test #2: unittest .........................   Passed    2.67 sec
    Start 3: valgrind_unittest
Could not find executable valgrind
Looked in the following places:
valgrind
valgrind
Release/valgrind
Release/valgrind
Debug/valgrind
Debug/valgrind
MinSizeRel/valgrind
MinSizeRel/valgrind
RelWithDebInfo/valgrind
RelWithDebInfo/valgrind
Deployment/valgrind
Deployment/valgrind
Development/valgrind
Development/valgrind
3/3 Test #3: valgrind_unittest ................***Not Run   0.00 sec
Unable to find executable: valgrind

67% tests passed, 1 tests failed out of 3

Total Test time (real) =  86.57 sec

The following tests FAILED:
      3 - valgrind_unittest (Not Run)
Errors while running CTest
make: *** [test] Error 8

@spl
Copy link
Contributor

spl commented Feb 26, 2015

Trying to parse anything with the build-in MemoryPoolAllocator results in a EXC_BAD_ACCESS while trying to allocate the Stack.

@Leandros Can you be more specific? If the unit tests pass, then something must be working. Do you have a minimal example that fails?

@miloyip
Copy link
Collaborator

miloyip commented Apr 11, 2015

The unit tests do use MemoryPoolAllocator. I just updated Xcode with the same compiler version, and find that the unit tests are passed normally too.
There may be some incorrect use of the API. Please provide some minimal code for us to investigate.

@miloyip
Copy link
Collaborator

miloyip commented Apr 24, 2015

I will close this issue first. If @Leandros would like to provide more feedback. You may reopen this issue and I will try to follow up. Thanks.

@miloyip miloyip closed this as completed Apr 24, 2015
@dumganhar
Copy link

@miloyip
I also got this issue while building a release version for Android.

  • Building debug version with MemoryPoolAllocator - OK.
  • Building release version with MemoryPoolAllocator - Crashed, crash stack is the same as what @Leandros said
  • Building release version with CrtAllocator - OK

Please refer to cocos2d/cocos2d-x#16492
Our user used the following patch to avoid crash.

typedef rapidjson::GenericDocument<rapidjson::UTF8<>, rapidjson::CrtAllocator> RapidJsonDocument;
typedef rapidjson::GenericValue<rapidjson::UTF8<>, rapidjson::CrtAllocator> RapidJsonValue;

I also tried with the latest release version, crash also happened.
Please try to run test with release version on Android. You probably would find the crash.

@miloyip miloyip self-assigned this Sep 23, 2016
@miloyip miloyip removed the invalid label Sep 23, 2016
@jhugard
Copy link

jhugard commented Feb 20, 2019

Curious why this was closed. Issue still occurs, with both 1.1.0 release and latest master. In our case, the crash happens with XCode 9.4.1.

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

5 participants