[Bug 285811] Debuggers in jail can't evaluate string literals

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 31 Mar 2025 16:04:44 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=285811

            Bug ID: 285811
           Summary: Debuggers in jail can't evaluate string literals
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: arrowd@FreeBSD.org

The following simple testcase fails when ran in jail, but works outside:

# gdb /bin/cat
(gdb) run
...
^C
(gdb) print (char*)"asd"
Cannot access memory at address 0x7fffffffe45f

Interestingly, the address looks completely different in the prison 0:

(gdb) print (char*)"asd"
$2 = 0x801608028 "asd"

I first thought it is a gdb-specific problem, but it seems that lldb also
suffers from it. The only difference is much less clear error message:

(lldb) print (char*)"asd"
error: Can't evaluate the expression without a running target due to:
Interpreter doesn't handle one of the expression's operands

-- 
You are receiving this mail because:
You are the assignee for the bug.