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 #1

Closed
ghost opened this issue Feb 15, 2013 · 6 comments
Closed

Memory leak #1

ghost opened this issue Feb 15, 2013 · 6 comments

Comments

@ghost
Copy link

ghost commented Feb 15, 2013

[sanity.c:252]: (error) Memory leak: apic_ids
[sanity.c:252]: (error) Memory leak: apic_copy

@ghost ghost closed this as completed Feb 16, 2013
tycho added a commit that referenced this issue Feb 16, 2013
This resolves issue #1.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
@tycho
Copy link
Owner

tycho commented Feb 16, 2013

Not sure why this issue was closed so quickly. I've just committed a fix in a332865.

@ghost
Copy link
Author

ghost commented Feb 16, 2013

hm.. interesting

[sanity.c:246]: (error) Deallocating a deallocated pointer: apic_ids
[sanity.c:247]: (error) Deallocating a deallocated pointer: apic_copy

@tycho
Copy link
Owner

tycho commented Feb 16, 2013

Oh. Oops. It was freed already after those for loops... How were these "leaks" detected?

@ghost
Copy link
Author

ghost commented Feb 16, 2013

@tycho

$ cd cpuid-master
$ cppcheck --enable=performance -v . 2> performance.log
$ cat performance.log

Debug mode:

[sanity.c:246]: (error) Deallocating a deallocated pointer: apic_ids
[sanity.c:247]: (error) Deallocating a deallocated pointer: apic_copy
[sanity.c:126]: (debug) inconclusive leak of apic_state: ; assign ; alloc ; loop use ; dealloc ; return ; }
[sanity.c:128]: (debug) inconclusive leak of busy_workers: ; assign ; alloc ; loop use ; dealloc ; return ; }
[sanity.c:129]: (debug) inconclusive leak of apic_workers: ; assign ; alloc ; loop use ; dealloc ; return ; }

@tycho
Copy link
Owner

tycho commented Feb 16, 2013

I looked more closely at the codepath. The 'goto cleanup' skips over the deallocations if there's duplicate APIC IDs. I've fixed it up.

@ghost
Copy link
Author

ghost commented Feb 16, 2013

@tycho, Thanks FixIt.

This issue was closed.
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

1 participant