Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263600AbUDFCE1 (ORCPT ); Mon, 5 Apr 2004 22:04:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263601AbUDFCE1 (ORCPT ); Mon, 5 Apr 2004 22:04:27 -0400 Received: from cpe-24-221-190-179.ca.sprintbbd.net ([24.221.190.179]:26330 "EHLO myware.akkadia.org") by vger.kernel.org with ESMTP id S263600AbUDFCEZ (ORCPT ); Mon, 5 Apr 2004 22:04:25 -0400 Message-ID: <4072101F.3010603@redhat.com> Date: Mon, 05 Apr 2004 19:04:15 -0700 From: Ulrich Drepper Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b) Gecko/20040405 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Kevin B. Hendricks" CC: linux-kernel@vger.kernel.org Subject: Re: Catching SIGSEGV with signal() in 2.6 References: <200404052040.54301.kevin.hendricks@sympatico.ca> In-Reply-To: <200404052040.54301.kevin.hendricks@sympatico.ca> X-Enigmail-Version: 0.83.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 866 Lines: 31 Kevin B. Hendricks wrote: > For some reason, the segfault generated by trying to write to address 0 can > not be properly caught anymore (or at least it appears that way to me). If the code would be correct you'd see the expected behavior. > void SignalHdl( int sig ) > { > bSignal = 1; > longjmp( check_env, sig ); > } Since you jump out of a signal handling you must use siglongmp > int check( TestFunc func, void* p ) > { > int result; > bSignal = 0; > if ( !setjmp( check_env ) ) And sigsetjmp(check_env, 1) here. -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/