Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

none/tests/pth_2sig hangs at exit with 100% cpu utilization #189

Closed
nbriggs opened this issue May 20, 2022 · 39 comments
Closed

none/tests/pth_2sig hangs at exit with 100% cpu utilization #189

nbriggs opened this issue May 20, 2022 · 39 comments

Comments

@nbriggs
Copy link

nbriggs commented May 20, 2022

I suspect this is FreeBSD specific.

I've attached the output with syscall and signal traces turned on. It's 100% reproducible.

Code is at 2dad922.
pth_2sig-hangs.txt

@paulfloyd
Copy link
Owner

paulfloyd commented May 20, 2022

That is really really late in the execution. The guest has exited and I expect that Valgrind is cleaning up - closing files and pipes created for gdb.

Does running with -v -v -v -v -d -d -d -d add anything of use at the end?

I don't see this hang on 13.0 and 13.1 in a VirtualBox x86 VM.

@nbriggs
Copy link
Author

nbriggs commented May 20, 2022

It adds:

==2005== LEAK SUMMARY:
==2005==    definitely lost: 0 bytes in 0 blocks
==2005==    indirectly lost: 0 bytes in 0 blocks
==2005==      possibly lost: 0 bytes in 0 blocks
==2005==    still reachable: 13,904 bytes in 22 blocks
==2005==         suppressed: 0 bytes in 0 blocks
==2005== Rerun with --leak-check=full to see details of leaked memory
==2005== 
==2005== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)
--2005-- 
--2005-- used_suppression:      2 MEMCHECK-RTLD-COND /home/briggs/valgrind/./.in_place/default.supp:571
==2005== 
==2005== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)
--2005:1:  gdbsrv VG core calling VG_(gdbserver_exit) tid 1 will exit
--2005:1:  gdbsrv not connected
--2005:1:  gdbsrv VG_(gdbserver) called to terminate, nothing to terminate
--2005:1: core_os VG_(terminate_NORETURN)(tid=1) schedretcode VgSrc_ExitThread os_state.exit_code 0 fatalsig 0

@nbriggs
Copy link
Author

nbriggs commented May 20, 2022

The truss output looks very weird...

 2021: thr_self(0x52be10c)			 = 0 (0x0)
 2021: thr_self(0x52be0cc)			 = 0 (0x0)
 2021: write(26803,"C",1)			 = 1 (0x1)
 2021: sched_yield()				 = 0 (0x0)
 2021: thr_self(0x52be0c8)			 = 0 (0x0)
 2021: read(26802,"C",1)			 = 1 (0x1)
 2021: sigprocmask(SIG_SETMASK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 }) = 0 (0x0)
 2021: sigtimedwait({ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },0x52be0ec,{ 0.000000000 }) ERR#35 'Resource temporarily unavailable'
 2021: sigprocmask(SIG_SETMASK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },0x0) = 0 (0x0)
 2021: thr_self(0x52be10c)			 = 0 (0x0)
 2021: thr_self(0x52be0cc)			 = 0 (0x0)
 2021: write(26803,"D",1)			 = 1 (0x1)
 2021: sched_yield()				 = 0 (0x0)
 2021: thr_self(0x52be0c8)			 = 0 (0x0)
 2021: read(26802,"D",1)			 = 1 (0x1)
 2021: sigprocmask(SIG_SETMASK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 }) = 0 (0x0)
 2021: sigtimedwait({ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },0x52be0ec,{ 0.000000000 }) ERR#35 'Resource temporarily unavailable'
 2021: sigprocmask(SIG_SETMASK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },0x0) = 0 (0x0)
 2021: thr_self(0x52be10c)			 = 0 (0x0)
 2021: thr_self(0x52be0cc)			 = 0 (0x0)
 2021: write(26803,"E",1)			 = 1 (0x1)
 2021: sched_yield()				 = 0 (0x0)
 2021: thr_self(0x52be0c8)			 = 0 (0x0)
 2021: read(26802,"E",1)			 = 1 (0x1)
 2021: sigprocmask(SIG_SETMASK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 }) = 0 (0x0)
 2021: sigtimedwait({ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },0x52be0ec,{ 0.000000000 }) ERR#35 'Resource temporarily unavailable'
 2021: sigprocmask(SIG_SETMASK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },0x0) = 0 (0x0)
 2021: thr_self(0x52be10c)			 = 0 (0x0)
 2021: thr_self(0x52be0cc)			 = 0 (0x0)
 2021: write(26803,"F",1)			 = 1 (0x1)
 2021: sched_yield()				 = 0 (0x0)
 2021: thr_self(0x52be0c8)			 = 0 (0x0)
 2021: read(26802,"F",1)			 = 1 (0x1)
 2021: sigprocmask(SIG_SETMASK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 }) = 0 (0x0)
 2021: sigtimedwait({ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },0x52be0ec,{ 0.000000000 }) ERR#35 'Resource temporarily unavailable'
 2021: sigprocmask(SIG_SETMASK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },0x0) = 0 (0x0)
 2021: thr_self(0x52be10c)			 = 0 (0x0)
 2021: thr_self(0x52be0cc)			 = 0 (0x0)
 2021: write(26803,"G",1)			 = 1 (0x1)
 2021: sched_yield()				 = 0 (0x0)
 2021: thr_self(0x52be0c8)			 = 0 (0x0)
 2021: read(26802,"G",1)			 = 1 (0x1)
 2021: sigprocmask(SIG_SETMASK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 }) = 0 (0x0)
 2021: sigtimedwait({ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },0x52be0ec,{ 0.000000000 }) ERR#35 'Resource temporarily unavailable'
 2021: sigprocmask(SIG_SETMASK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },0x0) = 0 (0x0)
 2021: thr_self(0x52be10c)			 = 0 (0x0)
 2021: thr_self(0x52be0cc)			 = 0 (0x0)
 2021: write(26803,"H",1)			 = 1 (0x1)
 2021: sched_yield()				 = 0 (0x0)
 2021: thr_self(0x52be0c8)			 = 0 (0x0)
 2021: read(26802,"H",1)			 = 1 (0x1)
 2021: sigprocmask(SIG_SETMASK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 }) = 0 (0x0)
 2021^Z
zsh: suspended  truss -eaf ./vg-in-place none/tests/pth_2sig

@paulfloyd
Copy link
Owner

paulfloyd commented May 21, 2022

Another unexplored dark corner.

The reads and writes are from the scheduler, ML_(sema_up) and ML_(sema_down), reading and writing the global sema_char which increments from 'A' to 'Z' then wraps.

The last log message you get is from m_main.c line 2355

Presumably it is then calling VG_(client_exit)( VG_(threads)[tid].os_state.exitcode ); on line 2373 with exit code 0

That just calls exit_wrk with gdbserver_call_allowed False so it doesn't call any of the gdbserver functions.

I was thinking that it might be stuck in VG_(gdbserver_exit) but that doesn't appear to be the case.
So on to VG_(exit_now) (status);

That just does a syscall exit.

@paulfloyd
Copy link
Owner

Looking at the code

Does increasing the 2 second sleep change anything?

If you change this

    while (1)
        pause(); 

to

   while (1) {
      printf("parent wating to be killed\n");
      sleep(1);
   }

do you see this loop running as it hangs?

void *slavethread(void *arg)
{
    while (1)
        pause();
}

int main(int argc, char **argv)
{
    int i;
    for (i = 0; i < 10; i++) {
        pthread_t slave;
        if (pthread_create(&slave, 0, slavethread, 0)) {
            perror("pthread_create");
            exit(2);
        }
    }

    pid_t pid = getpid();
    switch (fork()) {
        case 0: // child
            sleep(2); // Should be enough to ensure (some) threads are created
            for (i = 0; i < 20 && kill(pid, SIGTERM) == 0; i++)
                ;
            exit(0);
        case -1:
            perror("fork");
            exit(4);
    }

    while (1)
        pause(); 
    fprintf(stderr, "strange, this program is supposed to be killed!\n");
    return 1;
}

What ought to happen

parent creates 10 threads that all suspend
fork
parent suspends
child sleeps for 2 secs, kills parent then exits

What I'm thinking is that the threads may be created but not started, and the TERM signals being sent to these non-started threads rather than the parent main thread. If all 20 kill()s in the child fail, that would mean that the child exits and the parent ends up in the pause().

Does it change things if SIGTERM is blocked for the parent threads, like this

    sigset_t set;
    sigemtyset(&set);
    sigaddset(&set, SIGTERM);
    for (i = 0; i < 10; i++) {
        pthread_t slave;
        if (pthread_create(&slave, 0, slavethread, &set)) {
            perror("pthread_create");
            exit(2);
        }

@nbriggs
Copy link
Author

nbriggs commented May 22, 2022

The first change has little effect -- you see all the messages, but then it hangs even harder than before, you can see the ctrl-T output. There's no way to kill it -- ssh'ing to the machine gets me the login banner, but then can't get to a shell, and of course dropping the ssh connection it was started on doesn't help. Time to hard power-cycle the system.

flap% valgrind ./pth_2sig
==13636== Memcheck, a memory error detector
==13636== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==13636== Using Valgrind-3.20.0.GIT and LibVEX; rerun with -h for copyright info
==13636== Command: ./pth_2sig
==13636== 
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
parent waiting to be killed
==13637== 
==13637== HEAP SUMMARY:
==13637==     in use at exit: 18,000 bytes in 23 blocks
==13637==   total heap usage: 23 allocs, 0 frees, 18,000 bytes allocated
==13637== 
==13637== LEAK SUMMARY:
==13637==    definitely lost: 0 bytes in 0 blocks
==13637==    indirectly lost: 0 bytes in 0 blocks
==13637==      possibly lost: 0 bytes in 0 blocks
==13637==    still reachable: 13,904 bytes in 22 blocks
==13637==         suppressed: 4,096 bytes in 1 blocks
==13637== Rerun with --leak-check=full to see details of leaked memory
==13637== 
==13637== For lists of detected and suppressed errors, rerun with: -s
==13637== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)
^Z
^C^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^C^C^C^C^C^C^Z^Z^Z^Z^Z^Z^Z^Z^C^C^C^C^C^Z^Z^Z^Z^Y^Y
load: 5.08  cmd: memcheck-x86-freebs 13636 [runnable] 172.15r 1.08u 166.19s 53% 28068k
mi_switch+0x143 critical_exit_preempt+0x51 intr_event_handle+0x13e intr_execute_handlers+0xb4 atpic_handle_intr+0x4a ratelimit_v6+0xe6149bf9 ll+0x7 
load: 5.08  cmd: memcheck-x86-freebs 13636 [runnable] 173.07r 1.08u 167.09s 53% 28068k
mi_switch+0x143 critical_exit_preempt+0x51 intr_event_handle+0x13e intr_execute_handlers+0xb4 atpic_handle_intr+0x4a ratelimit_v6+0xe6149bf9 ll+0x7 
load: 5.15  cmd: memcheck-x86-freebs 13636 [runnable] 174.66r 1.08u 168.66s 51% 28068k
mi_switch+0x143 critical_exit_preempt+0x51 intr_event_handle+0x13e intr_execute_handlers+0xb4 atpic_handle_intr+0x4a ratelimit_v6+0xe6149bf9 ll+0x7 
load: 5.30  cmd: memcheck-x86-freebs 13636 [runnable] 180.82r 1.08u 174.74s 52% 28068k
mi_switch+0x143 critical_exit_preempt+0x51 intr_event_handle+0x13e intr_execute_handlers+0xb4 atpic_handle_intr+0x4a ratelimit_v6+0xe6149bf9 ll+0x7 
load: 5.30  cmd: memcheck-x86-freebs 13636 [runnable] 181.34r 1.08u 175.26s 48% 28068k
mi_switch+0x143 critical_exit_preempt+0x51 intr_event_handle+0x13e intr_execute_handlers+0xb4 atpic_handle_intr+0x4a ratelimit_v6+0xe6149bf9 ll+0x7 
load: 5.30  cmd: memcheck-x86-freebs 13636 [runnable] 182.11r 1.08u 176.02s 53% 28068k
mi_switch+0x143 critical_exit_preempt+0x51 intr_event_handle+0x13e intr_execute_handlers+0xb4 atpic_handle_intr+0x4a ratelimit_v6+0xe6149bf9 ll+0x7 
load: 5.36  cmd: memcheck-x86-freebs 13636 [runnable] 184.36r 1.08u 178.24s 49% 28068k
mi_switch+0x143 critical_exit_preempt+0x51 intr_event_handle+0x13e intr_execute_handlers+0xb4 atpic_handle_intr+0x4a ratelimit_v6+0xe6149bf9 ll+0x7 
load: 5.36  cmd: memcheck-x86-freebs 13636 [runnable] 189.35r 1.08u 183.16s 49% 28068k
mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 pipe_read+0x3a5 dofileread+0x6d sys_read+0x67 syscall+0x179 ratelimit_v6+0xe61492ed 
load: 5.49  cmd: memcheck-x86-freebs 13636 [runnable] 190.42r 1.08u 184.22s 49% 28068k
mi_switch+0x143 critical_exit_preempt+0x51 intr_event_handle+0x13e intr_execute_handlers+0xb4 atpic_handle_intr+0x4a ratelimit_v6+0xe6149bf9 ll+0x7 
load: 5.49  cmd: memcheck-x86-freebs 13636 [runnable] 191.25r 1.08u 185.04s 53% 28068k
mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 pipe_read+0x3a5 dofileread+0x6d sys_read+0x67 syscall+0x179 ratelimit_v6+0xe61492ed 
load: 5.49  cmd: memcheck-x86-freebs 13636 [runnable] 191.90r 1.08u 185.68s 51% 28068k

@nbriggs
Copy link
Author

nbriggs commented May 22, 2022

Single-click of the power button initiates a shutdown, which times out after 90s, and then it attempts to go to single-user mode, but ends up powering off instead (at least on this hardware) The console is non-responsive except for displaying the messages. If one distilled what's happening in valgrind/pth_2sig one would have a pretty effective DoS attack from userland.

@paulfloyd
Copy link
Owner

paulfloyd commented May 22, 2022

For the hang, one thing that sometimes works for me is

ssh machine ps

to get the rogue process pid

ssh machine kill -9 pid

For the problem it looks like the client code is doing what it claims. The child is signalling the parent and I presume then calling exit() (unless it is stuck in kill). The parent is getting the signal and at least terminating the while/printf/sleep loop.

But the Valgrind scheduler is still running so something is refusing to die.

Issue #188 188 has somewhat similar symptoms, except that it is during execution rather than at cleanup.

@paulfloyd
Copy link
Owner

paulfloyd commented May 22, 2022

I just tried self-hosting on 13.0 and amd64

>==17347== Process terminating with default action of signal 15 (SIGTERM)
>==17347==    at 0x49C572A: _sigsuspend (in /lib/libc.so.7)
>==17347==    by 0x48769B5: ??? (in /lib/libthr.so.3)
>==17347==    by 0x4937884: pause (in /lib/libc.so.7)
>==17347==    by 0x201BC8: main (pth_2sig.c:39)
>==17347== 
>==17347== Process terminating with default action of signal 15 (SIGTERM)
>==17347==    at 0x49C572A: _sigsuspend (in /lib/libc.so.7)
>==17347==    by 0x48769B5: ??? (in /lib/libthr.so.3)
>==17347==    by 0x4937884: pause (in /lib/libc.so.7)
>==17347==    by 0x201BC8: main (pth_2sig.c:39)
>==17347== 
>==17347== Process terminating with default action of signal 15 (SIGTERM)
>==17347==    at 0x49C572A: _sigsuspend (in /lib/libc.so.7)
>==17347==    by 0x48769B5: ??? (in /lib/libthr.so.3)
>==17347==    by 0x4937884: pause (in /lib/libc.so.7)
>==17347==    by 0x201BC8: main (pth_2sig.c:39)
>==17347== 
>==17347== Process terminating with default action of signal 15 (SIGTERM)
>==17347==    at 0x49C572A: _sigsuspend (in /lib/libc.so.7)
>==17347==    by 0x48769B5: ??? (in /lib/libthr.so.3)
>==17347==    by 0x4937884: pause (in /lib/libc.so.7)
>==17347==    by 0x201BC8: main (pth_2sig.c:39)
>==17347== 
==17347== 
==17347== Process terminating with default action of signal 15 (SIGTERM)
==17347==    at 0x280BBE1C: ??? (in /usr/home/paulf/scratch/valgrind_inner/none/none-amd64-freebsd)
==17347==    by 0x280BBF0B: vgPlain_do_syscall (m_syscall.c:1153)
==17347==    by 0x280C0E6D: vgPlain_sigprocmask (m_libcsignal.c:224)
==17347==    by 0x280BE310: vgPlain_kill_self (m_signals.c:1665)
==17347==    by 0x281775DC: shutdown_actions_NORETURN (m_main.c:2382)
==17347==    by 0x281545A6: run_a_thread_NORETURN (syswrap-freebsd.c:210)
==17347==    by 0x381017C0: ??? (in /usr/home/paulf/tools/valgrind/libexec/valgrind/memcheck-amd64-freebsd)
==17347==    by 0x49C572A: _sigsuspend (in /lib/libc.so.7)
==17347==    by 0x48769B5: ??? (in /lib/libthr.so.3)
==17347==    by 0x4937884: pause (in /lib/libc.so.7)
==17347==    by 0x201BC8: main (pth_2sig.c:39)

Not sure why there are 5 SIGTERM messages. They all have the callstack of the main thread rather than the 10 slavethreads.

Gives some indication of what the exit path callstack looks lik.

@paulfloyd
Copy link
Owner

paulfloyd commented May 23, 2022

And for me on i386 running with -d I get (with some heavy editing to remove aspace and gdbserver messages)

What do you get, in particular the "last one standing" messages?

