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

Re: qemu-m68k and prlimit64 - segfaults



John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> writes:

> root@pacman:~> ruby2.2 --help
> Segmentation fault

Do you have this patch?

Index: ruby-2.2.3/thread_pthread.c
===================================================================
--- ruby-2.2.3.orig/thread_pthread.c
+++ ruby-2.2.3/thread_pthread.c
@@ -678,15 +678,14 @@ reserve_stack(volatile char *limit, size
 	limit += size;
 	if (limit > end) {
 	    size = limit - end;
-	    limit = alloca(size);
+	    limit = alloca(stack_check_margin+size);
 	    limit[stack_check_margin+size-1] = 0;
 	}
     }
     else {
 	limit -= size;
 	if (buf > limit) {
-	    limit = alloca(buf - limit);
-	    limit -= stack_check_margin;
+	    limit = alloca(buf - limit + stack_check_margin);
 	    limit[0] = 0;
 	}
     }

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Reply to: