Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id:
82307
Status:
rejected
Priority:
Low/Low
Queue:

People
Owner:
MICHIELB [...] cpan.org
Requestors:
Thomas.Eckardt [...] thockar.com
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
(no value)
Fixed in:
(no value)



Subject: DBD::mysql driver crashes Perl
Date: Fri, 28 Dec 2012 18:05:44 +0100
To: bug-DBD-mysql@rt.cpan.org
From: Thomas Eckardt <Thomas.Eckardt@thockar.com>
Hi,

we use the DBD::mysql (DBI) driver in a very large multithreaded application. And in case two or more threads running on different CPU-cores are doing an update/insert for the same record (same primary key) at the same time, the complete Perl process is terminated. This behavior is reproduceable and it is absolute independend from the operating system (freeBSD/linux/windows) and the used Perl version (5.10 .... 5.14). Tests for Perl 5.16.1 are still running. It is also makes no difference if Perl and the driver are installed from any disro,rpm or package or if the whole is compiled from source.

It is possible to use any other relational DB engine (oracle/DB2/PostgreSQL/Firebird/MSSQL) with this application - this problem occurred only with the driver DBD::mysql.

Best regards

Thomas Eckardt


DISCLAIMER:
*******************************************************
This email and any files transmitted with it may be confidential, legally privileged and protected in law and are intended solely for the use of the
individual to whom it is addressed.
This email was multiple times scanned for viruses. There should be no known virus in this email!
*******************************************************

Hi Thomas, On Fri Dec 28 12:06:08 2012, Thomas.Eckardt@thockar.com wrote:
Show quoted text
> we use the DBD::mysql (DBI) driver in a very large multithreaded > application. And in case two or more threads running on different > CPU-cores are doing an update/insert for the same record (same primary > key) at the same time, the complete Perl process is terminated. This > behavior is reproduceable and it is absolute independend from the > operating system (freeBSD/linux/windows) and the used Perl version (5.10 > .... 5.14).
Can you please supply a script that reproduces this behaviour? -- Mike
I echo Michiel's request - I would love to know how to reproduce this. Please include server version, perl version, OS info Thank you! On Fri Dec 28 12:06:08 2012, Thomas.Eckardt@thockar.com wrote:
Show quoted text
> Hi, > > we use the DBD::mysql (DBI) driver in a very large multithreaded > application. And in case two or more threads running on different > CPU-cores are doing an update/insert for the same record (same primary > key) at the same time, the complete Perl process is terminated. This > behavior is reproduceable and it is absolute independend from the > operating system (freeBSD/linux/windows) and the used Perl version (5.10 > .... 5.14). Tests for Perl 5.16.1 are still running. It is also makes no > difference if Perl and the driver are installed from any disro,rpm or > package or if the whole is compiled from source. > > It is possible to use any other relational DB engine > (oracle/DB2/PostgreSQL/Firebird/MSSQL) with this application - this > problem occurred only with the driver DBD::mysql. > > Best regards > > Thomas Eckardt > > > DISCLAIMER: > ******************************************************* > This email and any files transmitted with it may be confidential, legally > privileged and protected in law and are intended solely for the use of the > > individual to whom it is addressed. > This email was multiple times scanned for viruses. There should be no > known virus in this email! > ******************************************************* >
Subject: RE: [rt.cpan.org #82307] DBD::mysql driver crashes Perl
Date: Tue, 29 Oct 2013 14:47:53 +0100
To: bug-DBD-mysql@rt.cpan.org
From: Thomas Eckardt <Thomas.Eckardt@thockar.com>
Sorry for the delay.

The following code should cause the crash - how ever - running it to day on Windows (ActivePerl 5.16.1 with DBD::mysql 4.023) it was fine.
The perl application that was crashing is ~ 3MB + dozends of loaded modules -> 80MB memory after Perl-compiling.
I've found a way to prevent the crashes - which could be also caused by an  incompatbility of any module with DBD::mysql - for example by XS-modules compiled with a different compiler.
Contrary to this - some of the users have compiled Perl and all required modules from source on linux and some of them were running in to this problem.

If you want, you can close the ticket. Or you may run the code below, to check different OS and Perl and DBD::mysql versions.

best regards

Thomas

CODE:

#!/usr/local/bin/perl

use strict;
use threads;
use threads::shared;
use DBI;

our @threads;
our $myUser = 'root';
our $myPass = 'PASSWORD';
our $myHost = 'localhost';
our $myDB = 'DB';
our $myTable = 'test';

for (0...9) {
    push(@threads, threads->create(\&ThreadStart));
}

<STDIN>;
exit;

sub ThreadStart {
    my %hash;
    threads->detach();
    eval('use Tie::RDBM; 1;') or die "Tie::RDBM not available\n";
    my $dbh = DBI->connect("DBI:mysql:database=$myDB;host=$myHost", $myUser, $myPass,
                                                    { PrintError=>0,
                                                                  ChopBlanks=>1,
                                                                  Warn=>0 }
                           );
    $dbh or die("DBI error: $DBI::errstr\n");
    my $DBObject = tie %hash,'Tie::RDBM',{db=>$dbh,table=>$myTable,create=>1,DEBUG=>0};
    while (1) {
        $hash{'1'} = '1';
        $hash{'2'} = '2';
        $hash{'3'} = '3';
        my $dummy = $hash{'1'} && $hash{'2'} && $hash{'3'};
    }
}









Von:         <rt-cpan-org-return@perl.org>
An:         <Thomas.Eckardt@thockar.com>,
Datum:         28.10.2013 04:49
Betreff:         [rt.cpan.org #82307] DBD::mysql driver crashes Perl




<URL: https://rt.cpan.org/Ticket/Display.html?id=82307 >

I echo Michiel's request - I would love to know how to reproduce this. Please include server version, perl version, OS info

Thank you!

On Fri Dec 28 12:06:08 2012, Thomas.Eckardt@thockar.com wrote:
> Hi,
>
> we use the DBD::mysql (DBI) driver in a very large multithreaded
> application. And in case two or more threads running on different
> CPU-cores are doing an update/insert for the same record (same primary
> key) at the same time, the complete Perl process is terminated. This
> behavior is reproduceable and it is absolute independend from the
> operating system (freeBSD/linux/windows) and the used Perl version (5.10
> .... 5.14). Tests for Perl 5.16.1 are still running. It is also makes no
> difference if Perl and the driver are installed from any disro,rpm or
> package or if the whole is compiled from source.
>
> It is possible to use any other relational DB engine
> (oracle/DB2/PostgreSQL/Firebird/MSSQL) with this application - this
> problem occurred only with the driver DBD::mysql.
>
> Best regards
>
> Thomas Eckardt
>
>
> DISCLAIMER:
> *******************************************************
> This email and any files transmitted with it may be confidential, legally
> privileged and protected in law and are intended solely for the use of the
>
> individual to whom it is addressed.
> This email was multiple times scanned for viruses. There should be no
> known virus in this email!
> *******************************************************
>









DISCLAIMER:
*******************************************************
This email and any files transmitted with it may be confidential, legally privileged and protected in law and are intended solely for the use of the
individual to whom it is addressed.
This email was multiple times scanned for viruses. There should be no known virus in this email!
*******************************************************

Closing ticket.


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.