<?xml version="1.0" encoding="utf-8"?>
<bug><id>26582</id><link>http://bugs.mysql.com/bug.php?id=26582</link><status>No Feedback</status><category>Server</category><sdesc>Crash in multi-thread apps due to signal(2) in libmysqlclient/taocrypt</sdesc><ldesc>I&#039;m forwarding a bug reported by Mariano Santamarina &lt;msantamarina@gmail.com&gt; 
on http://bugs.debian.org/412024. I&#039;ve not yet tested the patch nor verified 
the problem. -chrstian-
---------------------------------------------------

Using libmysqlclient in multi-threaded enviroments like java can result in:
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGILL (0x4) at pc=0x00000000, pid=10933, tid=2877021104
#
# Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-03 mixed mode)
# An error report file with more information is saved as 
hs_err_pid10933.log
#
# If you would like to submit a bug report, please visit:
#   http://www.blackdown.org/cgi-bin/jdk
#

After two days finding the bug. i discovered that in the taocrypt 
library included in libmysql are calls to signal(...).

In the signal(2) Manual Page. Section NOTES says: &quot;The effects of this 
call in a multi-threaded process are unspecified...&quot; (indeed is true)

My modest solution is to relace signal(...) with pthread_sigmask(...) 
and sigaction(...)

Attached is the patch

Thanks.
PD: Sorry form my poor english.
</ldesc><reporter>16744</reporter><submitted>1172187687</submitted><modified>1176737477</modified><version>5.0.32</version><os>Linux (Debian GNU/Linux)</os><cpu_arch>Any</cpu_arch><severity>S3 (Non-critical)</severity></bug>