NetBSD Problem Report #385

From gnats  Wed Aug  3 02:05:16 1994
Received: from nemesis.CSOS.ORST.EDU (root@nemesis.CSOS.ORST.EDU [128.193.40.40]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with ESMTP id CAA03083 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Wed, 3 Aug 1994 02:05:15 -0700
Message-Id: <199408030905.CAA01077@nemesis.CSOS.ORST.EDU>
Date: Wed, 3 Aug 1994 02:05:23 -0700
From: jason downs <downsj@CSOS.ORST.EDU>
Reply-To: downsj@CSOS.ORST.EDU
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: setjmp()/longjmp() do not work in dynamic m68k binaries
X-Send-Pr-Version: 3.2

>Number:         385
>Category:       port-m68k
>Synopsis:       setjmp()/longjmp() do not work in dynamic m68k binaries
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    gnats-admin (GNATS administrator)
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 03 02:20:04 +0000 1994
>Closed-Date:    Sat Aug 13 08:44:04 +0000 1994
>Last-Modified:  
>Originator:     jason downs
>Release:        NetBSD 1.0-ALPHA
>Organization:
Computer Science Outreach Services, Oregon State University
>Environment:

System: NetBSD nemesis 1.0-ALPHA NetBSD 1.0-ALPHA (NEMESIS) #15: Wed Aug 3 00:06:54 PDT 1994 root@nemesis:/tmp_mnt/jadzia/info/BSD/src/sys/arch/hp300/compile/NEMESIS hp300


>Description:
	As discussed before, longjmp() specifically fails the first time it
	is called within a dynamic binary. [See port-hp300 archive.]

	This is a severe bug, and should be fixed for 1.0
>How-To-Repeat:
	As discussed before, using setjmp()/longjmp() in a dynamic binary
	will produce unexpected return values from setjmp(), when longjmp()
	called. [See port-hp300 archive.]
>Fix:
	'inlining' sigreturn() inside of longjmp() is the easiest and
	smallest form of at least bypassing this problem.

	This fix may very well NOT be the 'proper' way to fix the problem,
	but it at least avoids a major potential pitfall for all m68k ports.

*** setjmp.S.orig	Tue Aug  2 03:14:35 1994
--- setjmp.S	Tue Aug  2 23:13:28 1994
***************
*** 86,93 ****
--- 86,98 ----
  	moveq	#1,d0		/* else make non-zero */
  ok:
  	moveml	a0@(28),#0x3CFC	/* restore non-scratch regs */
+ #if 1
+         trap    #1              /* signals sigreturn() */
+         jra     cerror
+ #else
  	movl	a0,sp@-		/* let sigreturn */
  	jbsr	_sigreturn	/*   finish for us */
+ #endif

  botch:
  	jbsr	_longjmperror
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mycroft 
State-Changed-When: Sat Aug 13 01:44:04 PDT 1994 
State-Changed-Why:  
Fixed. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.