gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

see command fails for assembly words if gforth not run as root


From: Horia Mihai David
Subject: see command fails for assembly words if gforth not run as root
Date: Sat, 25 Jun 2022 22:33:22 +0000

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.



The following might help a bit.

After digging a bit (and in my limted knowledge of forth) I saw that while gforth is hanging, it is likely waiting for system to return after invoking a gdb process to actually perform the disassembly, since the following process can be seen in the output of ps: user 14905 2.0 0.0 35928 21520 pts/0 S+ 00:22 0:00 gdb -nx -q -p 14881 -x /tmp/gforthdis.8zOVr0pZEX

the file under tmp contains the gdb commands that gforth gives gdb and look like this on my system:

```
set verbose off
set logging file /tmp/gforthdis.G5TD0TNpba
set logging on
disas 0x56007B41880C,0x56007B418832
set logging off
quit
```

I believe this functionality is implemented in dis-gdb.fs source file from gforth.




Thanks,
- Horia Mihai David (hMihaiDavid)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]