Page 1 of 1

can single step as root but debugger halts if not root

Posted: Mon May 29, 2017 6:47 am
by tootall79@gmail.com
codelite 10 on freebsd 11 all working great if logged in as root. cannot start LLDB thread when logged in as tim. When logged in as tim
codelite works FINE in all other ways except single step debug. Projects compiles and run both release and debug and perform as designed.

Here is debug log for WORKING, followed by NOT WORKING
WORKING
here I am logged in as root
[18:25:04:344 DBG] codelite-lldb: running debugger. tty=/tmp/pts6
[18:25:04:344 DBG] codelite-lldb: target working directory is set to: /media/FATSD29/Houston/wkspc/free/dev/clangCon/Debug
[18:25:04:344 DBG] codelite-lldb: Arguments are set to:
[18:25:04:344 DBG] codelite-lldb: LLDBHandlerThread: eStateLaunching
[18:25:04:344 DBG] codelite-lldb: LLDBHandlerThread: eStateLaunching
[18:25:04:345 DBG] codelite-lldb: LLDBHandlerThread: eStateStopped - first time
[18:25:04:345 DBG] codelite-lldb: NotifyRunning. Target Process ID 5397
[18:25:04:345 DBG] codelite-lldb: NotifyStoppedOnFirstEntry()
[18:25:04:345 DBG] CODELITE>> Applying breakpoints...
[18:25:04:345 DBG] CODELITE>> continue...
from here single stepping works as expected.

NOT WORKING
here I am logged in as tim
[18:36:28:321 DBG] codelite-lldb: running debugger. tty=/tmp/pts4
[18:36:28:321 DBG] codelite-lldb: target working directory is set to: /media/FATSD29/Houston/wkspc/fbsd/SingleStepFix/clangConsole/Debug
[18:36:28:321 DBG] codelite-lldb: Arguments are set to:
[18:36:28:321 DBG] codelite-lldb: error while launching process. process launch failed: Child ptrace failed.
[18:36:28:321 DBG] codelite-lldb: NotifyExited called
[18:36:29:118 DBG] codelite: ClearBreakpointDeletionQueue called
[18:36:29:118 DBG] codelite: InvalidateBreakpoints called
[18:36:29:170 DBG] ZombieReaperPOSIX: process 5509 exited with status code 9

thanks for any suggestions!
tim

Re: can single step as root but debugger halts if not root

Posted: Mon May 29, 2017 3:39 pm
by eranif
It looks like that the normal user has no permissions to ptrace the debugee process.
See similar questions asked on Stack Overflow: https://stackoverflow.com/questions/206 ... -to-attach

Re: can single step as root but debugger halts if not root

Posted: Tue May 30, 2017 9:39 pm
by tootall79@gmail.com
Hi Eran, thanks! I had system hardening turned on, and it can be reversed easily enough

https://forums.freebsd.org/threads/59604/

codelite is GREAT! :D https://forums.freebsd.org/threads/59604/

SOLVED but I don't see how to officially mark it.