简体   繁体   中英

How to detect the thread which is writing to a stack address?

I am seeing value of the variable passed to a function is becoming null after returning from the function. The variable is pushed to the stack and while returning the same is pop. Do we have a way to find the culprit thread ? Can i protect the that stack location ? i did check the assembly and dont see any offset to rbp which may change stack ?

push   %rbp
mov    %rsp,%rbp
push   %rbx

.....................



add    $0x8,%rsp
pop    %rbx
leaveq

I think the operating system should be protecting your process from any other process messing with it's memory. Are you certain you don't have memory corruption within your program? Do you have multiple threads? Those are more likely culprits than another rogue process.

Just debug the program normally. You're trying to make things much harder than they need to be.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM