pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/42282: boehm-gc segfaults on -current



>Number:         42282
>Category:       pkg
>Synopsis:       boehm-gc segfaults on -current
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 08 08:25:00 +0000 2009
>Originator:     enami tsugutomo
>Release:        NetBSD 5.99.21
>Organization:
>Environment:
System: NetBSD read-fault.enami.but-b.or.jp 5.99.21 NetBSD 5.99.21 (GENERIC) 
#0: Sun Nov 1 09:56:31 JST 2009 
enami%red-pepper.enami.but-b.or.jp@localhost:/write-fault/tmp/current/obj.i386/sys/arch/i386/compile/GENERIC
 i386
Architecture: i386
Machine: i386
>Description:
        boehm-gc segfaults when built on -current with new binutils
        (at least on i386 and amd64).
>How-To-Repeat:
        do
                cd pkgsrc/devel/boehm-gc
                make
                make do-test
        and see the gctest command fails as follows:

/bin/sh ./libtool --tag=CC --mode=link cc -fexceptions -I libatomic_ops/src -O2 
-pipe -march=pentiumpro  -Wl,-R/usr/pkg/lib -o gctest  tests/test.o ./libgc.la  
cc -fexceptions -Ilibatomic_ops/src -O2 -pipe -march=pentiumpro 
-Wl,-R/usr/pkg/lib -o .libs/gctest tests/test.o  ./.libs/libgc.so 
-L/pkgsrc/devel/boehm-gc/work.i386/.buildlink/lib  -Wl,--rpath -Wl,/usr/pkg/lib
creating gctest
[1]   Segmentation fault (core dumped) ./gctest
*** Error code 139

>Fix:
        here is my fix:

--- dyn_load.c.orig     2008-09-19 00:43:38.000000000 +0900
+++ dyn_load.c  2009-11-07 06:26:16.000000000 +0900
@@ -78,6 +78,8 @@
 #endif
 
 #if defined(NETBSD)
+#   include <sys/param.h>
+#   include <dlfcn.h>
 #   include <machine/elf_machdep.h>
 #   define ELFSIZE ARCH_ELFSIZE
 #endif
@@ -499,6 +502,15 @@
         return(0);
     }
     if( cachedResult == 0 ) {
+#if defined(NETBSD) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 
599001900
+        struct link_map *lm = NULL;
+        int rv = dlinfo(RTLD_SELF, RTLD_DI_LINKMAP, &lm); 
+        if (rv != 0)
+            return (0);
+        if (lm == NULL)
+            return (0);
+        cachedResult = lm;
+#else  /* !(defined(NETBSD) && __NetBSD_Version__ >= 599001900) */
         int tag;
         for( dp = _DYNAMIC; (tag = dp->d_tag) != 0; dp++ ) {
             if( tag == DT_DEBUG ) {
@@ -508,6 +520,7 @@
                 break;
             }
         }
+#endif /* !(defined(NETBSD) && __NetBSD_Version__ >= 599001900) */
     }
     return cachedResult;
 }



Home | Main Index | Thread Index | Old Index