Go to file
Thiago Macieira 60fc88a09c Resolve some race conditions on tst_QSharedMemory
This test runs fine almost all of the time on systems with 1
processor, which were the norm when the test was written and are still
the way that the Qt Continuous Integration system works as of
today. But it falls flatly on multi-processor systems.

The root of the problem is that QSystemSemaphore recreates the
semaphore if it disappears underneath it. However, the recreation
process is not thread-safe at all: if two threads race to recreate it,
weird things might happen. strace on Linux shows that a thread got
stuck trying to acquire the semaphore:

  <... nanosleep resumed> NULL) = 0
  stat("/tmp/qipc_systemsem_market5c9f73af73334ffe350c60ec076e5744db0ecda3", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
  stat("/tmp/qipc_systemsem_market5c9f73af73334ffe350c60ec076e5744db0ecda3", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
  semget(0x51001388, 1, IPC_CREAT|IPC_EXCL|0600) = -1 EEXIST (File exists)
  semget(0x51001388, 1, IPC_CREAT|0600) = 114786308
  semop(114786308, {{0, -1, SEM_UNDO}}, 1 <unfinished ...>

This problem does not happen if the creation and destruction of the
QSharedMemory (which uses QSystemSemaphore) does not race with other
threads or processes attaching and detaching. For the threads test
it's easy. For the processes, we use stdin and stdout as a
communication channel.

Change-Id: Ie11b135431d4abfc59234654848b67f622eb03c9
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-01-14 11:35:17 +01:00
bin fix installation of aux headers 2012-12-13 09:11:03 +01:00
config.tests Add configure option to minimize xcb runtime dependencies 2012-11-07 16:55:50 +01:00
dist Bump Qt version to 5.0.1 2012-12-21 22:49:02 +01:00
doc Change ftp.qt.nokia.com -> ftp.qt-project.org 2012-12-18 23:13:35 +01:00
examples Doc: corrected typo "the the" 2013-01-11 12:02:21 +01:00
lib Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
mkspecs Support MinGW for CTest test cases 2013-01-09 23:51:48 +01:00
qmake qmake: Add application icon support for windows 2013-01-10 15:13:46 +01:00
src Remove the QtSql driver headers from the API 2013-01-14 11:35:17 +01:00
tests Resolve some race conditions on tst_QSharedMemory 2013-01-14 11:35:17 +01:00
tools configure: Remove left over for -nokia-developer option 2013-01-04 20:43:51 +01:00
util More changes from Nokia to Digia 2012-11-30 00:50:47 +01:00
.gitattributes Update the git-archive export options 2012-09-07 15:39:31 +02:00
.gitignore Add qmake generated files to .gitignore. 2012-12-19 21:31:58 +01:00
.qmake.conf don't auto-install example sources by default for all modules 2012-12-03 15:56:28 +01:00
.tag Update the git-archive export options 2012-09-07 15:39:31 +02:00
configure Remove the framework directories from qmake's default include dirs 2013-01-14 11:35:17 +01:00
configure.bat Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
header.BSD Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
header.FDL Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
header.LGPL Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
header.LGPL-ONLY Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
INSTALL fix links in INSTALL 2012-10-10 08:45:22 +02:00
LGPL_EXCEPTION.txt Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.GPL Add the LICENSE.GPL file to the module referenced from license headers 2012-05-20 22:41:08 +02:00
LICENSE.LGPL Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
LICENSE.PREVIEW.COMMERCIAL Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
qtbase.pro rewrite default spec handling 2012-11-01 20:17:57 +01:00
sync.profile Remove compat, obsolete headers 2012-12-19 23:43:25 +01:00