From owner-freebsd-threads@FreeBSD.ORG Fri Jun 9 13:47:52 2006 Return-Path: X-Original-To: threads@freebsd.org Delivered-To: freebsd-threads@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4650416A41A for ; Fri, 9 Jun 2006 13:47:52 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id ACAAF43D73 for ; Fri, 9 Jun 2006 13:47:51 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.6/8.13.6/NETPLEX) with ESMTP id k59DlhJu005964; Fri, 9 Jun 2006 09:47:44 -0400 (EDT) Date: Fri, 9 Jun 2006 09:47:43 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Maxim Konovalov In-Reply-To: <20060609164120.X11643@mp2.macomnet.net> Message-ID: References: <200606071906.25776.mi+mx@aldan.algebra.com> <200606071916.38538.mi+mx@aldan.algebra.com> <20060608081626.X6097@mp2.macomnet.net> <200606081218.17131.mi+mx@aldan.algebra.com> <20060608213618.O17062@mp2.macomnet.net> <20060609164120.X11643@mp2.macomnet.net> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-758783491-1149860863=:10705" X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: threads@freebsd.org, Mikhail Teterin Subject: Re: SIGINFO and pthreads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jun 2006 13:47:52 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---559023410-758783491-1149860863=:10705 Content-Type: TEXT/PLAIN; charset=KOI8-R; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Fri, 9 Jun 2006, Maxim Konovalov wrote: > Daniel, > > On Thu, 8 Jun 2006, 18:52-0400, Daniel Eischen wrote: > >> On Thu, 8 Jun 2006, Maxim Konovalov wrote: >> >>> On Thu, 8 Jun 2006, 12:18-0400, Mikhail Teterin wrote: >>> >>>> =DE=C5=D4=D7=C5=D2 08 =DE=C5=D2=D7=C5=CE=D8 2006 00:17, Maxim Konovalo= v =CE=C1=D0=C9=D3=C1=D7: >>>>> Inline it if it's small. =9AMailman strips most attachments. >>>> >>>> Damn... Yes, it is small -- this is just a demo program. Compile it fi= rst >>>> as >>>> >>>> cc -o t t.c >>>> >>>> Then -- run and try various keyboard signals like Ctrl-C, Ctrl-Z, >>>> Ctrl-T (SIGINFO), or Ctrl-\. (It will not quit on its own, you'll >>>> have to kill it from another prompt.) >>>> >>>> They will all work. Then -- recompile as >>>> >>>> cc -o t -pthread t.c >>>> >>>> And run... This time around it will ignore the Ctrl-T, while >>>> continuing to respond to others. >>>> >>>>> libpthread uses SIGINFO for dumping thread information to a file but >>>>> looking over the code it seems it does allow to use SIGINFO to the >>>>> app. >>>> >>>> I'd like to be able to disable the debugging feature or, at least, >>>> force it to call my signal-handler AS EXPECTED AND DOCUMENTED, after >>>> it is done with its own dumping. >>> >>> A funny thing your test program does work if you run it as >>> >>> LIBPTHREAD_DEBUG=3Dyes ./t >>> >>> Try this patch: >> >> [ ... ] >> >>> For the first glance and quick test this check is not needed as we >>> dump threads in already installed for SIGINFO _thr_sig_handler(). Of >>> course we need our libpthreads experts review. >> >> Yes, that is a correct patch (remove the commented out section). >> Please go ahead and commit! > > There is still a problem if user decided to SIG_IGN or SIG_DFL > SIGINFO. In this case threads dump stops working. I don't know how > important this fuctionality is so here is a more aggressive patch: I could go either way on the issue. This second patch looks fine to me, so if you want to commit this one, that is fine with me. Thanks! --=20 DE ---559023410-758783491-1149860863=:10705--