Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Jan 1999 17:01:47 -0800 (PST)
From:      asami@cs.berkeley.edu (Satoshi Asami)
To:        mmcg@cs.monash.edu.au
Cc:        fn@hungry.org, ports@FreeBSD.ORG
Subject:   [fn@hungry.org: a patch for ports/devel/boehms-gc (on 3.0, against ports-current)]
Message-ID:  <199901020101.RAA05934@bubble.didi.com>

next in thread | raw e-mail | index | archive | help
------- Start of forwarded message -------
From: Faried Nawaz <fn@hungry.org>
To: freebsd-ports@FreeBSD.ORG
Subject: a patch for ports/devel/boehms-gc (on 3.0, against ports-current)
Date: Thu, 31 Dec 1998 21:04:38 -0800 (PST)


I see that this port is still broken in current.  Here's a patch that gets
it to build properly on 3.0.

- --- mach_dep.c_ORIG	Thu Dec 31 12:30:05 1998
+++ mach_dep.c	Thu Dec 31 12:45:03 1998
@@ -170,7 +170,7 @@
 
 #       if defined(I386) &&!defined(OS2) &&!defined(SVR4) &&!defined(MSWIN32) \
 	&& !defined(SCO) && !(defined(LINUX) && defined(__ELF__)) \
- -	&& !defined(DOS4GW)
+	&& !defined(DOS4GW) && !(defined(FREEBSD) && defined(__ELF__))
 	/* I386 code, generic code does not appear to work */
 	/* It does appear to work under OS2, and asms dont */
 	/* This is used for some 38g UNIX variants and for CYGWIN32 */
@@ -183,7 +183,8 @@
 	  asm("pushl %ebx");  asm("call _GC_push_one"); asm("addl $4,%esp");
 #       endif
 
- -#	if defined(I386) && defined(LINUX) && defined(__ELF__)
+#	if defined(I386) && ((defined(LINUX) && defined(__ELF__)) || \
+	(defined(FREEBSD) && defined(__ELF__)))
 	/* This is modified for Linux with ELF (Note: _ELF_ only) */
 	  asm("pushl %eax");  asm("call GC_push_one"); asm("addl $4,%esp");
 	  asm("pushl %ecx");  asm("call GC_push_one"); asm("addl $4,%esp");

I believe it'll still build on 2.2.x with the above patch.

On 3.0, it works, and passes the setjmp_test and gctest, but fails on the
cordtest (coredump):

knife# gdb -q cord/cordtest
(gdb) r
Starting program: /usr/ports/devel/boehm-gc/work/gc/cord/cordtest 

Program received signal SIGBUS, Bus error.
0x805274e in GC_find_limit (p=0xefbfd43c "\220!\005\bLt?o!!\005\b", up=1)
    at os_dep.c:522
522                     GC_noop1((word)(*result));
(gdb) where
#0  0x805274e in GC_find_limit (p=0xefbfd43c "\220!\005\bLt?o!!\005\b", #up=1)
    at os_dep.c:522
#1  0x8052795 in GC_get_stack_base () at os_dep.c:556
#2  0x80521a1 in GC_init_inner () at misc.c:444
#3  0x804ea2e in GC_generic_malloc_inner (lb=3, k=0) at malloc.c:61
#4  0x804eb7b in GC_generic_malloc (lb=3, k=0) at malloc.c:121
#5  0x804ebeb in GC_malloc_atomic (lb=3) at malloc.c:160
#6  0x804c392 in CORD_from_char_star (s=0x8055d36 "ab")
    at ./cord/cordxtra.c:241
#7  0x8048ced in test_basics () at ./cord/cordtest.c:51
#8  0x804a350 in main () at ./cord/cordtest.c:223
#9  0x8048b29 in _start ()
(gdb) 


This may have something to do with how boehm-gc is given values for
DATAEND.


Oh, another thing. I checked this exact port (for boehm-gc 4.12) on 2.2.6,
and while it passed the setjmp_test and coredump test (the latter with a
few leakage warnings), it leaked all over the place with the gc_test.



I really really really would like this port to work, but I don't know or
understand how I can find out about stacks, data segments and memory
locations for them.  Can someone recommend a good guide?  Docs, preferably,
though I can probably figure this stuff out from sources (if someone points
me to the right areas).  I've poked around src/lib/csu and, but am still
lost.


Thanks,

faried.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message
------- End of forwarded message -------

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901020101.RAA05934>