Re: [osol-discuss] Tracing programs on opensolaris

2009-07-12 Thread Henry Pepper
I'm under the impression that dtrace is read-only, for security reasons.

On Sat, Jul 11, 2009 at 4:50 PM, Rafael Cunha de
Almeidaalmeida...@gmail.com wrote:
 Hello,

 I have been studying ptrace(2) on the Unix systems (I have studied it on
 Debian and OpenBSD so far). On all the systems I have tried there is a
 request flag that allows for a given process to attach itself to some
 other running process (given that other process is not setuid and has
 the same uid as the attacher). Opensolaris' manual pages doesn't say
 anything about such a request.

 Opensolaris' ptrace(3C) manual page says that ptrace isn't even a system
 call in solaris. It is build using some /proc interface. Further
 investigation showed me that gdb is able to attach itself to a running
 process (actually, two gdbs are able to attach itself to the same
 process, something that's impossible on Linux and OpenBSD). Where can I
 read up on that /proc interface? So, it allows for more than one process
 attach to a single process?

 On a related topic, is it possible to change the behaviour of programs
 using dtrace (like you can with ptrace) or is it read-only? Does it use
 those /proc features as well?
 ___
 opensolaris-discuss mailing list
 opensolaris-discuss@opensolaris.org

___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] Tracing programs on opensolaris

2009-07-12 Thread Casper . Dik
I have been studying ptrace(2) on the Unix systems (I have studied it on
Debian and OpenBSD so far). On all the systems I have tried there is a
request flag that allows for a given process to attach itself to some
other running process (given that other process is not setuid and has
the same uid as the attacher). Opensolaris' manual pages doesn't say
anything about such a request.

Ptrace is dead in Solaris; truss doesn't use ptrace neither does
mdb/dbx.

Opensolaris' ptrace(3C) manual page says that ptrace isn't even a system
call in solaris. It is build using some /proc interface. Further
investigation showed me that gdb is able to attach itself to a running
process (actually, two gdbs are able to attach itself to the same
process, something that's impossible on Linux and OpenBSD). Where can I
read up on that /proc interface? So, it allows for more than one process
attach to a single process?

See proc(4).  You open the appropriate files under /proc/pid,
particularly, ctl and /proc/pid/lwp/tid/lwpctl

On a related topic, is it possible to change the behaviour of programs
using dtrace (like you can with ptrace) or is it read-only? Does it use
those /proc features as well?

Use /proc which doesn't require any privileges; dtrace, especially when 
you want to modify data, requires privileges.

Modifying data is easy through the as file; to change registers you'll
need to write a specific control message.

Casper

___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


[osol-discuss] Tracing programs on opensolaris

2009-07-11 Thread Rafael Cunha de Almeida
Hello,

I have been studying ptrace(2) on the Unix systems (I have studied it on
Debian and OpenBSD so far). On all the systems I have tried there is a
request flag that allows for a given process to attach itself to some
other running process (given that other process is not setuid and has
the same uid as the attacher). Opensolaris' manual pages doesn't say
anything about such a request.

Opensolaris' ptrace(3C) manual page says that ptrace isn't even a system
call in solaris. It is build using some /proc interface. Further
investigation showed me that gdb is able to attach itself to a running
process (actually, two gdbs are able to attach itself to the same
process, something that's impossible on Linux and OpenBSD). Where can I
read up on that /proc interface? So, it allows for more than one process
attach to a single process?

On a related topic, is it possible to change the behaviour of programs
using dtrace (like you can with ptrace) or is it read-only? Does it use
those /proc features as well?
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org