NetBSD-Bugs archive

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

Re: kern/41076: sigwaitinfo and sigtimedwait don't properly set siginfo



matteo%beccati.com@localhost said:
>  si_pid and si_uid should be set when si_code == SI_USER (== 0)

There is a bug in the kernel - the appended patch fixes it
for -current. I'm assuming that the code looks similar
in 4.0 - can you give it a try?

> si_sigval should be set when si_code == SI_TIMER (== -2)

It says it is set to the value of timer_create. You didn't
use timer_create... If you modify your test program to do:

timer_t tid;
struct itimerspec to;
timer_create(CLOCK_REALTIME, 0, &tid);
printf("timer=%d\n", tid);
memset(&to, 0, sizeof to);
to.it_value.tv_sec = 2;
timer_settime(tid, TIMER_RELTIME, &to, 0);

you'll see that it works. At least it does in -current.

best regards
Matthias





-------------------------------------------------------------------
-------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich

Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr. Harald Bolt,
Dr. Sebastian M. Schmidt
-------------------------------------------------------------------
-------------------------------------------------------------------
#
# old_revision [41ea70456886a52c1c72a5950be895a5bb5994a9]
#
# patch "sys/kern/kern_sig.c"
#  from [58c4b0b2d0b7f723528f92694e187ef246b1d96b]
#    to [f74ec2cbcddb2e978482f54a8b9b64652de4345d]
#
============================================================
--- sys/kern/kern_sig.c 58c4b0b2d0b7f723528f92694e187ef246b1d96b
+++ sys/kern/kern_sig.c f74ec2cbcddb2e978482f54a8b9b64652de4345d
@@ -549,14 +549,12 @@ out:
 /*
  * sigput:
  * 
- *     Append a new ksiginfo element to the list of pending ksiginfo's, if
- *     we need to (e.g. SA_SIGINFO was requested).
+ *     Append a new ksiginfo element to the list of pending ksiginfo's.
  */
 void
 sigput(sigpend_t *sp, struct proc *p, ksiginfo_t *ksi)
 {
        ksiginfo_t *kp;
-       struct sigaction *sa = &SIGACTION_PS(p->p_sigacts, ksi->ksi_signo);
 
        KASSERT(mutex_owned(p->p_lock));
        KASSERT((ksi->ksi_flags & KSI_QUEUED) == 0);
@@ -564,11 +562,9 @@ sigput(sigpend_t *sp, struct proc *p, ks
        sigaddset(&sp->sp_set, ksi->ksi_signo);
 
        /*
-        * If there is no siginfo, or is not required (and we don't add
-        * it for the benefit of ktrace, we are done).
+        * If there is no siginfo, we are done.
         */
-       if (KSI_EMPTY_P(ksi) ||
-           (!KTRPOINT(p, KTR_PSIG) && (sa->sa_flags & SA_SIGINFO) == 0))
+       if (KSI_EMPTY_P(ksi))
                return;
 
        KASSERT((ksi->ksi_flags & KSI_FROMPOOL) != 0);


Home | Main Index | Thread Index | Old Index