From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1445 invoked by alias); 6 Jul 2011 15:46:49 -0000 Received: (qmail 1437 invoked by uid 22791); 6 Jul 2011 15:46:48 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 Jul 2011 15:46:29 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p66FkPCL000408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 6 Jul 2011 11:46:25 -0400 Received: from host1.jankratochvil.net (ovpn-113-91.phx2.redhat.com [10.3.113.91]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p66FkNBg008691 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Jul 2011 11:46:25 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p66FkMKi026668; Wed, 6 Jul 2011 17:46:22 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p66FkLQ1026661; Wed, 6 Jul 2011 17:46:21 +0200 Date: Wed, 06 Jul 2011 16:03:00 -0000 From: Jan Kratochvil To: Chet Ramey Cc: bug-readline@gnu.org, gdb-patches@sourceware.org, Sterling Augustine Subject: Re: [Bug-readline] [readline patch, gdb-7.3?] Avoid free from a signal handler [Re: [PATCH] Make interrupting tab-completion safe.] Message-ID: <20110706154621.GA17142@host1.jankratochvil.net> References: <20110612121158.GA10611@host1.jankratochvil.net> <20110626222146.GA4410@host1.jankratochvil.net> <4E0B2E83.9030202@case.edu> <20110629203457.GA28353@host1.jankratochvil.net> <4E0C8A5D.7000807@case.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E0C8A5D.7000807@case.edu> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-07/txt/msg00194.txt.bz2 On Thu, 30 Jun 2011 16:38:21 +0200, Chet Ramey wrote: > I have seen cases where the user hits ^C while readline or a filename > completion function is attempting to traverse a file system on a dead > NFS server, the signal handler gets hit, but the system call doesn't > get interrupted. I haven't seen those cases in a while, though. I have tried to reproduce it but I think it is outside of the scope of readline and/or gdb. Running ip6tables -I INPUT 1 -i lo -p tcp --dport 2049 -j DROP before rl_filename_completion_function's readdir() call will cause (in strace): rt_sigaction(SIGINT, {0x6518cb=handle_sigint, [INT], SA_RESTORER|SA_RESTART, 0x7f79cf0bd490}, NULL, 8) = 0 rt_sigaction(SIGQUIT, {0x65196e=handle_sigquit, [QUIT], SA_RESTORER|SA_RESTART, 0x7f79cf0bd490}, NULL, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 [...] getdents(5, and no CTRL-C makes any change. It was mounted on kernel-2.6.35.13-92.fc14.x86_64 with options: localhost:/... /... nfs ro,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,acregmin=0,acregmax=0,acdirmin=0,acdirmax=0,soft,proto=tcp6,timeo=600,retrans=2,sec=sys,mountaddr=::1,mountvers=3,mountport=59099,mountproto=udp6,addr=::1 0 0 where I used "intr" but "intr" / "nointr" is not listed at all and man says: The intr / nointr mount option is deprecated after kernel 2.6.25. Only SIGKILL can interrupt a pending NFS operation on these kernels, and if specified, this mount option is ignored to provide backwards compatibility with older kernels. > remove the references to _rl_interrupt_immediately I think _rl_interrupt_immediately should never exist as you cannot do anything much from the signal handler anyway. man 7 signak "Async-signal-safe functions" Thanks, Jan