Skip Menu |
 

This queue is for tickets about the DBIx-Class CPAN distribution.

Report information
The Basics
Id: 74991
Status: resolved
Priority: 0/
Queue: DBIx-Class

People
Owner: Nobody in particular
Requestors: maik.hentsche [...] amd.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.08196
Fixed in: (no value)



Subject: TxnScopeGuard dies if $@ contains object
Download (untitled) / with headers
text/plain 1.6k
I have an application using a sqlite3 database. When putting a new value into this database I somehow triggered the following error message: Show quoted text
-------------------- Begin error --------------------------------------- Operation "ne": no method found, left argument in overloaded package Text::Balanced::ErrorMsg, right argument has no overloaded magic at /home_local/hmai/ perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/DBIx/Class/ Storage/TxnScopeGuard.pm line 25. at /home_local/hmai/perl5/perlbrew/perls/perl-5.14.2/lib/ site_perl/5.14.2/DBIx/Class/Storage/TxnScopeGuard.pm line 25 DBIx::Class::Storage::TxnScopeGuard::new ('DBIx::Class::Storage::TxnScopeGuard', 'DBIx::Class::Storage::DBI::SQLite=HASH(0x6aa2fe8)') called at / home_local/hmai/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/ DBIx/Class/Storage.pm line 488 DBIx::Class::Storage::txn_scope_guard ('DBIx::Class::Storage::DBI::SQLite=HASH(0x6aa2fe8)') called at / home_local/hmai/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/ DBIx/Class/Row.pm line 339 DBIx::Class::Row::insert ('Tapper::Schema::ReportsDB::Result::NotificationEvent=HASH(0x6...') called at t/tapper-notification.t line 63
--------------------- End error ----------------------------------- I do not know what exactly triggered this but I do know what the issue is. The relevant line in TxnScopeGuard checks whether $@ contains an empty string. In fact it does contain a Text::Balanced::ErrorMsg object. This object does overwrite stringification but that is not triggered. The attached patch fixes this by triggering the stringification.
Subject: stringify_evalerror.patch
diff -ru a/DBIx/Class/Storage/TxnScopeGuard.pm b/DBIx/Class/Storage/TxnScopeGuard.pm --- a/DBIx/Class/Storage/TxnScopeGuard.pm 2012-02-14 11:36:38.463933111 +0100 +++ b/DBIx/Class/Storage/TxnScopeGuard.pm 2012-02-14 11:36:16.324211446 +0100 @@ -22,7 +22,7 @@ # we are starting with an already set $@ - in order for things to work we need to # be able to recognize it upon destruction - store its weakref # recording it before doing the txn_begin stuff - if (defined $@ and $@ ne '') { + if (defined $@ and "$@" ne '') { $guard->{existing_exception_ref} = (ref $@ ne '') ? $@ : \$@; weaken $guard->{existing_exception_ref}; }
Download (untitled) / with headers
text/plain 131b
As per our IRC conversation I am rejecting this ticket, as the problem was identified as a botched exception class stringification.
Download (untitled) / with headers
text/plain 105b
Sending the previous mail has failed. Please contact your admin, they can find more details in the logs.
Download (untitled) / with headers
text/plain 105b
Sending the previous mail has failed. Please contact your admin, they can find more details in the logs.
Download (untitled) / with headers
text/plain 175b
This was actually eventually fixed by https://github.com/dbsrgits/dbix-class/commit/841efcb3 as more and more reports like yours kept coming in. Updating ticket for posterity.


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.