-
Notifications
You must be signed in to change notification settings - Fork 75
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
BUG: miss breakpoint for multi-thread program #38
Comments
Maybe I could study how GDB works later. |
Hello Wu, I would like to share you my quick & dirty fix for multi-thread related issue. 00028850 : Since these breakpoints will never be removed, there is no chance of any race-condition to happen. On the other hand, I changed the main loop to stay for several seconds to handling waitpid() returned events after remove all breakpoints. It seems to remedy the multi-thread program detach problem. |
Sounds like a good idea. Have you tried this?
|
Wu, thanks for your great tools. I ported the tool to MIPS32 little-endian OpenWRT based platform. Meanwhile, the insertion of the 2nd breakpoint could/shall also be avoided.
I believed that insert breakpoint in the return address is somewhat dangerous. |
Great! I will try this later too. I am not familiar with debugger tech or assembly instructions. I just write memleax with basic knowledge from school, so there should be a lot room for improvement. |
BTW, I write another tool to detect memory leak libleak.
You may try it. |
Steps:
malloc
andfree
at beginning;free
;free
, and deletes the breakpoint at the entry of free temporarily to let the thread continue;free
now, memleax will miss it because the breakpoint is deleted!!! Then this memory block record will live for ever in memleax, and will be considered as a memory leak.Similarly, if this happens at
malloc
, we will miss a memory block allocation.The text was updated successfully, but these errors were encountered: