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

Segmentation fault on info level logging #45

Closed
aufarg opened this issue Oct 14, 2018 · 0 comments · Fixed by #47
Closed

Segmentation fault on info level logging #45

aufarg opened this issue Oct 14, 2018 · 0 comments · Fixed by #47

Comments

@aufarg
Copy link

aufarg commented Oct 14, 2018

Hello,

I'm trying to run hello on the test directory with mallocwatch.so and info level logging. It gave me segmentation fault.

$ LD_PRELOAD=x86_64-pc-linux-gnu/mallocwatch.so PREENY_INFO=1 tests/hello
[1]    6269 segmentation fault (core dumped)  LD_PRELOAD=x86_64-pc-linux-gnu/mallocwatch.so PREENY_INFO=1 tests/hello

But running without PREENY_INFO=1 results in successful execution.

$ LD_PRELOAD=x86_64-pc-linux-gnu/mallocwatch.so tests/hello 
Hello world!

After some code modification on mallocwatch.c and logging.c, I found that it's because it segfaults because it tries to call vprintf and printf from libc. Removing the vprintf and printf from preeny_info works (without logging too). I'm not sure why though.

$ gcc -v
gcc (GCC) 8.2.1 20180831
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ ldd --version
ldd (GNU libc) 2.28
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
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

Successfully merging a pull request may close this issue.

1 participant