From owner-freebsd-bugs@FreeBSD.ORG Mon May 7 13:10:10 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F20D16A400 for ; Mon, 7 May 2007 13:10:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 2F94E13C45D for ; Mon, 7 May 2007 13:10:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l47DA9Rd089161 for ; Mon, 7 May 2007 13:10:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l47DA9cH089160; Mon, 7 May 2007 13:10:09 GMT (envelope-from gnats) Date: Mon, 7 May 2007 13:10:09 GMT Message-Id: <200705071310.l47DA9cH089160@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Gavin Atkinson Cc: Subject: Re: bin/63197: tftp Bus error, core dumped X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Gavin Atkinson List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 May 2007 13:10:10 -0000 The following reply was made to PR bin/63197; it has been noted by GNATS. From: Gavin Atkinson To: bug-followup@FreeBSD.org, freebsd@nbritton.org Cc: Subject: Re: bin/63197: tftp Bus error, core dumped Date: Sun, 06 May 2007 16:08:00 +0100 This is still a problem in -HEAD. As far as I can tell, the reason is as follows: We enable libedit's signal handling with "el_set(el, EL_SIGNAL, 1)" We also set up our own SIGINT signal handler, which essentially longjmp()s back to the start. Having a signal handler call longjmp is probably not a good idea anyway, but in conjunction with the libedit handler leads to the internal state of libedit becoming confused, and the next time libedit receives a signal (eg suspend, or resizing the window), libedit will die. Removing either of the two signal handlers prevents the crash, but it's not ideal as some functionality is lost. Switching off libedit's handling means that resumes or window resizes won't refresh the screen, removing the SIGINT handler means that transfers can't be stopped. I've tried calling el_reset after we receive the interrupt, but that doesn't help. OpenBSD have fixed this by having the signal handler only set an atomic flag, which is then regularly polled from the main code. Although it is worth noting that OpenBSD don't use libedit, so the fix can't be directly imported.