Subject: pkg/28313: pthread.buildlink3.mk affects non-threaded .so in mysql4-client
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <jarle@uninett.no>
List: pkgsrc-bugs
Date: 11/14/2004 12:07:00
>Number:         28313
>Category:       pkg
>Synopsis:       pthread.buildlink3.mk affects non-threaded .so in mysql4-client
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 14 12:07:00 +0000 2004
>Originator:     Jarle Greipsland
>Release:        NetBSD 2.0_RC4
>Organization:
	
>Environment:
	
	
System: NetBSD festningen.uninett.no 2.0_RC4 NetBSD 2.0_RC4 (FESTNINGEN) #3: Thu Oct 28 19:25:49 CEST 2004 jarle@festningen.uninett.no:/sys/arch/i386/compile/FESTNINGEN i386
Architecture: i386
Machine: i386
>Description:
I have just tried to do an upgrade of the MySQL database on one of my
systems.  I upgraded three packages:

  mysql4-server
  mysql4-client
  p5-DBD-mysql

to the most recent versions.  Immediately after the upgrade, my perl 5.6.1
based applications, that uses the p5-DBD-mysql module through the DBI
interface, died on startup with an "Abort Trap".  A ktrace of the
application revealed that it crashed shortly after having loaded
libpthread.so.0.  That came as a surprise, since the perl 5.6.1 code base
installed by pkgsrc is not thread-aware, and thus the libpthread.so should
not have been required.

I then noticed that all code in the mysql4-client package is built with
pthreads enabled, both the libmysqlclient_r.so and libmysqlclient.so shared
objects.  I think this is a mistake, and that only the libmysqlclient_r.so
should be built with the -pthread flag.

As an experiment, I cleaned out the previous build, ran 'make configure'
for the mysql4-client package again, and then removed all traces of pthread
in the libmysql subdirectory Makefile.  I then ran a 'make install', and
also reinstalled the p5-DBD-mysql package.  Then my perl 5.6.1 based
applications began working normally again.

>How-To-Repeat:
Upgrade the mysql4-client package on a system that still has software
installed that are not pthread-aware.  This certainly applies to perl
5.6.1, but may apply to other software as well
	
>Fix:
	
Make sure that the libmysqlclient.so module is compiled without -pthread,
and that the libmysqlclient_r.so is used by applications requiring pthread
support in the client library.

>Unformatted: