Bug #19191 Repeated crashes on OpenBSD for ssl test cases
Submitted: 19 Apr 2006 10:48 Modified: 21 Jun 2006 4:38
Reporter: Joerg Bruehe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.20a OS:Other (OpenBSD)
Assigned to: Magnus Blåudd CPU Architecture:Any

[19 Apr 2006 10:48] Joerg Bruehe
Description:
Release build of 5.0.20a, based on ChangeSet
  1.2120 06/04/18 13:26:41 kent@mysql.com +1 -0
  configure.in:
    Stepped up version to 5.0.20a

Typical symptom is just this:
=====
archive                        [ fail ]

Errors are (from PATH/mysqltest-time) :
mysqltest returned unexpected code 137, it has probably crashed
(the last lines may be the most important ones)

Killing Possible Leftover Processes
=====

In this run ("granny-5.0-max.log   normal"), it occurred for tests
archive, bigint, binlog, compress, ctype_latin1, ctype_latin2, ctype_many, ctype_uca, ctype_ujis.

However, the symptom is not new, we already had it in 5.0.20.
This is the list of failing tests in 5.0.20, across all products / test runs:
archive, bigint, binlog, compress, ctype_latin1, ctype_latin2, ctype_many, ctype_uca, ctype_ujis, init_connect, insert_select, kill, ps_1general, query_cache, query_cache_notembedded, select, sp-big, ssl, ssl_compress.

This is the count of occurrences per product / test in the 5.0.20 build:
      8 granny-5.0-cluster.log   normal
     18 granny-5.0-max.log   NDB
     18 granny-5.0-max.log   normal
     19 granny-5.0-max.log   ps
     17 granny-5.0-pro-gpl.log   normal
     18 granny-5.0-pro-gpl.log   ps
     17 granny-5.0-pro.log   normal
     18 granny-5.0-pro.log   ps
     17 granny-5.0-standard.log   normal
     18 granny-5.0-standard.log   ps

How to repeat:
Found when running the test suite.
[9 Jun 2006 7:35] Magnus Blåudd
I just looked at 
https://intranet.mysql.com/~kboortz/status/htmlize.php?mysql-5.0.22/logs/granny-5.0-standa...
and it looks like it's only the ssl test that fails in this way. It feels like the problem with archive etc occured when running the whole test suite with --with-openssl turned on.

08889: sql_mode                       [ pass ]            102
08890: ssl                            [ fail ]
08891: 
08892: Errors are (from /home/mysqldev/granny/test/mysql-standard-5.0.22-openbsd3.9-i386/mysql-test/var/log/mysqltest-time) :
08893: mysqltest returned unexpected code 137, it has probably crashed
08894: (the last lines may be the most important ones)
08895: 
08896: Killing Possible Leftover Processes
08897: Restoring snapshot of databases
08898: Resuming Tests
08899: 
08900: ssl_compress                   [ fail ]
08901: 
08902: Errors are (from /home/mysqldev/granny/test/mysql-standard-5.0.22-openbsd3.9-i386/mysql-test/var/log/mysqltest-time) :
08903: mysqltest returned unexpected code 137, it has probably crashed
08904: (the last lines may be the most important ones)
08905: 
08906: Killing Possible Leftover Processes
08907: Restoring snapshot of databases
08908: Resuming Tests
08909: 
08910: status
[14 Jun 2006 18:26] Magnus Blåudd
Patch checked in to yassl at sourceforge

RCS file: /cvsroot/yassl/yassl/src/socket_wrapper.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** socket_wrapper.cpp	14 May 2006 23:40:59 -0000	1.3
--- socket_wrapper.cpp	14 Jun 2006 17:19:37 -0000	1.4
***************
*** 114,124 ****
  uint Socket::send(const byte* buf, unsigned int sz, int flags) const
  {
      assert(socket_ != INVALID_SOCKET);
-     int sent = ::send(socket_, reinterpret_cast<const char *>(buf), sz, flags);
  
!     if (sent == -1)
!         return 0;
  
!     return sent;
  }
  
--- 114,133 ----
  uint Socket::send(const byte* buf, unsigned int sz, int flags) const
  {
+     const byte* pos = buf;
+     const byte* end = pos + sz;
+ 
      assert(socket_ != INVALID_SOCKET);
  
!     while (pos != end) {
!         int sent = ::send(socket_, reinterpret_cast<const char *>(pos),
!                           static_cast<int>(end - pos), flags);
  
!         if (sent == -1)
!             return 0;
! 
!         pos += sent;
!     }
! 
!     return sz;
  }
[14 Jun 2006 19:31] 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:

  http://lists.mysql.com/commits/7664
[19 Jun 2006 14:58] Tatiana Azundris Nuernberg
pushed to 5.0-maint, 5.0.23
merged into 5.0, 5.0.23
and up into 5.1, 5.1.12-beta
[21 Jun 2006 4:38] Paul Dubois
Noted in 5.0.23, 5.1.12 changelogs.

SSL connections using yaSSL on OpenBSD could fail.