Bug #14164 IM tests fail on MacOS X (powermacg5)
Submitted: 20 Oct 2005 0:40 Modified: 27 Oct 2005 0:22
Reporter: Petr Chardin Email Updates:
Status: Closed Impact on me:
Category:Instance Manager Severity:S3 (Non-critical)
Version:mysql-5.0 OS:Mac OS X (Mac OS X (Darwin 8.2.0 kernel))
Assigned to: Petr Chardin CPU Architecture:Any

[20 Oct 2005 0:40] Petr Chardin
Instance manager tests fail on MacOSX

TEST                           RESULT

im_life_cycle                  [ fail ]

Errors are (from /Users/mysqldev/petr/mysql-5.0.15/mysql-test/var/log/mysqltest-time) :
mysqltest: At line 22: query 'SHOW INSTANCE STATUS mysqld1' failed: 2013: Lost connection to MySQL server during query
(the last lines may be the most important ones)

The reason seems to be similar to what was reported in Bug #2039

How to repeat:
run tests
[20 Oct 2005 0:49] Petr Chardin
IM shutdowns right after the test start. The reason is similar to Bug #2030:
IM gets a lot of SIGHUP signals without a reason. If we block SIGHUP, se start getting
SIGINT. If we disable both SIGHUP and SIGINT we start getting SIGQUIT.
The behaviour is strange, but I didn't find any mention of this problem besides then in the Guilhem's Bug (#2030).
The only solution I can see is to disable all three signals.
[26 Oct 2005 23:27] Petr Chardin
Further investigation showed that on some (all?)
Darwin kernels a kill() results in two signals for most
signals. These are SIGHUP and the signal we sent.
E.g. kill -SIGTERM results in SIGHUP and SIGTERM
delivered to a process. To workaround this problem,
we should skip SIGHUP processing on some Darwin
kernels. This was originally pushed as temporary fix,
but now appears to be best solution.

This problem was reported to Apple as BUG# 4317584
Attaching a test program one could use to check the problem.
[26 Oct 2005 23:28] Petr Chardin
a test program to check signal processing

Attachment: signals.c (text/x-csrc), 1.04 KiB.

[27 Oct 2005 0:08] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

[27 Oct 2005 0:22] Petr Chardin
Temporary fix appeared to be the best solution. 
Added a comment to the source. Closing the bug.