ggerganov / ggml

Tensor library for machine learning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to attach with GDB when hitting GGML_ASSERT after backend v2 changes

YavorGIvanov opened this issue · comments

I use VS Code to debug a program through the Remote - SSH plugin with GDB. After this change:
image

made in this PR #586 I am getting the bellow message, when I hit a ggml assert and gdb is unable to attach to the process.

GGML_ASSERT: /path/ggml/src/ggml-backend.c:56: false
Could not attach to process.  If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf
warning: process 30496 is already traced by process 30490
ptrace: Operation not permitted.
No stack.

If I replace ggml_print_backtrace(); with abort() it works as before (attaching with gdb as expected)

Does this cause any issues? It's just meant to show a backtrace as a debugging aid, it is ok if in some cases it cannot be shown.

The exit call was already replaced with abort in the llama.cpp repo, so that will be fixed on the next sync.

The only issue was that the debugger didn't stop and let me inspect the program state due to the missing abort() call. As you mention that exit is replaced with abort in llama.cpp -> I am closing this.

Will likely sync after #625 is merged