From ycheng@freebsd.sinica.edu.tw Sat Aug 28 01:20:51 1999
Return-Path: <ycheng@freebsd.sinica.edu.tw>
Received: from freebsd.sinica.edu.tw (freebsd.sinica.edu.tw [140.109.13.51])
	by hub.freebsd.org (Postfix) with ESMTP id 2E60B14D01
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 28 Aug 1999 01:20:49 -0700 (PDT)
	(envelope-from ycheng@freebsd.sinica.edu.tw)
Received: (from ycheng@localhost)
	by freebsd.sinica.edu.tw (8.9.2/8.9.2) id QAA74263;
	Sat, 28 Aug 1999 16:24:28 +0800 (CST)
	(envelope-from ycheng)
Message-Id: <199908280824.QAA74263@freebsd.sinica.edu.tw>
Date: Sat, 28 Aug 1999 16:24:28 +0800 (CST)
From: Yuan-Chen Cheng <ycheng@ml.tw.freebsd.org>
Sender: ycheng@freebsd.sinica.edu.tw
Reply-To: ycheng@sinica.edu.tw
To: FreeBSD-gnats-submit@freebsd.org
Subject: objc forward core dump using system cc
X-Send-Pr-Version: 3.2

>Number:         13438
>Category:       gnu
>Synopsis:       objc forward core dump using system cc
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 28 01:30:01 PDT 1999
>Closed-Date:    Thu Jan 17 08:12:05 PST 2002
>Last-Modified:  Thu Jan 17 08:35:10 PST 2002
>Originator:     Yuan-Chen Cheng
>Release:        FreeBSD 4.0-19990827-CURRENT i386
>Organization:
ASCC
>Environment:

New install FreeBSD 4.0-19990827-CURRENT i386

>Description:

objc forward feature not work.

>How-To-Repeat:

mkdir test
cd test
patch < following_patch
cc *.m -Wall -lobjc
./a.out

core dump with message:
Inv val is 134561320
Floating point exception (core dumped)

--- /dev/null	Wed May  6 04:32:27 1998
+++ DelegatePool.h	Wed Aug 11 08:34:58 1999
@@ -0,0 +1,10 @@
+#include <objc/Object.h>
+
+@interface DelegatePool : Object
+{
+  id a;
+}
+- (void) setDeleGate: anObject;
+- forward:(SEL)aSel :(arglist_t)argFrame;
+@end
+
--- /dev/null	Wed May  6 04:32:27 1998
+++ DelegatePool.m	Wed Aug 11 08:34:58 1999
@@ -0,0 +1,22 @@
+
+#include "DelegatePool.h"
+
+@implementation DelegatePool
+
+- (void) setDeleGate: anObject
+{
+  a = anObject;
+}
+
+- forward: (SEL)aSel :(arglist_t)argFrame
+{
+  void *ret = 0;
+  
+  if ([a respondsTo:aSel]) 
+    {
+      ret = [a performv:aSel :argFrame];
+    }
+  return ret;
+}
+
+@end
--- /dev/null	Wed May  6 04:32:27 1998
+++ Int.h	Wed Aug 11 08:34:58 1999
@@ -0,0 +1,11 @@
+
+#include <objc/Object.h>
+
+@interface Int : Object
+{
+  int i;
+}
+- (void) set: (int) val;
+- (void) print;
+@end
+
--- /dev/null	Wed May  6 04:32:27 1998
+++ Int.m	Wed Aug 11 08:34:58 1999
@@ -0,0 +1,17 @@
+
+#include "Int.h"
+
+@implementation Int
+
+- (void) set: (int) val
+{
+  i = val;
+}
+
+- (void) print
+{
+  printf("Inv val is %i\n", i);
+}
+
+@end
+
--- /dev/null	Wed May  6 04:32:27 1998
+++ main.m	Wed Aug 11 08:34:57 1999
@@ -0,0 +1,16 @@
+#include "Int.h"
+#include "DelegatePool.h"
+
+int main()
+{
+  id i;
+  id d;
+
+  i = [[Int new] init] ;
+  d = [[DelegatePool new] init];
+  [d setDeleGate: i];
+  [d print];
+  return 0;
+}
+
+

>Fix:


>Release-Note:
>Audit-Trail:

From: Yuan-Chen Cheng <ycheng@beta.wsl.sinica.edu.tw>
To: freebsd-gnats-submit@FreeBSD.org, ycheng@sinica.edu.tw
Cc:  
Subject: Re: gnu/13438: objc forward core dump using system cc
Date: Mon, 27 Mar 2000 18:09:15 +0800

 no more core dump on freebsd 4.0-RELEASE (on K6)
 but the output value is still wrong.
 
 
State-Changed-From-To: open->feedback 
State-Changed-By: mike 
State-Changed-When: Fri Jul 20 17:35:32 PDT 2001 
State-Changed-Why:  

Does this problem still occur in newer versions of FreeBSD, 
such as 4.3-RELEASE? 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=13438 
State-Changed-From-To: feedback->closed 
State-Changed-By: sheldonh 
State-Changed-When: Thu Jan 17 08:12:05 PST 2002 
State-Changed-Why:  
Automatic feedback timeout.  If additional feedback that warrants 
the re-opening of this PR is available but not included in the 
audit trail, please include the feedback in a reply to this message 
(preserving the Subject line) and ask that the PR be re-opened. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=13438 
>Unformatted:
