Skip Menu |
 

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

Report information
The Basics
Id: 131522
Status: resolved
Priority: 0/
Queue: DBD-Pg

People
Owner: greg [...] turnstep.com
Requestors: peter.juhasz [...] comnica.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 3.9.0
Fixed in: 3.10.3



Subject: DBD-Pg 3.10.2 Crash with double free or corruption (!prev)
Date: Mon, 20 Jan 2020 14:45:37 +0100
To: bug-DBD-Pg [...] rt.cpan.org
From: Peter Juhasz <peter.juhasz [...] comnica.com>
Download (untitled) / with headers
text/plain 1.4k
Hi, after upgrading to Fedora 31, and with it, DBD::Pg 3.10.0, one of our tests began fail. After manually upgrading DBD::Pg to 3.10.2 (from CPAN) the issue still persists. system information: Perl: 5.30.1 DBI: 1.642 DBD::Pg: 3.10.2 libpq: 11.6 partial backtrace: #0 0x00007eff20d70625 in raise () from /lib64/libc.so.6 #1 0x00007eff20d598d9 in abort () from /lib64/libc.so.6 #2 0x00007eff20db44af in __libc_message () from /lib64/libc.so.6 #3 0x00007eff20dbba9c in malloc_printerr () from /lib64/libc.so.6 #4 0x00007eff20dbd92c in _int_free () from /lib64/libc.so.6 #5 0x00007eff13a0a509 in PQclear () from /usr/pgsql-9.6/lib/libpq.so.5 #6 0x00007eff13a7b33c in pg_db_destroy (dbh=<optimized out>, imp_dbh=0x55d5294282e0) at dbdimp.c:695 #7 0x00007eff13a7283e in XS_DBD__Pg__db_DESTROY (my_perl=0x55d5293c22a0, cv=<optimized out>) at ./Pg.xsi:420 #8 0x00007eff13ac5081 in XS_DBI_dispatch (my_perl=<optimized out>, cv=0x55d52a8965f8) at DBI.xs:3797 #9 0x00007eff21011f08 in Perl_pp_entersub () from /lib64/libperl.so.5.30 #10 0x00007eff20f7610f in Perl_call_sv () from /lib64/libperl.so.5.30 #11 0x00007eff210170d9 in S_curse () from /lib64/libperl.so.5.30 #12 0x00007eff21017898 in Perl_sv_clear () from /lib64/libperl.so.5.30 #13 0x00007eff21017e07 in Perl_sv_free2 () from /lib64/libperl.so.5.30 ... Unfortunately the test file that produces this crash is large and complex, but I'll try to create a self-contained example that triggers the bug. best regards, Peter Juhasz
Thanks for the report (and the backtrace!), will dig into this.
Is this definitely using async features of DBD::Pg? Knowing so might help narrow things down.
Subject: Re: [rt.cpan.org #131522] DBD-Pg 3.10.2 Crash with double free or corruption (!prev)
Date: Mon, 20 Jan 2020 18:06:47 +0100
To: bug-DBD-Pg [...] rt.cpan.org
From: Peter Juhasz <peter.juhasz [...] comnica.com>
Download (untitled) / with headers
text/plain 901b
On Mon, 2020-01-20 at 11:22 -0500, Greg Sabino Mullane via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=131522 > > > Is this definitely using async features of DBD::Pg? Knowing so might > help narrow things down.
It's not using async at all. I've narrowed down the failing test case somewhat. We have a home-grown connection proxy that can simulate network outages by dropping or delaying packets. The test opens a connection to the DB via this connection proxy in an eval block, signals the proxy to start dropping packets, then attempts to send a query via the connection. There is a wrapper layer around the raw DBI calls that handles timeouts, this mechanism kicks in and cancels the query. The double free (or segfault, it varies, but the relevant parts of the stack trace are always the same) happens when the eval block exits and the connection object inside is destroyed.
Subject: [rt.cpan.org #131522] Version information
Date: Mon, 20 Jan 2020 19:00:53 +0100
To: bug-DBD-Pg [...] rt.cpan.org
From: Peter Juhasz <peter.juhasz [...] comnica.com>
The first published version to crash is 3.8.9_1. 3.8.1 was fine.
Download (untitled) / with headers
text/plain 148b
Made some fixes in 2e04c5be89637743e5492b2d3b582a9a9ce6ba2e - hopefully that clears it up. Please test if you can. Will make a tarball if requested.
Subject: Re: [rt.cpan.org #131522] DBD-Pg 3.10.2 Crash with double free or corruption (!prev)
Date: Mon, 20 Jan 2020 19:42:11 +0100
To: bug-DBD-Pg [...] rt.cpan.org
From: Peter Juhasz <peter.juhasz [...] comnica.com>
Download (untitled) / with headers
text/plain 351b
On Mon, 2020-01-20 at 13:21 -0500, Greg Sabino Mullane via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=131522 > > > Made some fixes in 2e04c5be89637743e5492b2d3b582a9a9ce6ba2e - > hopefully that clears it up. Please test if you can. Will make a > tarball if requested.
No crash this time! All tests pass. Thanks for the quick fix!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

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