|
From: <sv...@va...> - 2014-09-05 23:58:07
|
Author: philippe
Date: Fri Sep 5 23:57:57 2014
New Revision: 14475
Log:
Fix 338698 race condition between gdbsrv and vgdb on startup
Modified:
trunk/NEWS
trunk/coregrind/m_gdbserver/remote-utils.c
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Fri Sep 5 23:57:57 2014
@@ -309,6 +309,7 @@
338499 --sim-hints parsing broken due to wrong order in tokens
338615 suppress glibc 2.20 optimized strcmp implementation for ARMv7
338681 Unable to unwind through clone thread created on i386-linux
+338698 race condition between gdbsrv and vgdb on startup
338703 helgrind on arm-linux gets false positives in dynamic loader
n-i-bz Fix KVM_CREATE_IRQCHIP ioctl handling
n-i-bz s390x: Fix memory corruption for multithreaded applications
Modified: trunk/coregrind/m_gdbserver/remote-utils.c
==============================================================================
--- trunk/coregrind/m_gdbserver/remote-utils.c (original)
+++ trunk/coregrind/m_gdbserver/remote-utils.c Fri Sep 5 23:57:57 2014
@@ -390,11 +390,6 @@
VG_(unlink)(to_gdb);
VG_(unlink)(shared_mem);
- safe_mknod(from_gdb);
- safe_mknod(to_gdb);
-
- pid_from_to_creator = pid;
-
o = VG_(open) (shared_mem, VKI_O_CREAT|VKI_O_RDWR, 0600);
if (sr_isError (o)) {
sr_perror(o, "cannot create shared_mem file %s\n", shared_mem);
@@ -421,6 +416,15 @@
}
shared = (VgdbShared*) addr_shared;
VG_(close) (shared_mem_fd);
+
+ safe_mknod(to_gdb);
+ safe_mknod(from_gdb);
+ /* from_gdb is the last resource created: vgdb searches such FIFOs
+ to detect the presence of a valgrind process.
+ So, we better create this resource when all the rest needed by
+ vgdb is ready : the other FIFO and the shared memory. */
+
+ pid_from_to_creator = pid;
}
setup_remote_desc_for_reading ();
|