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

Bug#444481: mldonkey-server: mlnet does not start on alpha



Ohh... now even not modified sources build into segfaulting code:

3:33 pts/7 sacha@vinci:~/work/mldonkey-2.9.1 14> gdb ./mlnet
GNU gdb 6.4.90-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "alpha-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) start
Breakpoint 1 at 0x1203e3584
Starting program: /home/sacha-utf/work/mldonkey-2.9.1/mlnet 
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 408)]
[Switching to Thread 16384 (LWP 408)]
0x00000001203e3584 in main ()
(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x000000012033b5a4 in camlPrintf__entry ()

I see one major difference of my build from original one from
unstable: since I am building on etch I changed Build-Depends to
compile with ocaml 3.09, not 3.10.

Not clean patch to build on alpha using statvfs instead of statfs
attached.

--- src/utils/lib/stubs_c.c.orig	2007-10-06 03:37:41.000000000 +0400
+++ src/utils/lib/stubs_c.c.vfs	2007-10-06 02:57:33.000000000 +0400
@@ -17,6 +17,7 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
+#include <sys/statvfs.h>
 #include "../../utils/lib/os_stubs.h"
 
 #include <string.h> 
@@ -1074,7 +1075,7 @@
 
 #ifdef HAVE_STATS
 static value
-#if ((defined (sun) || defined (__sun__))) || (defined(__NetBSD__) && (__NetBSD_Version__ > 299000000)) || defined (__hpux__)
+#if ((defined (sun) || defined (__sun__))) || (defined(__NetBSD__) && (__NetBSD_Version__ > 299000000)) || defined (__hpux__) || defined(__alpha__)
 copy_statfs (struct statvfs *buf)
 #else
 copy_statfs (struct statfs *buf)
@@ -1083,7 +1084,7 @@
   CAMLparam0 ();
   CAMLlocal2 (bufv, v);
   bufv = caml_alloc (11, 0);
-#if ((defined (sun) || defined (__sun__))) || (defined(__FreeBSD__) && __FreeBSD_version >= 503001) || defined(__OpenBSD__) || defined(__NetBSD__)
+#if ((defined (sun) || defined (__sun__))) || (defined(__FreeBSD__) && __FreeBSD_version >= 503001) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__alpha__)
   v = copy_int64 (-1); caml_modify (&Field (bufv, 0), v);
 #else
   v = copy_int64 (buf->f_type); caml_modify (&Field (bufv, 0), v);
@@ -1094,10 +1095,14 @@
   v = copy_int64 (buf->f_bavail); caml_modify (&Field (bufv, 4), v);
   v = copy_int64 (buf->f_files); caml_modify (&Field (bufv, 5), v);
   v = copy_int64 (buf->f_ffree); caml_modify (&Field (bufv, 6), v);
-#if ((defined (sun) || defined (__sun__))) || defined (__hpux__)
+#if ((defined (sun) || defined (__sun__))) || defined (__hpux__) || defined(__alpha__)
   v = copy_int64 (-1); caml_modify (&Field (bufv, 7), v);
   v = copy_int64 (buf->f_namemax); caml_modify (&Field (bufv, 8), v);
+# if ! defined(__alpha__)
   v = copy_string (buf->f_basetype); caml_modify (&Field (bufv, 9), v);
+# else
+  v = copy_string ("-1"); caml_modify (&Field (bufv, 9), v);
+# endif
   v = copy_int64 (buf->f_frsize); caml_modify (&Field (bufv, 10), v);
 #else
 #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__DragonFly__)
@@ -1126,7 +1131,7 @@
   CAMLparam1 (pathv);
   CAMLlocal1 (bufv);
   const char *path = String_val (pathv);
-#if ((defined (sun) || defined (__sun__))) || (defined(__NetBSD__) && (__NetBSD_Version__ > 299000000)) || defined (__hpux__)
+#if ((defined (sun) || defined (__sun__))) || (defined(__NetBSD__) && (__NetBSD_Version__ > 299000000)) || defined (__hpux__) || defined(__alpha__)
   struct statvfs buf;
   if (statvfs (path, &buf) == -1)
 #else

>>>>> On Fri, 5 Oct 2007 19:09:24 +0100
>>>>> "sv" == spiral voice <spiralvoice@hotmail.com> wrote:
sv> 
sv> Hi,
sv> your bug looks similar to this one:
sv> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=280213
sv> 
sv> Please try this patch to enable usage of statvfs() instead of statfs()
sv> 
sv> diff -a -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x '*.cmi' -x '*.cma' -x '*.cmo' -x '*.cmx' -x '*.cmxa' -x '*.a' -x '*.o' -x .depend -x Makefile -x mlnet -x ocamlpp.byte -N -r -u ./src/utils/lib/stubs_c.c ./src/utils/lib/stubs_c.c
sv> --- ./src/utils/lib/stubs_c.c	2007-01-08 12:02:08.000000000 +0100
sv> +++ ./src/utils/lib/stubs_c.c	2007-10-05 20:06:35.000000000 +0200
sv> @@ -1074,7 +1074,7 @@
sv>  
sv>  #ifdef HAVE_STATS
sv>  static value
sv> -#if ((defined (sun) || defined (__sun__))) || (defined(__NetBSD__) && (__NetBSD_Version__> 299000000)) || defined (__hpux__)
sv> +#if ((defined (sun) || defined (__sun__))) || (defined(__NetBSD__) && (__NetBSD_Version__> 299000000)) || defined (__hpux__) || defined(__alpha__)
sv>  copy_statfs (struct statvfs *buf)
sv>  #else
sv>  copy_statfs (struct statfs *buf)
sv> @@ -1126,7 +1126,7 @@
sv>    CAMLparam1 (pathv);
sv>    CAMLlocal1 (bufv);
sv>    const char *path = String_val (pathv);
sv> -#if ((defined (sun) || defined (__sun__))) || (defined(__NetBSD__) && (__NetBSD_Version__> 299000000)) || defined (__hpux__)
sv> +#if ((defined (sun) || defined (__sun__))) || (defined(__NetBSD__) && (__NetBSD_Version__> 299000000)) || defined (__hpux__) || defined(__alpha__)
sv>    struct statvfs buf;
sv>    if (statvfs (path, &buf) == -1)
sv>  #else
sv> 
sv> Greetings, spiralvoice
sv> 
sv> _________________________________________________________________
sv> Freunde treffen. Jetzt den Windows Live™ Messenger downloaden!
sv> Windows Live Writer Beta - Veröffentlichen Sie Multimediainhalte in Ihrem Blog!
sv> 
-- 
Alexander Kotelnikov
Saint-Petersburg, Russia

Reply to: