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

memory leak detected by address sanitizer #96

Closed
chipitsine opened this issue May 9, 2019 · 6 comments
Closed

memory leak detected by address sanitizer #96

chipitsine opened this issue May 9, 2019 · 6 comments
Labels
severity: minor This issue is of MINOR severity. status: fixed This issue is a now-fixed bug. subsystem: mworker This issue is within the master-worker subsystem. type: bug This issue describes a bug.

Comments

@chipitsine
Copy link
Member

full log:

https://travis-ci.com/chipitsine/haproxy-1/jobs/198816193

leak

***  h1    0.1 debug|=================================================================
***  h1    0.1 debug|==5924==ERROR: LeakSanitizer: detected memory leaks
***  h1    0.1 debug|
***  h1    0.1 debug|Direct leak of 1 byte(s) in 1 object(s) allocated from:
***  h1    0.1 debug|    #0 0x4c74dd in __strdup /tmp/final/llvm.src/projects/compiler-rt/lib/asan/asan_interceptors.cc:463:3
***  h1    0.1 debug|    #1 0x91fb22 in mworker_env_to_proc_list /home/travis/build/chipitsine/haproxy-1/src/mworker.c:179:17
***  h1    0.1 debug|
***  h1    0.1 debug|SUMMARY: AddressSanitizer: 1 byte(s) leaked in 1 allocation(s).
@chipitsine chipitsine added status: needs-triage This issue needs to be triaged. type: bug This issue describes a bug. labels May 9, 2019
@TimWolla TimWolla added dev This issue affects the HAProxy development branch. status: reviewed This issue was reviewed. A fix is required. subsystem: mworker This issue is within the master-worker subsystem. and removed status: needs-triage This issue needs to be triaged. labels May 13, 2019
@TimWolla
Copy link
Member

I proposed a patch for this on the list: https://www.mail-archive.com/haproxy@formilux.org/msg33745.html

@chipitsine
Copy link
Member Author

I'll run tests with sanitizer soon

@chipitsine
Copy link
Member Author

I tested, everything is ok

@chipitsine
Copy link
Member Author

chipitsine commented May 14, 2019

I've rebased to current master, enabled address sanitizer and built:

https://travis-ci.org/chipitsine/haproxy-1/jobs/532472001#L2448-L2454

https://travis-ci.org/chipitsine/haproxy-1/builds/532471995

still leaks

@TimWolla
Copy link
Member

still leaks

Yes, because my memory-leak patch has not yet been applied.

@chipitsine
Copy link
Member Author

Sorry, I saw some discussion on mailing list. I thought similar patch was applied, but I was wrong

haproxy-mirror pushed a commit that referenced this issue May 22, 2019
The struct mworker_proc is not uniformly freed everywhere, sometimes leading
to leaks of the `id` string (and possibly the other strings).

Introduce a mworker_free_child function instead of duplicating the freeing
logic everywhere to prevent this kind of issues.

This leak was reported in issue #96.

It looks like the leaks have been introduced in commit 9a1ee7a,
which is specific to 2.0-dev. Backporting `mworker_free_child` might be
helpful to ease backporting other fixes, though.
@TimWolla TimWolla added status: fixed This issue is a now-fixed bug. severity: minor This issue is of MINOR severity. and removed dev This issue affects the HAProxy development branch. status: reviewed This issue was reviewed. A fix is required. labels May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity: minor This issue is of MINOR severity. status: fixed This issue is a now-fixed bug. subsystem: mworker This issue is within the master-worker subsystem. type: bug This issue describes a bug.
Projects
None yet
Development

No branches or pull requests

2 participants