paulfloyd / freebsd_valgrind

Git repo used to Upstream the FreeBSD Port of Valgrind
GNU General Public License v2.0
15 stars 4 forks source link

scalar, SYS_sysarch test causes valgrind internal error [x86] #107

Closed nbriggs closed 4 years ago

nbriggs commented 4 years ago

Looks likes lots of progress in scalar test, but for x86 I'm seeing:

---------------------------------------------------------
165:             SYS_sysarch 2s 1m
---------------------------------------------------------
==34869== Syscall param sysarch(number) contains uninitialised byte(s)
==34869==    at 0x7353599: syscall (in /lib/libc.so.7)
==34869==    by 0x40643C: main (scalar.c:609)
==34869== 
==34869== Syscall param sysarch(args) contains uninitialised byte(s)
==34869==    at 0x7353599: syscall (in /lib/libc.so.7)
==34869==    by 0x40643C: main (scalar.c:609)
==34869== 
--34869:2:  stacks   segment for SP 0x0 is not RW or not a SmUpper Resvn
==34869== Syscall param i386_get_gsbase(basep) points to unaddressable byte(s)
==34869==    at 0x7353599: syscall (in /lib/libc.so.7)
==34869==    by 0x40643C: main (scalar.c:609)
==34869==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==34869== 
--34869-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) - exiting
--34869-- si_code=1;  Faulting address: 0x0;  sp: 0x52c4df0

valgrind: the 'impossible' happened:
   Killed by fatal signal

host stacktrace:
==34869==    at 0x3813F01A: ??? (in /usr/local/lib/valgrind/memcheck-x86-freebsd)
==34869==    by 0x38124B79: ??? (in /usr/local/lib/valgrind/memcheck-x86-freebsd)
==34869==    by 0x38123205: ??? (in /usr/local/lib/valgrind/memcheck-x86-freebsd)
==34869==    by 0x3812DF84: ??? (in /usr/local/lib/valgrind/memcheck-x86-freebsd)

sched status:
  running_tid=1

Thread 1: status = VgTs_Runnable syscall 165 (lwpid 100489)
==34869==    at 0x7353599: syscall (in /lib/libc.so.7)
==34869==    by 0x40643C: main (scalar.c:609)
client stack range: [0xFBBFD000 0xFBBFEFFF] client SP: 0xFBBFE800
valgrind stack range: [0x51C5000 0x52C4FFF] top usage: 5484 of 1048576

scalar.c:609 is the last line here:

   /* SYS_sysarch                 165 */
#if defined (VGP_x86_freebsd)
   GO(SYS_sysarch, "2s 1m");
   SY(SYS_sysarch, x0+I386_GET_GSBASE, x0); FAIL;
paulfloyd commented 4 years ago

This crash fixed with To https://github.com/paulfloyd/freebsd_valgrind.git a24a06399..b2c3ba607 freebsd -> freebsd

Still much to do with scalar.