53714:1:    main Running thread 1
--53714:1:syswrap- entering VG_(main_thread_wrapper_NORETURN)
--53714:1:syswrap- run_a_thread_NORETURN(tid=1): pre-thread_wrapper
--53714:1:syswrap- thread_wrapper(tid=1): entry
--53714:1:syswrap- run_a_thread_NORETURN(tid=2): pre-thread_wrapper
--53714:1:syswrap- thread_wrapper(tid=2): entry
--53714:1:syswrap- run_a_thread_NORETURN(tid=3): pre-thread_wrapper
--53714:1:syswrap- thread_wrapper(tid=3): entry
--53714:1:syswrap- run_a_thread_NORETURN(tid=4): pre-thread_wrapper
--53714:1:syswrap- thread_wrapper(tid=4): entry
--53714:1:syswrap- run_a_thread_NORETURN(tid=5): pre-thread_wrapper
--53714:1:syswrap- thread_wrapper(tid=5): entry
--53714:1:syswrap- run_a_thread_NORETURN(tid=6): pre-thread_wrapper
--53714:1:syswrap- thread_wrapper(tid=6): entry
--53714:1:syswrap- run_a_thread_NORETURN(tid=7): pre-thread_wrapper
--53714:1:syswrap- thread_wrapper(tid=7): entry
--53714:1:syswrap- run_a_thread_NORETURN(tid=8): pre-thread_wrapper
--53714:1: aspacem allocated valgrind thread stack at 0x6c2a000 size 1064960
--53714:1:syswrap- thread_wrapper(tid=8): entry
--53714:1:syswrap- run_a_thread_NORETURN(tid=9): pre-thread_wrapper
--53714:1:syswrap- thread_wrapper(tid=9): entry
--53714:1:syswrap- run_a_thread_NORETURN(tid=10): pre-thread_wrapper
--53714:1:syswrap- thread_wrapper(tid=10): entry
--53714:1:syswrap- run_a_thread_NORETURN(tid=11): pre-thread_wrapper
--53714:1:syswrap- thread_wrapper(tid=11): entry
==53714== 
==53714== Process terminating with default action of signal 15 (SIGTERM)
--53714:1:mallocfr newSuperblock at 0x6F36000 (pszB 4194288)  owner VALGRIND/core
==53714==    at 0x605AD4F: _sigsuspend (in /lib/libc.so.7)
==53714==    by 0x5F30E76: ??? (in /lib/libthr.so.3)
==53714==    by 0x60591D8: sigsuspend (in /lib/libc.so.7)
==53714==    by 0x5FD552A: pause (in /lib/libc.so.7)
--53715:1:syswrap- thread_wrapper(tid=1): exit, schedreturncode VgSrc_ExitThread
==53714==    by 0x4019F9: main (pth_2sig.c:39)
--53715:1:syswrap- run_a_thread_NORETURN(tid=1): post-thread_wrapper
--53715:1:syswrap- run_a_thread_NORETURN(tid=1): last one standing
--53714:1:syswrap- thread_wrapper(tid=3): exit, schedreturncode VgSrc_FatalSig
--53715:1:    main entering VG_(shutdown_actions_NORETURN)
--53714:1:syswrap- run_a_thread_NORETURN(tid=3): post-thread_wrapper
--53714:1:syswrap- run_a_thread_NORETURN(tid=3): not last one standing
--53714:1:syswrap- thread_wrapper(tid=2): exit, schedreturncode VgSrc_FatalSig
--53714:1:syswrap- run_a_thread_NORETURN(tid=2): post-thread_wrapper
--53714:1:syswrap- run_a_thread_NORETURN(tid=2): not last one standing
--53714:1:syswrap- thread_wrapper(tid=4): exit, schedreturncode VgSrc_FatalSig
--53714:1:syswrap- run_a_thread_NORETURN(tid=4): post-thread_wrapper
--53714:1:syswrap- run_a_thread_NORETURN(tid=4): not last one standing
--53714:1:syswrap- thread_wrapper(tid=5): exit, schedreturncode VgSrc_FatalSig
--53714:1:syswrap- run_a_thread_NORETURN(tid=5): post-thread_wrapper
--53714:1:syswrap- run_a_thread_NORETURN(tid=5): not last one standing
--53714:1:syswrap- thread_wrapper(tid=6): exit, schedreturncode VgSrc_FatalSig
--53714:1:syswrap- run_a_thread_NORETURN(tid=6): post-thread_wrapper
--53714:1:syswrap- run_a_thread_NORETURN(tid=6): not last one standing
--53714:1:syswrap- thread_wrapper(tid=7): exit, schedreturncode VgSrc_FatalSig
--53714:1:syswrap- run_a_thread_NORETURN(tid=7): post-thread_wrapper
--53714:1:syswrap- run_a_thread_NORETURN(tid=7): not last one standing
--53714:1:syswrap- thread_wrapper(tid=8): exit, schedreturncode VgSrc_FatalSig
--53714:1:syswrap- run_a_thread_NORETURN(tid=8): post-thread_wrapper
--53714:1:syswrap- run_a_thread_NORETURN(tid=8): not last one standing
--53714:1:syswrap- thread_wrapper(tid=9): exit, schedreturncode VgSrc_FatalSig
--53714:1:syswrap- run_a_thread_NORETURN(tid=9): post-thread_wrapper
--53714:1:syswrap- run_a_thread_NORETURN(tid=9): not last one standing
--53714:1:syswrap- thread_wrapper(tid=10): exit, schedreturncode VgSrc_FatalSig
--53714:1:syswrap- run_a_thread_NORETURN(tid=10): post-thread_wrapper
--53714:1:syswrap- run_a_thread_NORETURN(tid=10): not last one standing
--53714:1:syswrap- thread_wrapper(tid=11): exit, schedreturncode VgSrc_FatalSig
--53714:1:syswrap- run_a_thread_NORETURN(tid=11): post-thread_wrapper
--53714:1:syswrap- run_a_thread_NORETURN(tid=11): not last one standing
==53714== Process terminating with default action of signal 15 (SIGTERM)
==53714==    at 0x605AD4F: _sigsuspend (in /lib/libc.so.7)
==53714==    by 0x5F30E76: ??? (in /lib/libthr.so.3)
==53714==    by 0x60591D8: sigsuspend (in /lib/libc.so.7)
==53714==    by 0x5FD552A: pause (in /lib/libc.so.7)
==53714==    by 0x4019F9: main (pth_2sig.c:39)
--53714:1:syswrap- thread_wrapper(tid=1): exit, schedreturncode VgSrc_FatalSig
--53714:1:syswrap- run_a_thread_NORETURN(tid=1): post-thread_wrapper
--53714:1:syswrap- run_a_thread_NORETURN(tid=1): last one standing
--53714:1:    main entering VG_(shutdown_actions_NORETURN)

@nbriggs
Copy link
Author

nbriggs commented May 23, 2022

