Subject: | Test failure on x86 platform |
Hi, while trying to install DBIC on a fitPC which uses an Intel Atom CPU (i686 arch) I ran into the attached test failure. I have not been able to reproduce the problem on Intel or AMD 64 bit architecture.
The problem arises when a generated accessor is called to fetch a value that was not set via an accessor. The attached patch fixes the problem for me, though it is no doubt a bit slower to construct an object.
I've tested 1.63 where the problem doesn't occur, it happens from 1.71 onward, when Tree.pm was introduced.
Perhaps this bug report belongs in the Class::Accessor::Grouped queue. I've added a script that I used to narrow down the bug.
Cheers,
Andrew Kirkpatrick
Subject: | cag-bug.pl |
#!/usr/bin/env perl
# Demonstrate a bug which prevents CAG generated accessors from being
# used on values they didn't set on i686 arch.
use strict;
use warnings;
use v5.10.0;
use Data::Dumper;
package CAGTest;
use base 'Class::Accessor::Grouped';
my @accessors = qw/from_lexical from_dynamic from_anonymous from_accessor/;
__PACKAGE__->mk_group_accessors(simple => $_) for @accessors;
my %lexical_hash = ( one => 1, two => 2 );
our %dynamic_hash = ( one => 1, two => 2 );
sub new {
my $class = shift;
my $self = shift || {};
bless $self, $class;
$self->{from_lexical} = \%lexical_hash;
$self->{from_dynamic} = \%dynamic_hash;
$self->{from_anonymous} = { one => 1, two => 2 };
$self->from_accessor({ one => 1, two => 2 });
return $self;
}
package main;
my $c = CAGTest->new;
say "The full object: ", Dumper($c);
for my $acc (@accessors) {
eval {
my $x = $c->$acc;
say "$acc: " . Dumper($x);
} or do {
warn "Error accessing $acc: $@";
};
}
Subject: | perl_version.txt |
Summary of my perl5 (revision 5 version 16 subversion 3) configuration:
Platform:
osname=linux, osvers=2.6.32-5-vserver-686, archname=i686-linux-thread-multi
uname='linux wretch 2.6.32-5-vserver-686 #1 smp sun sep 23 12:15:19 utc 2012 i686 gnulinux '
config_args='-de -Dprefix=/usr/local/perlbrew/perls/perl-5.16.3-threaded -Dusethreads -Aeval:scriptdir=/usr/local/perlbrew/perls/perl-5.16.3-threaded/bin'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
ccversion='', gccversion='4.4.5', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /lib/../lib /usr/lib/../lib /lib /usr/lib /usr/lib64
libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.11.3.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.11.3'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'
Characteristics of this binary (from libperl):
Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT
PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_ITHREADS
USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE
USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO
USE_PERL_ATOF USE_REENTRANT_API
Built under linux
Compiled at Jun 17 2013 22:25:51
%ENV:
PERLBREW_BASHRC_VERSION="0.33"
PERLBREW_HOME="/home/spacebat/.perlbrew"
PERLBREW_MANPATH="/usr/local/perlbrew/perls/perl-5.16.3-threaded/man"
PERLBREW_PATH="/usr/local/perlbrew/bin:/usr/local/perlbrew/perls/perl-5.16.3-threaded/bin"
PERLBREW_PERL="perl-5.16.3-threaded"
PERLBREW_ROOT="/usr/local/perlbrew"
PERLBREW_VERSION="0.64"
@INC:
/usr/local/perlbrew/perls/perl-5.16.3-threaded/lib/site_perl/5.16.3/i686-linux-thread-multi
/usr/local/perlbrew/perls/perl-5.16.3-threaded/lib/site_perl/5.16.3
/usr/local/perlbrew/perls/perl-5.16.3-threaded/lib/5.16.3/i686-linux-thread-multi
/usr/local/perlbrew/perls/perl-5.16.3-threaded/lib/5.16.3
.
Subject: | sql_abstract_1.74.patch |
--- lib/SQL/Abstract/Tree.pm-orig 2013-06-24 08:42:58.343153241 +0930
+++ lib/SQL/Abstract/Tree.pm 2013-06-24 08:43:29.659151643 +0930
@@ -316,7 +316,11 @@
my $data = $merger->merge( $profiles{$profile}, $args );
- bless $data, $class
+ my $self = bless {}, $class;
+
+ $self->$_($data->{$_}) for keys %$data;
+
+ return $self;
}
sub parse {
Subject: | sql_abstract_1.74_test_i686.log |
PERL_DL_NONLAZY=1 /usr/local/perlbrew/perls/perl-5.16.3-threaded/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/*.t t/dbic/*.t
t/00new.t ................. ok
t/01generate.t ............ ok
t/02where.t ............... ok
t/03values.t .............. ok
t/04modifiers.t ........... ok
t/05in_between.t .......... ok
t/06order_by.t ............ ok
t/07subqueries.t .......... ok
t/08special_ops.t ......... ok
t/09refkind.t ............. ok
Cannot copy to ARRAY in goto at /home/spacebat/SQL-Abstract-1.74/blib/lib/SQL/Abstract/Tree.pm line 510.
# Looks like you planned 1766 tests but ran 129.
# Looks like your test exited with 255 just after 129.
t/10test.t ................
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 1637/1766 subtests
Cannot copy to ARRAY in goto at /home/spacebat/SQL-Abstract-1.74/blib/lib/SQL/Abstract/Tree.pm line 510.
# Tests were run but no plan was declared and done_testing() was not seen.
t/11parser.t ..............
Dubious, test returned 255 (wstat 65280, 0xff00)
All 7 subtests passed
Modification of a read-only value attempted at t/12confmerge.t line 16.
t/12confmerge.t ...........
Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run
Modification of a read-only value attempted at t/12format_keyword.t line 19.
t/12format_keyword.t ......
Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run
Modification of a read-only value attempted at t/13whitespace_keyword.t line 22.
t/13whitespace_keyword.t ..
Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run
Cannot copy to ARRAY in goto at /home/spacebat/SQL-Abstract-1.74/blib/lib/SQL/Abstract/Tree.pm line 510.
t/14roundtrippin.t ........
Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run
Cannot copy to ARRAY in goto at /home/spacebat/SQL-Abstract-1.74/blib/lib/SQL/Abstract/Tree.pm line 532.
t/15placeholders.t ........
Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run
Cannot copy to ARRAY in goto at /home/spacebat/SQL-Abstract-1.74/blib/lib/SQL/Abstract/Tree.pm line 510.
# Tests were run but no plan was declared and done_testing() was not seen.
t/16no_sideeffects.t ......
Dubious, test returned 255 (wstat 65280, 0xff00)
All 2 subtests passed
t/20injection_guard.t ..... ok
t/21op_ident.t ............ ok
t/22op_value.t ............ ok
t/90pod.t ................. skipped: Test::Pod 1.14 required
t/91podcoverage.t ......... skipped: Pod::Coverage 0.19 required
t/dbic/bulk-insert.t ...... skipped: Test temporarily requires DBIx::Class
t/dbic/no-repeats.t ....... skipped: Test temporarily requires DBIx::Class
t/dbic/show-progress.t .... skipped: Test temporarily requires DBIx::Class
Test Summary Report
-------------------
t/10test.t (Wstat: 65280 Tests: 129 Failed: 0)
Non-zero exit status: 255
Parse errors: Bad plan. You planned 1766 tests but ran 129.
t/11parser.t (Wstat: 65280 Tests: 7 Failed: 0)
Non-zero exit status: 255
Parse errors: No plan found in TAP output
t/12confmerge.t (Wstat: 65280 Tests: 0 Failed: 0)
Non-zero exit status: 255
Parse errors: No plan found in TAP output
t/12format_keyword.t (Wstat: 65280 Tests: 0 Failed: 0)
Non-zero exit status: 255
Parse errors: No plan found in TAP output
t/13whitespace_keyword.t (Wstat: 65280 Tests: 0 Failed: 0)
Non-zero exit status: 255
Parse errors: No plan found in TAP output
t/14roundtrippin.t (Wstat: 65280 Tests: 0 Failed: 0)
Non-zero exit status: 255
Parse errors: No plan found in TAP output
t/15placeholders.t (Wstat: 65280 Tests: 0 Failed: 0)
Non-zero exit status: 255
Parse errors: No plan found in TAP output
t/16no_sideeffects.t (Wstat: 65280 Tests: 2 Failed: 0)
Non-zero exit status: 255
Parse errors: No plan found in TAP output
Files=26, Tests=732, 14 wallclock secs ( 0.60 usr 0.08 sys + 12.81 cusr 0.48 csys = 13.97 CPU)
Result: FAIL
Failed 8/26 test programs. 0/732 subtests failed.
make: *** [test_dynamic] Error 255