Skip to content

Commit

Permalink
libev: fix memory fence on i386 under valgrind
Browse files Browse the repository at this point in the history
problem: libev accesses one byte past the end of the stack in its custom
assembly memory fence.  I have no idea why, it doesn't help, and causes
valgrind to throw a warning every single time it gets invoked.

solution: Apply this patch identified for debian upstream in 2017 so it
will stop doing that: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=850861
  • Loading branch information
trws committed Aug 20, 2024
1 parent f9bcdbe commit 8032b48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/libev/ev.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ struct signalfd_siginfo
#if ECB_GCC_VERSION(2,5) || defined __INTEL_COMPILER || (__llvm__ && __GNUC__) || __SUNPRO_C >= 0x5110 || __SUNPRO_CC >= 0x5110
#define ECB_MEMORY_FENCE_RELAXED __asm__ __volatile__ ("" : : : "memory")
#if __i386 || __i386__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("lock; orb $0, -1(%%esp)" : : : "memory")
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("lock; orb $0, 0(%%esp)" : : : "memory")
#define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("" : : : "memory")
#define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("" : : : "memory")
#elif ECB_GCC_AMD64
Expand Down

0 comments on commit 8032b48

Please sign in to comment.