From owner-freebsd-bugs Mon Dec 21 19:30:06 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA12500 for freebsd-bugs-outgoing; Mon, 21 Dec 1998 19:30:06 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA12434 for ; Mon, 21 Dec 1998 19:30:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from Unknown UID 563@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id TAA19559; Mon, 21 Dec 1998 19:30:03 -0800 (PST) Received: (from nobody@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA11475; Mon, 21 Dec 1998 19:22:45 -0800 (PST) (envelope-from nobody) Message-Id: <199812220322.TAA11475@hub.freebsd.org> Date: Mon, 21 Dec 1998 19:22:45 -0800 (PST) From: eischen@vigrid.com To: freebsd-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: www-1.0 Subject: bin/9162: [Patch] pthreads GC breaks signal handling Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 9162 >Category: bin >Synopsis: [Patch] pthreads GC breaks signal handling >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Dec 21 19:30:01 PST 1998 >Last-Modified: >Originator: Daniel Eischen >Organization: >Release: 2.2.8-stable and 3.0-current >Environment: FreeBSD klr.clc.gdeb.com 2.2.7-STABLE FreeBSD 2.2.7-STABLE #0: Thu Oct 22 18:12:35 EDT 1998 deischen@klr.clc.gdeb.com:/opt/b/src/src/sys/compile/klr i386 >Description: If a threaded program installs a handler for a signal, and this program receives that signal, then the signal handler is invoked for the garbage collector thread. The GC thread should be transparent to the application and no signal handlers should be called as a result of it being present. >How-To-Repeat: Build and run libc_r/uthread/test/sigwait/sigwait.c (these tests are there for a reason, no? ;-)) >Fix: One fix is to block all signals in the garbage collector thread. Here is a patch: *** uthread_gc.c.orig Mon Dec 21 22:08:54 1998 --- uthread_gc.c Mon Dec 21 22:11:34 1998 *************** *** 47,52 **** --- 47,53 ---- int f_debug; int f_done = 0; int ret; + sigset_t mask; pthread_t pthread; pthread_t pthread_cln; pthread_t pthread_nxt; *************** *** 59,64 **** --- 60,69 ---- /* Set the name of this thread. */ pthread_set_name_np(_thread_run,"GC"); + + /* Block all signals. */ + sigfillset(&mask); + sigprocmask(SIG_BLOCK, &mask, NULL); while (!f_done) { /* Check if debugging this application. */ >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message