Skip to content

SegFault on Jemalloc on a Simple use case #155

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

Closed
shuzhang1989 opened this issue Apr 11, 2016 · 6 comments
Closed

SegFault on Jemalloc on a Simple use case #155

shuzhang1989 opened this issue Apr 11, 2016 · 6 comments

Comments

@shuzhang1989
Copy link

Hi, I constructed a very simple getObjectRequest:
Aws::S3::Model::GetObjectRequest getObjectRequest; Aws::String bucket = "my-bucket"; getObjectRequest.SetBucket(bucket);

Then program crashed at the SetBucket() method. gdb tells:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6f186f4 in free () at include/jemalloc/internal/arena.h:511
511 include/jemalloc/internal/arena.h: No such file or directory.

I built the SDK without local custom memory management flag.

Is there any idea on it? Looks somehow the sdk screws with using jemalloc. (BTW my other part of the program relies on jemalloc, but even i removed jemalloc linking option, it still segfaults)

@JonathanHenson
Copy link
Contributor

You built the SDK without Custom memory management, but did you tell your program not to use custom memory management via. -DAWS_CUSTOM_MEMORY_MANAGEMENT=0

@shuzhang1989
Copy link
Author

@JonathanHenson thanks for the reply. No i didn't, should i add this flag into cmake?

@JonathanHenson
Copy link
Contributor

It isn't a cmake flag perse,

See this blog post:
https://aws.amazon.com/blogs/developer/using-cmake-exports-with-the-aws-sdk-for-c/

This will make your life much easier, and we updated this for this very reason.

If you are manually handling your builds (e.g. invoking gcc directly) you need to pass -DAWS_CUSTOM_MEMORY_MANAGEMENT=0 as a compiler flag to the build of YOUR application.

@JonathanHenson
Copy link
Contributor

wait, did you explictly turn custom memory management off? Or did you not specify it? It is on by default, in that case you need to pass -DAWS_CUSTOM_MEMORY_MANAGEMENT=1 to your compiler. As before the blog post I linked will make this problem invisible to you.

@shuzhang1989
Copy link
Author

I didn't write custom memory management and i hope it can use the default STL based solution. I tried to rebuild using cmake, it showed me:
Custom memory management enabled; stl objects now using custom allocators
So the question is how should can i turn it off? -DAWS_CUSTOM_MEMORY_MANAGEMENT=0 doesn't work in cmake case, here is my cmake command:

cmake -DCMAKE_BUILD_TYPE=Release -DAWS_CUSTOM_MEMORY_MANAGEMENT=0 .

@shuzhang1989
Copy link
Author

Okay, figured out how to turn this off - by passing -DCUSTOM_MEMORY_MANAGEMENT :)

krzysztof-trzepla added a commit to krzysztof-trzepla/aws-sdk-cpp that referenced this issue May 21, 2016
1f79408 Fix path to docker script in ct_run.
7d25b62 Merge commit 'ca2c63cb741a566f3ac6002a02c7dc68261b1e3b' into feature/merge-storage-helpers-functionality
ca2c63c Squashed 'bamboos/' changes from 5b55a72..69ff95b
c632173 Merge commit '327b2bc8582e88c300e225b7a66e24e61c838c9d' into feature/merge-storage-helpers-functionality
327b2bc Squashed 'clproto/' changes from 9f6d8c3..029c696
187dc43 Squashed 'bamboos/' changes from 7f7692e..5b55a72
e849607 Merge commit '187dc437339facf96cb41a22f96a71931694da5f' into feature/merge-storage-helpers-functionality
c28e567 Merge branch 'feature/VFS-1527-set-open-flags-in-open' of ssh://git.plgrid.pl:7999/vfs/helpers into feature/merge-storage-helpers-functionality
d441011 Merge branch 'feature/VFS-1484-better-client-configuration-on-mounting' of ssh://git.plgrid.pl:7999/vfs/helpers into feature/merge-storage-helpers-functionality
02eb1da Merge branch 'feature/VFS-1472-create-s3-storage-helper' of ssh://git.plgrid.pl:7999/vfs/helpers into feature/merge-storage-helpers-functionality
a6647c8 Merge pull request aws#155 in VFS/helpers from feature/VFS-1563-add-gdb-flag-to-client-s-ct_run.py to develop
cb14be5 VFS-1563 Add --gdb flag to ct_run.py .
ed62659 VFS-1472 Add documentation.
3718869 VFS-1527 Add flags to mknod and open operations.
891b85c Merge pull request aws#151 in VFS/helpers from feature/VFS-1428-support-for-multi-storage-types to develop
REVERT: 5822b42 VFS-1527 Add flags to mknod and open operations.

git-subtree-dir: helpers
git-subtree-split: 1f794085d2ac429d50358c6a18ba298ae8a81f6f
cobookman pushed a commit to cobookman/aws-sdk-cpp that referenced this issue Jan 17, 2022
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