diff options
author | taca <taca@pkgsrc.org> | 2009-10-21 04:21:27 +0000 |
---|---|---|
committer | taca <taca@pkgsrc.org> | 2009-10-21 04:21:27 +0000 |
commit | 535a7a1007c15fe7f3822288b1913aae31ad35c3 (patch) | |
tree | 42861b0f6f83bb638d74b4393114454335c5ed60 /databases/unixodbc | |
parent | b306c428e05f2f0c91c646635113b1835abfb85e (diff) | |
download | pkgsrc-535a7a1007c15fe7f3822288b1913aae31ad35c3.tar.gz |
Try to fix some pthread problems detected on NetBSD 4.0_STABLE
(and may be later).
* When connecting a SQL server, isql crashed.
isql: Error detected by libpthread: Unlocking unlocked mutex.
* Setting "Threding = 0" in odbcinst.ini, isql crashed when closing
connection to a SQL server.
isql: Error detected by libpthread: Destroying locked mutex.
I've checked mutex handling and created patches.
Bump PKGREVISION.
Diffstat (limited to 'databases/unixodbc')
-rw-r--r-- | databases/unixodbc/Makefile | 4 | ||||
-rw-r--r-- | databases/unixodbc/distinfo | 8 | ||||
-rw-r--r-- | databases/unixodbc/patches/patch-ad | 26 | ||||
-rw-r--r-- | databases/unixodbc/patches/patch-ae | 21 | ||||
-rw-r--r-- | databases/unixodbc/patches/patch-af | 42 | ||||
-rw-r--r-- | databases/unixodbc/patches/patch-ag | 14 | ||||
-rw-r--r-- | databases/unixodbc/patches/patch-ah | 24 | ||||
-rw-r--r-- | databases/unixodbc/patches/patch-ai | 18 |
8 files changed, 154 insertions, 3 deletions
diff --git a/databases/unixodbc/Makefile b/databases/unixodbc/Makefile index d3adcd64982..57336f5b76f 100644 --- a/databases/unixodbc/Makefile +++ b/databases/unixodbc/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.25 2009/10/19 08:37:39 taca Exp $ +# $NetBSD: Makefile,v 1.26 2009/10/21 04:21:27 taca Exp $ DISTNAME= unixODBC-2.2.14 PKGNAME= ${DISTNAME:S/ODBC/odbc/} -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= databases MASTER_SITES= http://www.unixodbc.org/ diff --git a/databases/unixodbc/distinfo b/databases/unixodbc/distinfo index 923eb19778a..98fece8bcbf 100644 --- a/databases/unixodbc/distinfo +++ b/databases/unixodbc/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.8 2009/10/19 08:37:39 taca Exp $ +$NetBSD: distinfo,v 1.9 2009/10/21 04:21:27 taca Exp $ SHA1 (unixODBC-2.2.14.tar.gz) = ab18464c83d30d7b38b8bb58e1dd01e3ec211488 RMD160 (unixODBC-2.2.14.tar.gz) = e2a2d2de636a8b2ee1002cac809ba2a38d7eb4de @@ -6,3 +6,9 @@ Size (unixODBC-2.2.14.tar.gz) = 2189755 bytes SHA1 (patch-aa) = db3b99dc6afe4263c41423ef276dba8c98a55877 SHA1 (patch-ab) = 7a35dcbc76b7d8b6b50bb1685180874f70c51141 SHA1 (patch-ac) = 2e754242b2a1c90fb07e4cabb0bd537fd8eeb1a2 +SHA1 (patch-ad) = b2e695d8c8c682c99af80e362369b0295070c1ab +SHA1 (patch-ae) = 0d54c7fe9b42a5b5eb2f8c31176a30a7fb49d183 +SHA1 (patch-af) = e011c95867a10ae52a9362d0ebdf2fcdc2a92f8a +SHA1 (patch-ag) = 1be22add8724176cf97c2e7c78fc069638c3c386 +SHA1 (patch-ah) = 56d19fa526867fe4bb7462d8a4b25cb580cdff2d +SHA1 (patch-ai) = 9b147d7a751b10795b5685249c7d8430dcf15936 diff --git a/databases/unixodbc/patches/patch-ad b/databases/unixodbc/patches/patch-ad new file mode 100644 index 00000000000..9f528b5619f --- /dev/null +++ b/databases/unixodbc/patches/patch-ad @@ -0,0 +1,26 @@ +$NetBSD: patch-ad,v 1.1 2009/10/21 04:21:27 taca Exp $ + +* Call function_return with IGNORE_THREAD to prevent calling + thread_release() since thread_protect() isn't called this "default:" + case . + +--- DriverManager/SQLAllocHandle.c.orig 2007-12-17 22:13:03.000000000 +0900 ++++ DriverManager/SQLAllocHandle.c +@@ -1244,7 +1244,7 @@ SQLRETURN __SQLAllocHandle( SQLSMALLINT + ERROR_HY092, NULL, + environment -> requested_version ); + +- return function_return( SQL_HANDLE_ENV, environment, SQL_ERROR ); ++ return function_return( IGNORE_THREAD, environment, SQL_ERROR ); + } + else if ( __validate_dbc( (DMHDBC) input_handle )) + { +@@ -1253,7 +1253,7 @@ SQLRETURN __SQLAllocHandle( SQLSMALLINT + ERROR_HY092, NULL, + connection -> environment -> requested_version ); + +- return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR ); ++ return function_return( IGNORE_THREAD, connection, SQL_ERROR ); + } + else + { diff --git a/databases/unixodbc/patches/patch-ae b/databases/unixodbc/patches/patch-ae new file mode 100644 index 00000000000..9d9ee89b6ab --- /dev/null +++ b/databases/unixodbc/patches/patch-ae @@ -0,0 +1,21 @@ +$NetBSD: patch-ae,v 1.1 2009/10/21 04:21:27 taca Exp $ + +* Avoid to call call __SQLGetInfo() twice since __SQLGetInfo() calls + thread_release() internally and it cause unlocking unlocked mutex. + +--- DriverManager/SQLConnect.c.orig 2008-09-29 23:02:43.000000000 +0900 ++++ DriverManager/SQLConnect.c +@@ -2086,11 +2086,13 @@ int __connect_part_two( DMHDBC connectio + char txt[ 20 ]; + SQLRETURN ret; + ++#if 0 + ret = __SQLGetInfo( connection, + SQL_DRIVER_ODBC_VER, + txt, + sizeof( txt ), + NULL ); ++#endif + + if ( SQL_SUCCEEDED( ret )) + { diff --git a/databases/unixodbc/patches/patch-af b/databases/unixodbc/patches/patch-af new file mode 100644 index 00000000000..265d0da884f --- /dev/null +++ b/databases/unixodbc/patches/patch-af @@ -0,0 +1,42 @@ +$NetBSD: patch-af,v 1.1 2009/10/21 04:21:27 taca Exp $ + +* Call function_return() with IGNORE_THREAD after calling thread_release(). + +--- DriverManager/SQLFreeHandle.c.orig 2007-12-17 22:13:03.000000000 +0900 ++++ DriverManager/SQLFreeHandle.c +@@ -234,7 +234,7 @@ SQLRETURN __SQLFreeHandle( SQLSMALLINT h + + thread_release( SQL_HANDLE_ENV, environment ); + +- return function_return( SQL_HANDLE_ENV, environment, SQL_ERROR ); ++ return function_return( IGNORE_THREAD, environment, SQL_ERROR ); + } + + thread_release( SQL_HANDLE_ENV, environment ); +@@ -301,7 +301,7 @@ SQLRETURN __SQLFreeHandle( SQLSMALLINT h + + thread_release( SQL_HANDLE_ENV, environment ); + +- return function_return( SQL_HANDLE_ENV, environment, SQL_ERROR ); ++ return function_return( IGNORE_THREAD, environment, SQL_ERROR ); + } + + environment -> connection_count --; +@@ -404,7 +404,7 @@ SQLRETURN __SQLFreeHandle( SQLSMALLINT h + + thread_release( SQL_HANDLE_STMT, statement ); + +- return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR ); ++ return function_return( IGNORE_THREAD, statement, SQL_ERROR ); + } + + if ( !CHECK_SQLFREEHANDLE( statement -> connection )) +@@ -551,7 +551,7 @@ SQLRETURN __SQLFreeHandle( SQLSMALLINT h + + thread_release( SQL_HANDLE_DESC, descriptor ); + +- return function_return( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); ++ return function_return( IGNORE_THREAD, descriptor, SQL_ERROR ); + } + else + { diff --git a/databases/unixodbc/patches/patch-ag b/databases/unixodbc/patches/patch-ag new file mode 100644 index 00000000000..4dfede1bda7 --- /dev/null +++ b/databases/unixodbc/patches/patch-ag @@ -0,0 +1,14 @@ +$NetBSD: patch-ag,v 1.1 2009/10/21 04:21:27 taca Exp $ + +* Call function_return() with IGNORE_THREAD since __SQLGetInfo() is already + called and __SQLGetInfo() calls function_return(). + +--- DriverManager/SQLGetInfo.c.orig 2008-09-29 23:02:45.000000000 +0900 ++++ DriverManager/SQLGetInfo.c +@@ -611,5 +611,5 @@ SQLRETURN SQLGetInfo( SQLHDBC connection + connection -> msg ); + } + +- return function_return( SQL_HANDLE_DBC, connection, ret ); ++ return function_return( IGNORE_THREAD, connection, ret ); + } diff --git a/databases/unixodbc/patches/patch-ah b/databases/unixodbc/patches/patch-ah new file mode 100644 index 00000000000..14b487377e3 --- /dev/null +++ b/databases/unixodbc/patches/patch-ah @@ -0,0 +1,24 @@ +$NetBSD: patch-ah,v 1.1 2009/10/21 04:21:27 taca Exp $ + +* Call function_return() with IGNORE_THREAD after calling thread_release(). + +--- DriverManager/SQLTransact.c.orig 2007-08-30 21:54:17.000000000 +0900 ++++ DriverManager/SQLTransact.c +@@ -439,7 +439,7 @@ SQLRETURN SQLTransact( SQLHENV environme + + thread_release( SQL_HANDLE_ENV, environment ); + +- return function_return( SQL_HANDLE_ENV, environment, SQL_ERROR ); ++ return function_return( IGNORE_THREAD, environment, SQL_ERROR ); + } + + /* +@@ -474,7 +474,7 @@ SQLRETURN SQLTransact( SQLHENV environme + + thread_release( SQL_HANDLE_ENV, environment ); + +- return function_return( SQL_HANDLE_ENV, environment, SQL_ERROR ); ++ return function_return( IGNORE_THREAD, environment, SQL_ERROR ); + } + } + else if ( CHECK_SQLENDTRAN( connection )) diff --git a/databases/unixodbc/patches/patch-ai b/databases/unixodbc/patches/patch-ai new file mode 100644 index 00000000000..ff18ea03b39 --- /dev/null +++ b/databases/unixodbc/patches/patch-ai @@ -0,0 +1,18 @@ +$NetBSD: patch-ai,v 1.1 2009/10/21 04:21:27 taca Exp $ + +* Release connection->mutex before destroy it when + connection->protection_level isn't TS_LEVEL3 since it causes destroying + locked mutex when explicitly specifies "Threading" parameter in + odbcinst.ini. I don't know the case using LIBTHREAD. + +--- DriverManager/__handles.c.orig 2009-10-20 16:47:04.000000000 +0900 ++++ DriverManager/__handles.c +@@ -737,6 +737,8 @@ void __release_dbc( DMHDBC connection ) + + #ifdef HAVE_LIBPTH + #elif HAVE_LIBPTHREAD ++ if ( connection -> protection_level != TS_LEVEL3) ++ mutex_exit( &connection -> mutex ); + pthread_mutex_destroy( &connection -> mutex ); + #elif HAVE_LIBTHREAD + mutex_destroy( &connection -> mutex ); |