Browse Source

x86: fix segfaults on SMP machine

As reported by Bering-uClibc project uClibc-ng for x86
generates a segfault on SMP machines when trying to run ntpd.

A small test case is here: https://gist.github.com/ddrown

Use a similar nop instruction as for x86_64 in the code.

Signed-off-by: KP.Kirchdoerfer <kapeka@bering-uclibc.de>
Waldemar Brodkorb 6 years ago
parent
commit
d183d93e47
1 changed files with 2 additions and 0 deletions
  1. 2 0
      libc/sysdeps/linux/i386/sigaction.c

+ 2 - 0
libc/sysdeps/linux/i386/sigaction.c

@@ -115,6 +115,7 @@ libc_hidden_weak(sigaction)
 /* The return code for realtime-signals.  */
 # define RESTORE2(name, syscall) \
 __asm__	(						\
+	"nop\n"						\
 	".text\n"					\
 	"__" #name ":\n"				\
 	"	movl	$" #syscall ", %eax\n"		\
@@ -128,6 +129,7 @@ RESTORE(restore_rt, __NR_rt_sigreturn)
 # undef RESTORE2
 # define RESTORE2(name, syscall) \
 __asm__ (						\
+	"nop\n"						\
 	".text\n"					\
 	"__" #name ":\n"				\
 	"	popl	%eax\n"				\