-
Notifications
You must be signed in to change notification settings - Fork 168
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
feat: Any type with configurable small buffer optimization #1695
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1695 +/- ##
==========================================
+ Coverage 49.07% 49.28% +0.20%
==========================================
Files 397 398 +1
Lines 21606 21787 +181
Branches 9829 9884 +55
==========================================
+ Hits 10604 10737 +133
- Misses 4188 4201 +13
- Partials 6814 6849 +35
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
📊 Physics performance monitoring for ede16adFull report VertexingSeedingCKFAmbiguity resolutionTruth tracking (Kalman Filter)Truth tracking (GSF) |
I ran valgrind on the unit tests which indicates I'm not leaking memory: $ valgrind --tool=memcheck bin/ActsUnitTestAny
==3104117== Memcheck, a memory error detector
==3104117== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==3104117== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==3104117== Command: bin/ActsUnitTestAny
==3104117==
Running 8 test cases...
*** No errors detected
==3104117==
==3104117== HEAP SUMMARY:
==3104117== in use at exit: 0 bytes in 0 blocks
==3104117== total heap usage: 13,141 allocs, 13,141 frees, 5,494,543 bytes allocated
==3104117==
==3104117== All heap blocks were freed -- no leaks are possible
==3104117==
==3104117== For lists of detected and suppressed errors, rerun with: -s
==3104117== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) For some reason, heaptrack thinks there is a memory leak, however: $ heaptrack bin/ActsUnitTestAny
heaptrack output will be written to "/home/pagessin/dev/acts/build/heaptrack.ActsUnitTestAny.3104211.gz"
starting application, this might take some time...
Running 8 test cases...
*** No errors detected
free(): invalid pointer
Aborted (core dumped)
heaptrack stats:
allocations: 13141
leaked allocations: 376
temporary allocations: 10044
Heaptrack finished! Now run the following to investigate the data: |
c0704d8
to
3359f8c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite impressive work I would say! Just some minor comments, nothing critical...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went through this and it's not immediately obvious to me why an invalid free is observed in the heaptrack case, but have a few comments anyway.
For context, I spotted what's going on in the heaptrack test above. Notice how the test output changes from...
...in the valgrind case to...
...in the heaptrack case. What this means is that the memory allocator is bombing on us in the heaptrack case, hinting at some possible misuse of it. And obviously, an app that crashes does not free all of its allocations... |
Ok I think I addressed all comments. heaptrack is still unhappy, valgrind is. With this caveat, should we move forward with this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is now in a pretty good shape. Please consider this last round of suggestions, and then ping me back once the doxygen is done for final approval.
When I run heaptrack on a standalone executable, it reports this |
My previous advice to throw a debugger at this still stands :) |
I ran with a debugger, the stack trace looks to me like the abort comes from inside heaptrack code. There's a non-zero chance that this is because of some memory corruption, but the fact that if I run heaptrack on any binary I get the same abort, and also valgrind is happy gives me some confidence that there is no memory corruption happening. |
No description provided.