Help with some pkgsrc stuff

Hasso Tepper hasso at estpak.ee
Wed Apr 29 00:44:06 PDT 2009


* Mono applications build mostly now after some bugfixes for both mono and 
  DragonFly itself. Applications even run, but die after some seconds of 
  work with following backtrace:

  Core was generated by `mono'.
  Program terminated with signal 4, Illegal instruction.
  #0  0x28265a8c in symlook_list (name=0x804f74b "waitpid",
      hash=226539140, objlist=0x28286408, defobj_out=0xbf9fe1d0,
      in_plt=1 '\001', dlp=0xbf9fe1d4)
      at /home/hasso/dragonfly-src/libexec/rtld-elf/rtld.c:2412
  2412    {
  (gdb) bt
  #0  0x28265a8c in symlook_list (name=0x804f74b "waitpid",
      hash=226539140, objlist=0x28286408, defobj_out=0xbf9fe1d0,
      in_plt=1 '\001', dlp=0xbf9fe1d4)
      at /home/hasso/dragonfly-src/libexec/rtld-elf/rtld.c:2412
  #1  0x282660cc in symlook_default (name=0x804f74b "waitpid",
      hash=226539140, refobj=0x28295000, defobj_out=0xbf9fe21c,
      in_plt=1 '\001')
      at /home/hasso/dragonfly-src/libexec/rtld-elf/rtld.c:2356
  #2  0x28266fc0 in find_symdef (symnum=51, refobj=0x28295000,
      defobj_out=0xbf9fe26c, in_plt=1 '\001', cache=0x0)
      at /home/hasso/dragonfly-src/libexec/rtld-elf/rtld.c:1044
  #3  0x28267395 in _rtld_bind (obj=0x28295000, reloff=96,
      stack=0xbf9fe2a8)
      at /home/hasso/dragonfly-src/libexec/rtld-elf/rtld.c:565
  #4  0x282652d6 in _rtld_bind_start ()
      at /home/hasso/dragonfly-src/libexec/rtld-elf/i386/rtld_start.S:83
  #5  0x28295000 in ?? ()
  #6  0x081850d3 in ?? ()
  #7  0x08193256 in ?? ()
  #8  0x08180e8d in ?? ()
  #9  0x283849c3 in thread_start (arg=0x284a0150)
      at /home/hasso/dragonfly-src/lib/libthread_xu/thread/thr_create.c:241
  #10 0x00000000 in ?? ()

* After applying the attached patch it's possible to compile www/firefox3
  with jemalloc support (would be a good test to compare it with our
  malloc). The problem is that it goes into infinite loop, seems:

  Core was generated by `firefox-bin'.
  Program terminated with signal 11, Segmentation fault.
  #0  0x2809af80 in malloc_init_hard () at jemalloc.c:5194

  5194    {
  (gdb) bt
  #0  0x2809af80 in malloc_init_hard () at jemalloc.c:5194
  #1  0x2809c6c1 in malloc (size=224) at jemalloc.c:5183
  #2  0x2809379e in _thr_alloc (curthread=0x0)
      at /home/hasso/dragonfly-src/lib/libthread_xu/thread/thr_list.c:171
  #3  0x2809201c in _libpthread_init (curthread=0x0)
      at /home/hasso/dragonfly-src/lib/libthread_xu/thread/thr_init.c:215
  #4  0x2809167a in __pthread_mutex_lock (m=0x2809ef74)
      at /home/hasso/dragonfly-src/lib/libthread_xu/thread/thr_private.h:791
  #5  0x2809af9e in malloc_init_hard () at jemalloc.c:1254
  #6  0x2809c6c1 in malloc (size=224) at jemalloc.c:5183
  #7  0x2809379e in _thr_alloc (curthread=0x0)
      at /home/hasso/dragonfly-src/lib/libthread_xu/thread/thr_list.c:171
  #8  0x2809201c in _libpthread_init (curthread=0x0)
      at /home/hasso/dragonfly-src/lib/libthread_xu/thread/thr_init.c:215
  #9  0x2809167a in __pthread_mutex_lock (m=0x2809ef74)
      at /home/hasso/dragonfly-src/lib/libthread_xu/thread/thr_private.h:791
  #10 0x2809af9e in malloc_init_hard () at jemalloc.c:1254
  #11 0x2809c6c1 in malloc (size=224) at jemalloc.c:5183
  #12 0x2809379e in _thr_alloc (curthread=0x0)
  etc etc

Any help to track these problems down is welcome.


-- 
Hasso Tepper
Index: distinfo
===================================================================
RCS file: /NetBSD/pkgsrc/www/firefox3/distinfo,v
retrieving revision 1.24
diff -u -p distinfo
--- distinfo	28 Apr 2009 09:14:25 -0000	1.24
+++ distinfo	29 Apr 2009 07:15:38 -0000
@@ -4,10 +4,11 @@ SHA1 (firefox-3.0.10-source.tar.bz2) = 67f74cac153d37a
 RMD160 (firefox-3.0.10-source.tar.bz2) = 301ecfe77eef5d0b698b1f1d340b952b1a59ab39
 Size (firefox-3.0.10-source.tar.bz2) = 37081374 bytes
 SHA1 (patch-aa) = f995b5e53fa11ecb659ab2dd10551db1c71cc5f3
-SHA1 (patch-ab) = 4a1704e96b74c76adca615fdf2c9069ca17e9d70
+SHA1 (patch-ab) = e64e0a557301fc0412ea5e3d59fbccf6335e00cf
 SHA1 (patch-ac) = af80f061bdd918a61197c9c499e7d1f5b7d10ebd
 SHA1 (patch-ad) = 20f2184a7e5e98b065e884c67e4c17fc52019a79
 SHA1 (patch-ae) = fea251aabc772c3d4ad3044c8295af45cc9cab2d
+SHA1 (patch-af) = 63c226a1ac9db1595a610693fd1fa35f91caf795
 SHA1 (patch-ap) = 552694ac2d6ca713aec98ec394f1215c048c2392
 SHA1 (patch-ax) = cbfe7a6392d5d2fefff123679ba1c056b1cc0aa9
 SHA1 (patch-ba) = 3bd713cf2edcc61f489cea8269ca60e27c26f1d9
Index: patches/patch-ab
===================================================================
RCS file: /NetBSD/pkgsrc/www/firefox3/patches/patch-ab,v
retrieving revision 1.3
diff -u -p patches/patch-ab
--- patches/patch-ab	20 Apr 2009 12:13:03 -0000	1.3
+++ patches/patch-ab	29 Apr 2009 07:15:38 -0000
@@ -1,7 +1,7 @@
 $NetBSD: patch-ab,v 1.3 2009/04/20 12:13:03 hasso Exp $
 
 --- configure.in.orig	2008-11-21 21:37:59 +0200
-+++ configure.in	2009-04-20 13:37:54 +0300
++++ configure.in	2009-04-22 05:48:49 +0300
 @@ -1700,7 +1700,7 @@ case "$target" in
      LDFLAGS=$_SAVE_LDFLAGS
      ;;
@@ -21,7 +21,7 @@ $NetBSD: patch-ab,v 1.3 2009/04/20 12:13:03 hasso Exp 
      ;; 
  
  *-hpux*)