--10400:1:    main Running thread 1
--10400:1:syswrap- entering VG_(main_thread_wrapper_NORETURN)
--10400:1:syswrap- run_a_thread_NORETURN(tid=1): pre-thread_wrapper
--10400:1:syswrap- thread_wrapper(tid=1): entry
--10400-- transtab: allocate sector 0
--10400:1:mallocfr newSuperblock at 0x7197000 (pszB   65520)  owner VALGRIND/ttaux
--10400:1: signals extending a stack base 0xfbbfe000 down by 4096 new base 0xfbbfd000 to cover 0xfbbfd000
--10400:1: signals extending a stack base 0xfbbfd000 down by 4096 new base 0xfbbfc000 to cover 0xfbbfc000
--10400:1:hashtabl resizing table `di.storage.addStr.1' from 769 to 1543 (total elems 770)
--10400:1:hashtabl resizing table `di.storage.addStr.1' from 1543 to 3079 (total elems 1544)
--10400:1:hashtabl resizing table `di.storage.addStr.1' from 3079 to 6151 (total elems 3080)
--10400:1:mallocfr newSuperblock at 0x7406000 (pszB 1048560)  owner VALGRIND/dinfo
--10400:1:mallocfr newSuperblock at 0x7712000 (pszB   65520)  owner VALGRIND/ttaux
--10400:1:mallocfr newSuperblock at 0x773B000 (pszB 4194288)  owner CLIENT/client
--10400:1:syswrap- run_a_thread_NORETURN(tid=2): pre-thread_wrapper
--10400:1:syswrap- thread_wrapper(tid=2): entry
--10400:1:syswrap- run_a_thread_NORETURN(tid=3): pre-thread_wrapper
--10400:1:syswrap- thread_wrapper(tid=3): entry
--10400:1:syswrap- run_a_thread_NORETURN(tid=4): pre-thread_wrapper
--10400:1:syswrap- thread_wrapper(tid=4): entry
--10400:1:syswrap- run_a_thread_NORETURN(tid=5): pre-thread_wrapper
--10400:1:syswrap- thread_wrapper(tid=5): entry
--10400:1:syswrap- run_a_thread_NORETURN(tid=6): pre-thread_wrapper
--10400:1:syswrap- thread_wrapper(tid=6): entry
--10400:1:syswrap- run_a_thread_NORETURN(tid=7): pre-thread_wrapper
--10400:1:syswrap- thread_wrapper(tid=7): entry
--10400:1:syswrap- run_a_thread_NORETURN(tid=8): pre-thread_wrapper
--10400:1:syswrap- thread_wrapper(tid=8): entry
--10400:1:syswrap- run_a_thread_NORETURN(tid=9): pre-thread_wrapper
--10400:1:syswrap- thread_wrapper(tid=9): entry
--10400:1:syswrap- run_a_thread_NORETURN(tid=10): pre-thread_wrapper
--10400:1:syswrap- thread_wrapper(tid=10): entry
--10400:1:syswrap- run_a_thread_NORETURN(tid=11): pre-thread_wrapper
--10400:1:syswrap- thread_wrapper(tid=11): entry
--10401:1:syswrap- thread_wrapper(tid=1): exit, schedreturncode VgSrc_ExitThread
--10401:1:syswrap- run_a_thread_NORETURN(tid=1): post-thread_wrapper
--10401:1:syswrap- run_a_thread_NORETURN(tid=1): last one standing
--10401:1:    main entering VG_(shutdown_actions_NORETURN)
==10401== 
==10401== HEAP SUMMARY:
==10401==     in use at exit: 13,904 bytes in 22 blocks
==10401==   total heap usage: 22 allocs, 0 frees, 13,904 bytes allocated
==10401== 
==10401== LEAK SUMMARY:
==10401==    definitely lost: 0 bytes in 0 blocks
==10401==    indirectly lost: 0 bytes in 0 blocks
==10401==      possibly lost: 0 bytes in 0 blocks
==10401==    still reachable: 13,904 bytes in 22 blocks
==10401==         suppressed: 0 bytes in 0 blocks
==10401== Rerun with --leak-check=full to see details of leaked memory
==10401== 
==10401== For lists of detected and suppressed errors, rerun with: -s
==10401== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)
--10401:1: core_os VG_(terminate_NORETURN)(tid=1) schedretcode VgSrc_ExitThread os_state.exit_code 0 fatalsig 0

I don't see the backtrace that you got. This was ./vg-in-place -d none/tests/pth_2sig and I killed -9 first pid 10401 then pid 10400 to get it to give up after it had hung at the final line of output.

@paulfloyd
Copy link
Owner

Hmm. Looks like none of the child signals are being delivered. The child then exits, leaving the parent stuck in the pause().

Does increasing the sleep() time or the number in the for / kill loop change anything?

@nbriggs
Copy link
Author

nbriggs commented May 23, 2022

If I make this change:

diff --git a/none/tests/pth_2sig.c b/none/tests/pth_2sig.c
index 56e6904c0..2af545f9c 100644
--- a/none/tests/pth_2sig.c
+++ b/none/tests/pth_2sig.c
@@ -28,7 +28,7 @@ int main(int argc, char **argv)
         case 0: // child
             sleep(2); // Should be enough to ensure (some) threads are created
             for (i = 0; i < 20 && kill(pid, SIGTERM) == 0; i++)
-                ;
+               pause();
             exit(0);
         case -1:
             perror("fork");

it all seems to work OK.

@paulfloyd
Copy link
Owner

How does that work? The child pause() will certainly allow the parent to run and receive the SIGTERM. But then how does the child get out of the pause()? Do you need to hit ctrl-c?

It does look like this is more a testcase problem than a Valgrind problem.

@nbriggs
Copy link
Author

nbriggs commented May 23, 2022

No, no ctrl-C necessary. Beats me how it works. I'll try something different and see what happens.

@nbriggs
Copy link
Author

nbriggs commented May 23, 2022

It feels to me as though doing anything that might cause a yield in the kill loop lets this run OK.
I've tested with this change, and it seems fine:

diff --git a/none/tests/pth_2sig.c b/none/tests/pth_2sig.c
index 56e6904c0..e75f2b2d5 100644
--- a/none/tests/pth_2sig.c
+++ b/none/tests/pth_2sig.c
@@ -14,6 +14,7 @@ void *slavethread(void *arg)
 
 int main(int argc, char **argv)
 {
+    const struct timespec alittle = { 0, 1000000000 / 100 };   // 0.01 seconds.
     int i;
     for (i = 0; i < 10; i++) {
         pthread_t slave;
@@ -28,7 +29,7 @@ int main(int argc, char **argv)
         case 0: // child
             sleep(2); // Should be enough to ensure (some) threads are created
             for (i = 0; i < 20 && kill(pid, SIGTERM) == 0; i++)
-                ;
+               nanosleep(&alittle, NULL);
             exit(0);
         case -1:
             perror("fork");

It's still disconcerting, though, that in the original case it can cause the system to lock up so tight.

@paulfloyd
Copy link
Owner

commit a415120 (HEAD -> master, origin/master, origin/HEAD)
Author: Paul Floyd pjfloyd@wanadoo.fr
Date: Mon May 23 21:27:58 2022 +0200

Add small sleep to none/tests/pth_2sig to help prevent hanging

On FreeBSD 13.0 x86 this testcase was hanging on some systems.
It seems like the SIGTERM signals were not being recieved
before the child exited, which left the parent hanging in the
pause() waiting to be killed.

Reported, patch provided and tested by Nick Briggs.

@nbriggs
Copy link
Author

nbriggs commented May 23, 2022

I'm very happy not having the tests hang up here every time I run them, but there's still the outstanding question of why it's fine if you run the original pth_2sig program without valgrind, but with it it does not function correctly.

When not running under valgrind the (new) pth_2sig truss output looks like (ignoring startup)

17135 100192: __sysctl("kern.usrstack",2,0x204630b0,0xffbfdd1c,0x0,0) = 0 (0x0)
17135 100192: getrlimit(RLIMIT_STACK,{ cur=67108864,max=67108864 }) = 0 (0x0)
17135 100192: mmap(0x0,20480,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12),-1,0x0) = 543490048 (0x20650000)
17135 100192: mmap(0x0,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12),-1,0x0) = 543510528 (0x20655000)
17135 100192: thr_self(0x20650000)		 = 0 (0x0)
17135 100192: mmap(0xfbbfe000,4096,PROT_NONE,MAP_ANON,-1,0x0) = -71311360 (0xfffffffffbbfe000)
17135 100192: rtprio_thread(RTP_LOOKUP,100192,0xffbfdcf4) = 0 (0x0)
17135 100192: sysarch(I386_SET_GSBASE,0xffbfdd0c) = 0 (0x0)
17135 100192: sigaction(SIGTHR,{ 0x2045b160 SA_SIGINFO ss_t },0x0) = 0 (0x0)
17135 100192: sigprocmask(SIG_UNBLOCK,{ },0x0)	 = 0 (0x0)
17135 100192: _umtx_op(0xffbfdcac,UMTX_OP_WAKE,0x1,0x0,0x0) = 0 (0x0)
17135 100192: mprotect(0x0,0,PROT_NONE)		 = 0 (0x0)
17135 100192: getpid()				 = 17135 (0x42ef)
17135 100192: getpid()				 = 17135 (0x42ef)
17135 100192: sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
17135 100192: sigfastblock(0x3,0x0)		 = 0 (0x0)
17135 100192: sigprocmask(SIG_SETMASK,{ },0x0)	 = 0 (0x0)
17135 100192: sigfastblock(0x1,0x20650034)	 = 0 (0x0)
17135 100192: getcontext(0xffbfd9e0)		 = 0 (0x0)
17135 100192: mprotect(0x402000,4096,PROT_READ)	 = 0 (0x0)
17135 100192: mmap(0x0,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 543514624 (0x20656000)
17135 100192: mmap(0xfbafd000,1052672,PROT_READ|PROT_WRITE|PROT_EXEC,MAP_STACK,-1,0x0) = -72364032 (0xfffffffffbafd000)
17135 100192: mprotect(0xfbafd000,4096,PROT_NONE) = 0 (0x0)
17135 100192: thr_new(0xffbfeb3c,0x34)		 = 0 (0x0)
17135 100192: mmap(0xfb9fc000,1052672,PROT_READ|PROT_WRITE|PROT_EXEC,MAP_STACK,-1,0x0) = -73416704 (0xfffffffffb9fc000)
17135 100192: mprotect(0xfb9fc000,4096,PROT_NONE) = 0 (0x0)
17135 100192: thr_new(0xffbfeb3c,0x34)		 = 0 (0x0)
17135 100192: mmap(0xfb8fb000,1052672,PROT_READ|PROT_WRITE|PROT_EXEC,MAP_STACK,-1,0x0) = -74469376 (0xfffffffffb8fb000)
17135 100192: mprotect(0xfb8fb000,4096,PROT_NONE) = 0 (0x0)
17135 100192: thr_new(0xffbfeb3c,0x34)		 = 0 (0x0)
17135 100192: mmap(0xfb7fa000,1052672,PROT_READ|PROT_WRITE|PROT_EXEC,MAP_STACK,-1,0x0) = -75522048 (0xfffffffffb7fa000)
17135 100192: mprotect(0xfb7fa000,4096,PROT_NONE) = 0 (0x0)
17135 100192: thr_new(0xffbfeb3c,0x34)		 = 0 (0x0)
17135 100192: mmap(0xfb6f9000,1052672,PROT_READ|PROT_WRITE|PROT_EXEC,MAP_STACK,-1,0x0) = -76574720 (0xfffffffffb6f9000)
17135 100192: mprotect(0xfb6f9000,4096,PROT_NONE) = 0 (0x0)
17135 100192: thr_new(0xffbfeb3c,0x34)		 = 0 (0x0)
17135 100192: mmap(0xfb5f8000,1052672,PROT_READ|PROT_WRITE|PROT_EXEC,MAP_STACK,-1,0x0) = -77627392 (0xfffffffffb5f8000)
17135 100192: mprotect(0xfb5f8000,4096,PROT_NONE) = 0 (0x0)
17135 100192: thr_new(0xffbfeb3c,0x34)		 = 0 (0x0)
17135 100192: mmap(0xfb4f7000,1052672,PROT_READ|PROT_WRITE|PROT_EXEC,MAP_STACK,-1,0x0) = -78680064 (0xfffffffffb4f7000)
17135 100192: mprotect(0xfb4f7000,4096,PROT_NONE) = 0 (0x0)
17135 100192: thr_new(0xffbfeb3c,0x34)		 = 0 (0x0)
17135 100192: mmap(0x0,139264,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 543518720 (0x20657000)
17135 100192: mmap(0xfb3f6000,1052672,PROT_READ|PROT_WRITE|PROT_EXEC,MAP_STACK,-1,0x0) = -79732736 (0xfffffffffb3f6000)
17135 100192: mprotect(0xfb3f6000,4096,PROT_NONE) = 0 (0x0)
17135 100192: thr_new(0xffbfeb3c,0x34)		 = 0 (0x0)
17135 100192: mmap(0xfb2f5000,1052672,PROT_READ|PROT_WRITE|PROT_EXEC,MAP_STACK,-1,0x0) = -80785408 (0xfffffffffb2f5000)
17135 100192: mprotect(0xfb2f5000,4096,PROT_NONE) = 0 (0x0)
17135 100192: thr_new(0xffbfeb3c,0x34)		 = 0 (0x0)
17135 100192: mmap(0xfb1f4000,1052672,PROT_READ|PROT_WRITE|PROT_EXEC,MAP_STACK,-1,0x0) = -81838080 (0xfffffffffb1f4000)
17135 100192: mprotect(0xfb1f4000,4096,PROT_NONE) = 0 (0x0)
17135 100192: thr_new(0xffbfeb3c,0x34)		 = 0 (0x0)
17135 100192: getpid()				 = 17135 (0x42ef)
17135 100192: fork()				 = 17136 (0x42f0)
17136 100116: <new process>
17136 100116: thr_self(0x20650000)		 = 0 (0x0)
17136 100116: sysarch(I386_SET_GSBASE,0xffbfeae4) = 0 (0x0)
17135 100192: sigprocmask(SIG_BLOCK,0x0,{ })	 = 0 (0x0)
17135 110506: <new thread 110506>
17135 110506: sigfastblock(0x1,0x20650534)	 = 0 (0x0)
17135 110506: sigprocmask(SIG_BLOCK,0x0,{ })	 = 0 (0x0)
17135 110507: <new thread 110507>
17135 110507: sigfastblock(0x1,0x20650a34)	 = 0 (0x0)
17135 110507: sigprocmask(SIG_BLOCK,0x0,{ })	 = 0 (0x0)
17135 110508: <new thread 110508>
17135 110508: sigfastblock(0x1,0x20650f34)	 = 0 (0x0)
17135 110508: sigprocmask(SIG_BLOCK,0x0,{ })	 = 0 (0x0)
17135 110509: <new thread 110509>
17135 110509: sigfastblock(0x1,0x20651434)	 = 0 (0x0)
17135 110509: sigprocmask(SIG_BLOCK,0x0,{ })	 = 0 (0x0)
17135 110510: <new thread 110510>
17135 110510: sigfastblock(0x1,0x20651934)	 = 0 (0x0)
17135 110510: sigprocmask(SIG_BLOCK,0x0,{ })	 = 0 (0x0)
17135 110511: <new thread 110511>
17135 110511: sigfastblock(0x1,0x20651e34)	 = 0 (0x0)
17135 110511: sigprocmask(SIG_BLOCK,0x0,{ })	 = 0 (0x0)
17135 110512: <new thread 110512>
17135 110512: sigfastblock(0x1,0x20652334)	 = 0 (0x0)
17135 110512: sigprocmask(SIG_BLOCK,0x0,{ })	 = 0 (0x0)
17135 110513: <new thread 110513>
17135 110513: sigfastblock(0x1,0x20652834)	 = 0 (0x0)
17135 110513: sigprocmask(SIG_BLOCK,0x0,{ })	 = 0 (0x0)
17135 110514: <new thread 110514>
17135 110514: sigfastblock(0x1,0x20652d34)	 = 0 (0x0)
17135 110514: sigprocmask(SIG_BLOCK,0x0,{ })	 = 0 (0x0)
17135 110515: <new thread 110515>
17135 110515: sigfastblock(0x1,0x20653234)	 = 0 (0x0)
17135 110515: sigprocmask(SIG_BLOCK,0x0,{ })	 = 0 (0x0)
17136 100116: nanosleep({ 2.000000000 })	 = 0 (0x0)
17136 100116: kill(17135,SIGTERM)		 = 0 (0x0)
17135 100192: SIGNAL 15 (SIGTERM) code=SI_USER pid=17136 uid=1001
17135 110506: <thread 110506 exited>
17135 110507: <thread 110507 exited>
17135 110508: <thread 110508 exited>
17135 110509: <thread 110509 exited>
17135 110510: <thread 110510 exited>
17135 110511: <thread 110511 exited>
17135 110512: <thread 110512 exited>
17135 110513: <thread 110513 exited>
17135 110514: <thread 110514 exited>
17135 110515: <thread 110515 exited>
17135 100192: process killed, signal = 15
17136 100116: nanosleep({ 0.010000000 })	 = 0 (0x0)
17136 100116: kill(17135,SIGTERM)		 ERR#3 'No such process'
17136 100116: exit(0x0)				
17136 100116: process exit, rval = 0

so after the sleep for 2s, the first kill() that it sends causes the parent process (and subsidiary pthreads) to terminate, the second kill() fails, and everything exits normally.

@paulfloyd
Copy link
Owner

paulfloyd commented May 24, 2022

I'm very happy not having the tests hang up here every time I run them, but there's still the outstanding question of why it's fine if you run the original pth_2sig program without valgrind, but with it it does not function correctly.

It's because "sleep()" is not a reliable synchronisation mechanism. In this context it's saying "let's hope that the other process has done something by the end of the sleep()". There's no guarantee that will happen. Increasing the sleep may make it more likely, but it's never certain. In my previous job I had one project where we were simulating Intel CPU cores which would take up to 700Gbytes of RAM and the Linux kernel for some reason decided that it wanted to do a NUMA migration. The process was then suspended off-CPU for something like 10 hours. An extreme example, but it shows that CPU scheduling can't be taken for granted.

On top of that the Valgrind scheduler is fairly basic. In this case there are two processes which will be scheduled by the FreeBSD kernel. Each of these is scheduled by Valgrind, in particular the 10+1 threads of the parent process. I don't know exactly what can cause a thread to yield, certainly a yielding syscall, but I don't think that the Valgrind scheduler implements things like pre-emption and priority. All that to say that for guest applications that go not use guaranteed synchronization the order of execution can be different under Valgrind.

I don't think that Valgrind should be behaving badly like that though.

I think that there is a real problem with the scheduler when there are incomplete syscalls.

@paulfloyd
Copy link
Owner

I've just been looking at where SfYieldAfter gets set.

One difference that I see with Linux is that when Linux forks/creates a thread the check is

if (SUCCESS && RES != 0) {

before setting the yeild fld

On FreeBSD, fork just checks SUCCESS and thr_create just checks sr_isError(res)

SUCCESS means that the syscall is complete and there is not an error
RES also checks complete/not an error and provides the syscall return code

What would happen if the error flag is set but the return code is non-zero? Is that possible?

@paulfloyd paulfloyd reopened this May 26, 2022
@paulfloyd
Copy link
Owner

paulfloyd commented May 26, 2022

Could you try this diff

diff --git a/coregrind/m_libcprint.c b/coregrind/m_libcprint.c
index 168008288..e427d46cc 100644
--- a/coregrind/m_libcprint.c
+++ b/coregrind/m_libcprint.c
@@ -1062,7 +1062,7 @@ UInt VG_(vmessage) ( VgMsgKind kind, const HChar* format, va_list vargs )
       point.  If not, assume more bits of the same line will turn up
       in later messages, so don't bother to flush it right now. */
 
-   if (b->atLeft && b->buf_used > 0) {
+   if (b->atLeft && b->buf_used > 0 && 0) {
       send_bytes_to_logging_sink( b->sink, b->buf, b->buf_used );
       b->buf_used = 0;
    }

and then rerun under Valgrind with full bells and whistles logging

../../vg-in-place --tool=none --trace-sched=yes -v -v -v -v -d -d -d -d --vgdb=no --trace-syscalls=yes --trace-signals=yes

and see if anything extra gets printed?

Only -d output gets written immediately, I think all other output gets buffered and when Valgrind hangs there may still be stuff in the buffer.

@nbriggs
Copy link
Author

nbriggs commented May 26, 2022

OK, I think I correctly decoded what markdown did to the diff output (just disabling the if condition with && 0) and I've attached the whole output here. I ran it through uniq -c to make it a little more compact since there were thousands of repeated lines from the scheduler.
trace.txt

@nbriggs
Copy link
Author

nbriggs commented May 26, 2022

That trace was with the original pth_2sig.c source so that it hung. This one is with the nanosleep() present, so it exits normally. Same hack with uniq -c.
trace-new.txt

@nbriggs
Copy link
Author

nbriggs commented May 26, 2022

Looking at that change again, didn't you want the test to be true to always flush the output and clear the buffer?
I tried it that way, though, and it didn't make any difference to the output at the end.

   /* If the message finished exactly with a \n, then flush it at this                                                                                               
      point.  If not, assume more bits of the same line will turn up                                                                                                 
      in later messages, so don't bother to flush it right now. */

   if (1 || (b->atLeft && b->buf_used > 0)) {
      send_bytes_to_logging_sink( b->sink, b->buf, b->buf_used );
      b->buf_used = 0;
   }

@paulfloyd
Copy link
Owner

Yes, my mistake with the 'if'.

Does this patch help
save_carry_2.txt
?

@nbriggs
Copy link
Author

nbriggs commented May 26, 2022

No joy with that patch either. Current state is:

flap% uname -a
FreeBSD flap.gateway.sonic.net 13.1-RELEASE FreeBSD 13.1-RELEASE releng/13.1-n250148-fc952ac2212 GENERIC i386

flap% clang --version
FreeBSD clang version 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303)
Target: i386-unknown-freebsd13.1
Thread model: posix
InstalledDir: /usr/bin

flap% git log | head -5
commit 034e5d2242e8a01fba16efcf63af186605a35a09
Author: Paul Floyd <pjfloyd@wanadoo.fr>
Date:   Tue May 24 23:39:12 2022 +0200

    Fixes for FreeBSD pdkill syscall wrapper

flap% git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   ../../VEX/priv/guest_amd64_helpers.c
	modified:   ../../VEX/priv/guest_x86_helpers.c
	modified:   ../../VEX/pub/libvex_guest_amd64.h
	modified:   ../../VEX/pub/libvex_guest_x86.h
	modified:   ../../coregrind/m_libcprint.c
	modified:   ../../coregrind/m_syswrap/syscall-amd64-darwin.S
	modified:   ../../coregrind/m_syswrap/syscall-amd64-freebsd.S
	modified:   ../../coregrind/m_syswrap/syscall-x86-darwin.S
	modified:   ../../coregrind/m_syswrap/syscall-x86-freebsd.S
	modified:   ../../coregrind/m_syswrap/syswrap-main.c
	modified:   pth_2sig.c

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	../../VEX/priv/guest_amd64_helpers.c.orig
	../../VEX/priv/guest_x86_helpers.c.orig
	../../VEX/pub/libvex_guest_amd64.h.orig
	../../VEX/pub/libvex_guest_x86.h.orig
	../../coregrind/m_syswrap/syscall-amd64-darwin.S.orig
	../../coregrind/m_syswrap/syscall-amd64-freebsd.S.orig
	../../coregrind/m_syswrap/syscall-x86-darwin.S.orig
	../../coregrind/m_syswrap/syscall-x86-freebsd.S.orig
	../../coregrind/m_syswrap/syswrap-main.c.orig

no changes added to commit (use "git add" and/or "git commit -a")

(where it's running with the older pth_2sig.c that does not do the nanosleep(), and it does do the buffer flush every time in m_libcprint.c)

trace3.txt

@paulfloyd
Copy link
Owner

paulfloyd commented May 26, 2022

There are two processes. 43050 which runs to completion. 43049 which gets stuck, and that's the parent.

The last thing that 43049 says is

1 --43049-- SCHED[1]: releasing lock (VG_(client_syscall)[async]) -> VgTs_WaitSys

I see something very similar with none/tests/tls in FreeBSD 13.1 amd64:

--72132-- SCHED[13]: releasing lock (VG_(client_syscall)[async]) -> VgTs_WaitSys

(issue #188)

After that message there are a couple of functions that just lead to

ML_(sema_up)(&p->sema, False);

That seems to be working OK.

Back to the last message. It comes from VG_(client_syscall). What is supposed to happen is

  1. ReleaseBigLock
  2. Do the syscall

There are now two possibilities
2a. syscall not interrupted, obtain BigLock and continue scheduler
In this case I'd expect a "acquired lock" message. so if we're on that path then we hang before the message. A comment here says it's not even safe to do debug printing.

2b/ The syscall is interrupted. We go to async_signalhandler. Again I'd expect an "acquired lock" message.

@paulfloyd
Copy link
Owner

Could you try another test, with the handing testcase?

ktrace -di -t cinpstw ../../vg-in-place --tool=none ./pth_2sig

then kdump

Do you see a sequence similar to the ast/pipelk/piperd that I see for #188 ?

@nbriggs
Copy link
Author

nbriggs commented May 27, 2022

Sure -- I'm assuming you want the pth_2sig without the nanosleep(...) so that it locks up.
I'm attaching the kdump output for you to look at because I will be off-line for a few hours so won't be able to do the comparison of the sequence in a timely manner...
kdump.txt

@paulfloyd
Copy link
Owner

Great, that does look similar.

@paulfloyd
Copy link
Owner

paulfloyd commented May 30, 2022

Hi Nick

Is your 13.1 i386 system single core? If so, and if it is a VM, can you add a second core to the VM?

I managed to "fix" the issue I was having with #188 13.1 amd64 by changing the VirtualBox VM to use 2 cores.

@nbriggs
Copy link
Author

nbriggs commented May 30, 2022

It's real hardware, not a VM, and it's single-threaded:

CPU: Intel(R) Pentium(R) M processor 1.70GHz (762.59-MHz 686-class CPU)
  Origin="GenuineIntel"  Id=0x6d6  Family=0x6  Model=0xd  Stepping=6
  Features=0xafe9f9bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,TM,PBE>
  Features2=0x180<EST,TM2>

@paulfloyd
Copy link
Owner

In that case I don't have a solution. Hopefully this will get fixed soonish in a FreeBSD update.

I did try fiddling with a few sysctls but none seemed to affect the hangs.

@nbriggs
Copy link
Author

nbriggs commented May 31, 2022

Hopefully this will get fixed soonish in a FreeBSD update.

Do "they" agree that there's something that needs to be fixed in FreeBSD?

@paulfloyd
Copy link
Owner

Mark Johnston (a member of the core team) on the freebsd-hackers mailing list did say

'"procstat -kk " might help to reveal what's going on,
since it sounds like the hand/livelock is happening somewhere in the
kernel.'

I'll open a freebsd bugzilla item if i don't get an acknowledgement in the next day or two.

@nbriggs
Copy link
Author

nbriggs commented May 31, 2022

procstat -kk -a when it has hung shows:

75137 100127 memcheck-x86-freebs - mi_switch+0x143 ast+0x267 __stop_set_sysinit_set+0xe616dc91
75137 111240 memcheck-x86-freebs - mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 pipe_read+0x3a5 dofileread+0x6d sys_read+0x67 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd
75137 111241 memcheck-x86-freebs - mi_switch+0x143 critical_exit_preempt+0x51 intr_event_handle+0x13e intr_execute_handlers+0xb4 atpic_handle_intr+0x4a __stop_set_sysinit_set+0xe616c1d9 ll+0x7
75137 111242 memcheck-x86-freebs - mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 pipe_read+0x3a5 dofileread+0x6d sys_read+0x67 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd
75137 111243 memcheck-x86-freebs - mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 pipe_read+0x9b dofileread+0x6d sys_read+0x67 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd
75137 111244 memcheck-x86-freebs - mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 pipe_read+0x9b dofileread+0x6d sys_read+0x67 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd
75137 111245 memcheck-x86-freebs - mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 pipe_read+0x9b dofileread+0x6d sys_read+0x67 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd
75137 111246 memcheck-x86-freebs - mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 pipe_read+0x9b dofileread+0x6d sys_read+0x67 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd
75137 111247 memcheck-x86-freebs - mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 pipe_read+0x9b dofileread+0x6d sys_read+0x67 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd
75137 111248 memcheck-x86-freebs - mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 pipe_read+0x9b dofileread+0x6d sys_read+0x67 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd
75137 111249 memcheck-x86-freebs - mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 pipe_read+0x9b dofileread+0x6d sys_read+0x67 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd

but 75138, the 2nd process, doesn't show up anywhere, and a ps axwu shows

briggs     75138   0.0  0.0     0     0  1  Z+   09:55      0:00.33 <defunct>

@paulfloyd
Copy link
Owner

That's interesting. It's similar but not identical to what I saw, If you run procstat -kk do you see anything change or is at always the same?

@nbriggs
Copy link
Author

nbriggs commented May 31, 2022

I tried again, and left it a lot longer, and there were no changes, but it seems to have captured the 2nd process as I killed it off...

75533 100127 memcheck-x86-freebs -                   mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 kern_sigsuspend+0x1e0 sys_sigsuspend+0x36 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd 
75533 111261 memcheck-x86-freebs -                   mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 kern_sigsuspend+0x1e0 sys_sigsuspend+0x36 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd 
75533 111262 memcheck-x86-freebs -                   mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 kern_sigsuspend+0x1e0 sys_sigsuspend+0x36 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd 
75533 111263 memcheck-x86-freebs -                   mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 kern_sigsuspend+0x1e0 sys_sigsuspend+0x36 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd 
75533 111264 memcheck-x86-freebs -                   mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 kern_sigsuspend+0x1e0 sys_sigsuspend+0x36 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd 
75533 111265 memcheck-x86-freebs -                   mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 kern_sigsuspend+0x1e0 sys_sigsuspend+0x36 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd 
75533 111266 memcheck-x86-freebs -                   mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 kern_sigsuspend+0x1e0 sys_sigsuspend+0x36 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd 
75533 111267 memcheck-x86-freebs -                   mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 kern_sigsuspend+0x1e0 sys_sigsuspend+0x36 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd 
75533 111268 memcheck-x86-freebs -                   mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 kern_sigsuspend+0x1e0 sys_sigsuspend+0x36 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd 
75533 111269 memcheck-x86-freebs -                   mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 kern_sigsuspend+0x1e0 sys_sigsuspend+0x36 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd 
75533 111270 memcheck-x86-freebs -                   mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_wait_sig+0xe _sleep+0x207 kern_sigsuspend+0x1e0 sys_sigsuspend+0x36 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd 
75534 100933 memcheck-x86-freebs -                   mi_switch+0x143 sleepq_switch+0xf5 sleepq_catch_signals+0x2d5 sleepq_timedwait_sig+0x14 _sleep+0x19a kern_clock_nanosleep+0x1bf sys_nanosleep+0x34 syscall+0x179 __stop_set_sysinit_set+0xe616b8cd 

@paulfloyd
Copy link
Owner

@paulfloyd paulfloyd closed this as not planned Won't fix, can't repro, duplicate, stale Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants