On Mon, Oct 6, 2008 at 2:10 AM, Mike Shapiro <[EMAIL PROTECTED]> wrote:
> On Sun, Oct 05, 2008 at 10:17:27PM -0700, Adam Leventhal wrote:
>> > Without the Prelease() call, a process is killed if its pid is fed to
>> > this program.  With the Prelease() call, a process continues to run.
>>
>>
>> Doing a little DTrace investigation, I see that we unset PR_KLC in
>> Prelease() from restore_tracing_flags(). Here's the invocation I used:
>>
>> # dtrace -c '/usr/sbin/i86/dtrace -n agsajg -c date' -n 'pid
>> $target::P*setflags:entry{ printf("%x", arg1); }' -Z
>>
>> Perhaps fixing this would be as simple as passing PRELEASE_KILL as the
>> flag parameter to Prelease().
>>
>> Adam
>
> Yes.  Basically this:
>
>     } else {
>                dt_dprintf("releasing pid %d\n", (int)dpr->dpr_pid);
>                rflag = 0; /* apply kill or run-on-last-close */
>     }
>
> should be this:
>
>     } else if (Pstatus(dpr->dpr_proc)->pr_flags & PR_KLC) {
>                dt_dprintf("killing pid %d\n", (int)dpr->dpr_pid);
>                rflag = PRELEASE_KILL; /* apply kill-on-last-close */
>     } else {
>                dt_dprintf("releasing pid %d\n", (int)dpr->dpr_pid);
>                rflag = 0; /* apply run-on-last-close */
>     }

Yep, that was what I'd originally intended to do, but the comment
seemed to indicate that something else was assumed to be going on, and
that something else didn't match what I was seeing.  I was wondering
if the bug were here in libdtrace, or if there was an underlying bug
in libproc or procfs related to Prelease().  (And it must have been a
momentary bit of blindness that I didn't notice the
restore_tracing_flags() call.)

Thanks,
Chad
_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to