On Sat, Jun 25, 2022 at 10:33:22PM +0000, Horia Mihai David wrote:
> Hi all,
> 
> I don't know if this is intended.
> 
> On my system, Linux 5.13 x86_64 (Ubuntu focal) in the interpreter, if I run
> `see' on a builitn word like this:
> 
> ```
> see +
> ```
> 
> The internreter outputs a single line
> 
> ```
> Code +
> ```
> 
> and then it hangs indefinitely until I press Ctrl+D, at which point it
> outputs:
> 
> ```
>    0x7b41880c:        /tmp/gforthdis.clzuXXqIjL:4: Error in sourced command 
> file:
> Cannot access memory at address 0x7b41880c
> quit
> end-code
>  ok
> ```
> 
> and the interpreter continues running normally, waiting for a new line.
> 
> If the gforth process is run as root, this issue doesn't happen, it outputs
> the disassembly of the word.

Thanks for the report and the digging and sorry for answering so late
(I was busy at the end of June, and apparently so was everyone else).
I have now written up the problem, it's fix, and some more on

http://www.complang.tuwien.ac.at/forth/gforth/Known-problems.html#ptrace

In short, you can make SEE work as intended by doing

sudo sysctl kernel.yama.ptrace_scope=0

and to avoid having to do that after every reboot, edit (as root)
/etc/sysctl.d/10-ptrace.conf to contain

kernel.yama.ptrace_scope = 0

(and no other setting of that variable).

- anton

Reply via email to