Re: [Valgrind-users] Current git fails to compile on macOS

2018-04-14 Thread Philippe Waroquiers
On Sat, 2018-04-14 at 13:37 -0400, IMoL wrote:
> Thank you Philippe.
> 
> That patch allows valgrind to compile on macOS.
thanks for the feedback, patch committed as
06cb991bcd9966b614cd672a7d6e26785f60f851

> 
> Still doesn't work for me, mind you, but at least it compiles again :-)
Someone with more Macos knowledge will have to step in ...

Philippe


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users


Re: [Valgrind-users] Current git fails to compile on macOS

2018-04-14 Thread IMoL
Thank you Philippe.

That patch allows valgrind to compile on macOS.

Still doesn't work for me, mind you, but at least it compiles again :-)

- Andy

On Sat, Apr 14, 2018 at 12:24 PM, Philippe Waroquiers <
philippe.waroqui...@skynet.be> wrote:

> On Fri, 2018-04-13 at 05:56 -0400, IMoL wrote:
> > git-1f08787cf (of 11 April) fails to build on macOS:
> >
> > m_syswrap/syswrap-generic.c:1797:26: error: variable has incomplete
> type 'struct vki_semid64_ds'
> >struct vki_semid64_ds buf;
> >  ^
> > m_syswrap/syswrap-generic.c:1797:11: note: forward declaration of
> 'struct vki_semid64_ds'
> >struct vki_semid64_ds buf;
> >   ^
> > m_syswrap/syswrap-generic.c:1798:8: error: no member named 'buf64' in
> 'union semun'
> >arg.buf64 = 
> >~~~ ^
> >
> >
> > Looks related to this commit from 1 April (git-54145019b):
> >
> > "n-i-bz Fix possible stack trashing by semctl syscall wrapping"
> Can you try the attached patch ?
> Thanks
> Philippe
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users


Re: [Valgrind-users] Current git fails to compile on macOS

2018-04-14 Thread Philippe Waroquiers
On Fri, 2018-04-13 at 05:56 -0400, IMoL wrote:
> git-1f08787cf (of 11 April) fails to build on macOS:
> 
> m_syswrap/syswrap-generic.c:1797:26: error: variable has incomplete type 
> 'struct vki_semid64_ds'
>    struct vki_semid64_ds buf;
>                          ^
> m_syswrap/syswrap-generic.c:1797:11: note: forward declaration of 'struct 
> vki_semid64_ds'
>    struct vki_semid64_ds buf;
>           ^
> m_syswrap/syswrap-generic.c:1798:8: error: no member named 'buf64' in 'union 
> semun'
>    arg.buf64 = 
>    ~~~ ^
> 
> 
> Looks related to this commit from 1 April (git-54145019b):
> 
> "n-i-bz Fix possible stack trashing by semctl syscall wrapping" 
Can you try the attached patch ?
Thanks
Philippe
diff --git a/coregrind/m_syswrap/syswrap-generic.c 
b/coregrind/m_syswrap/syswrap-generic.c
index 5bb6f47df..8b3d6fc72 100644
--- a/coregrind/m_syswrap/syswrap-generic.c
+++ b/coregrind/m_syswrap/syswrap-generic.c
@@ -1794,13 +1794,20 @@ UInt get_sem_count( Int semid )
SysRes res;
 
 #  if defined(__NR_semctl)
+#  if defined(VGO_darwin)
+   /* Darwin has no specific 64 bit semid_ds, but has __NR_semctl. */
+   struct vki_semid_ds buf;
+   arg.buf = 
+#  else
struct vki_semid64_ds buf;
arg.buf64 = 
+#  endif
res = VG_(do_syscall4)(__NR_semctl, semid, 0, VKI_IPC_STAT, *(UWord *));
if (sr_isError(res))
   return 0;
 
return buf.sem_nsems;
+
 #  elif defined(__NR_semsys) /* Solaris */
struct vki_semid_ds buf;
arg.buf = 
@@ -1810,6 +1817,7 @@ UInt get_sem_count( Int semid )
   return 0;
 
return buf.sem_nsems;
+
 #  else
struct vki_semid_ds buf;
arg.buf = 
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users


[Valgrind-users] Current git fails to compile on macOS

2018-04-13 Thread IMoL
git-1f08787cf (of 11 April) fails to build on macOS:

m_syswrap/syswrap-generic.c:1797:26: error: variable has incomplete type
'struct vki_semid64_ds'
   struct vki_semid64_ds buf;
 ^
m_syswrap/syswrap-generic.c:1797:11: note: forward declaration of 'struct
vki_semid64_ds'
   struct vki_semid64_ds buf;
  ^
m_syswrap/syswrap-generic.c:1798:8: error: no member named 'buf64' in
'union semun'
   arg.buf64 = 
   ~~~ ^


Looks related to this commit from 1 April (git-54145019b):

"n-i-bz Fix possible stack trashing by semctl syscall wrapping"
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users