-@@ -2230,7 +2233,14 @@ case "$target" in
+@@ -2230,8 +2233,15 @@ case "$target" in
      if test "$LIBRUNPATH"; then
  	DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
      fi
@@ -29,13 +29,14 @@ $NetBSD: patch-ab,v 1.3 2009/04/20 12:13:03 hasso Exp 
 +    alpha*)
 +       CFLAGS="$CFLAGS -mieee"
 +       CXXFLAGS="$CXXFLAGS -mieee"
-     ;;
-+    esac
 +    ;;
-+
++    esac
+     ;;
  
++
  *-openvms*) 
      AC_DEFINE(NO_PW_GECOS)
+     AC_DEFINE(NO_UDSOCK)
 @@ -2979,6 +2989,9 @@ dnl ====================================
  case $target in
  *-hpux11.*)
@@ -55,3 +56,13 @@ $NetBSD: patch-ab,v 1.3 2009/04/20 12:13:03 hasso Exp 
  fi
  
  MOZ_ARG_ENABLE_STRING(optimize,
+@@ -6319,6 +6332,9 @@ if test "$MOZ_MEMORY"; then
+   netbsd*)
+     AC_DEFINE(MOZ_MEMORY_BSD)
+     ;;
++  dragonfly*)
++    AC_DEFINE(MOZ_MEMORY_BSD)
++    ;;
+   solaris*)
+     AC_DEFINE(MOZ_MEMORY_SOLARIS)
+     ;;
? patches/patch-af
--- /dev/null	2009-04-29 09:52:49 +0300
+++ patches/patch-af	2009-04-29 10:00:51 +0300
@@ -0,0 +1,119 @@
+--- memory/jemalloc/jemalloc.c.orig	2008-11-19 09:16:19 +0200
++++ memory/jemalloc/jemalloc.c	2009-04-29 08:44:01 +0300
+@@ -337,7 +337,7 @@ __FBSDID("$FreeBSD: src/lib/libc/stdlib/
+ #endif
+ 
+ #ifdef MOZ_MEMORY_DARWIN
+-static const bool __isthreaded = true;
++static const bool __isfthreaded = true;
+ #endif
+ 
+ #define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var))
+@@ -382,7 +382,7 @@ static const bool __isthreaded = true;
+ #endif
+ #define PIC
+ #ifndef MOZ_MEMORY_DARWIN
+-static const bool __isthreaded = true;
++static const bool __isfthreaded = true;
+ #else
+ #  define NO_TLS
+ #endif
+@@ -1216,7 +1216,7 @@ static bool
+ malloc_mutex_init(malloc_mutex_t *mutex)
+ {
+ #if defined(MOZ_MEMORY_WINDOWS)
+-	if (__isthreaded)
++	if (__isfthreaded)
+ 		if (! __crtInitCritSecAndSpinCount(mutex, _CRT_SPINCOUNT))
+ 			return (true);
+ #elif defined(MOZ_MEMORY_DARWIN)
+@@ -1253,7 +1253,7 @@ malloc_mutex_lock(malloc_mutex_t *mutex)
+ #elif defined(MOZ_MEMORY)
+ 	pthread_mutex_lock(mutex);
+ #else
+-	if (__isthreaded)
++	if (__isfthreaded)
+ 		_SPINLOCK(&mutex->lock);
+ #endif
+ }
+@@ -1269,7 +1269,7 @@ malloc_mutex_unlock(malloc_mutex_t *mute
+ #elif defined(MOZ_MEMORY)
+ 	pthread_mutex_unlock(mutex);
+ #else
+-	if (__isthreaded)
++	if (__isfthreaded)
+ 		_SPINUNLOCK(&mutex->lock);
+ #endif
+ }
+@@ -1278,7 +1278,7 @@ static bool
+ malloc_spin_init(malloc_spinlock_t *lock)
+ {
+ #if defined(MOZ_MEMORY_WINDOWS)
+-	if (__isthreaded)
++	if (__isfthreaded)
+ 		if (! __crtInitCritSecAndSpinCount(lock, _CRT_SPINCOUNT))
+ 			return (true);
+ #elif defined(MOZ_MEMORY_DARWIN)
+@@ -1313,7 +1313,7 @@ malloc_spin_lock(malloc_spinlock_t *lock
+ #elif defined(MOZ_MEMORY)
+ 	pthread_mutex_lock(lock);
+ #else
+-	if (__isthreaded)
++	if (__isfthreaded)
+ 		_SPINLOCK(&lock->lock);
+ #endif
+ }
+@@ -1328,7 +1328,7 @@ malloc_spin_unlock(malloc_spinlock_t *lo
+ #elif defined(MOZ_MEMORY)
+ 	pthread_mutex_unlock(lock);
+ #else
+-	if (__isthreaded)
++	if (__isfthreaded)
+ 		_SPINUNLOCK(&lock->lock);
+ #endif
+ }
+@@ -1383,7 +1383,7 @@ malloc_spin_lock(pthread_mutex_t *lock)
+ {
+ 	unsigned ret = 0;
+ 
+-	if (__isthreaded) {
++	if (__isfthreaded) {
+ 		if (_pthread_mutex_trylock(lock) != 0) {
+ 			unsigned i;
+ 			volatile unsigned j;
+@@ -1416,7 +1416,7 @@ static inline void
+ malloc_spin_unlock(pthread_mutex_t *lock)
+ {
+ 
+-	if (__isthreaded)
++	if (__isfthreaded)
+ 		_pthread_mutex_unlock(lock);
+ }
+ #endif
+@@ -2558,7 +2558,7 @@ choose_arena(void)
+ 	 * introduces a bootstrapping issue.
+ 	 */
+ #ifndef NO_TLS
+-	if (__isthreaded == false) {
++	if (__isfthreaded == false) {
+ 	    /* Avoid the overhead of TLS for single-threaded operation. */
+ 	    return (arenas[0]);
+ 	}
+@@ -2574,7 +2574,7 @@ choose_arena(void)
+ 		assert(ret != NULL);
+ 	}
+ #else
+-	if (__isthreaded && narenas > 1) {
++	if (__isfthreaded && narenas > 1) {
+ 		unsigned long ind;
+ 
+ 		/*
+@@ -2631,7 +2631,7 @@ choose_arena_hard(void)
+ {
+ 	arena_t *ret;
+ 
+-	assert(__isthreaded);
++	assert(__isfthreaded);
+ 
+ #ifdef MALLOC_BALANCE
+ 	/*




More information about the Users mailing list