| Summary: | LSB: Perl tests interrupted on ppc | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Jingdong Lu <jingdong.lu> |
| Component: | devtools / tool chain | Assignee: | Nitin Kamble <nitin.a.kamble> |
| Status: | RESOLVED NOTABUG | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium | CC: | jingdong.lu, meta.mr.watcher, meta.watcher, sgw, yi.zhao |
| Version: | 1.0 | ||
| Target Milestone: | 1.1 | ||
| Hardware: | mpc8315e-rdb | ||
| OS: | ppc | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | --- | |
|
Description
Jingdong Lu
2011-03-10 22:58:45 UTC
Jingdong, What do you mean by "interrupted" ? Sorry for using an ambiguous word "interrupted" to explain the failure. I run a single test and got the following result.
root@mpc8315e-rdb:/opt/lsb/test/perl# ./single_test comp/proto.t
comp/proto....dubious
Test returned status 0 (wstat 11, 0xb)
FAILED--1 test script could be run, alas--no output ever seen
I checked the code of comp/proto.t and picked up the snatch on which failures occurred.
#!./perl
my $i = 1;
sub array_ref_plus (\@@) {
print "# \@_ = (",join(",",@_),")\n";
print "not " unless @_ == 2 && ref($_[0]) && 1 == @{$_[0]} && $_[1] eq 'x';
printf "ok %d\n",$i++;
@{$_[0]} = (qw(ok)," ",$i++,"\n");
}
@array = ('a');
{ my @more = ('x');
array_ref_plus @array, @more; }
print "not " unless @array == 4;
print @array;
Run the above code(p2.t) and got the following result:
root@mpc8315e-rdb:/# perl p2.t
# @_ = (ARRAY(0x1002c7d0),x)
ok 1
Segmentation fault
I think the segmentation fault cause the test cases interrupted and it couldn't continue to execute the left cases.
I also give a simple test(1.t) and got a wrong result.
#!/usr/bin/perl
$aa=3;
print $aa;
root@mpc8315e-rdb:/# perl 1.t
-1080421088
I think something is wrong with the realization of function "print". I compiled perl with debug option and debug it. I posted the debug information and hoped it could be helpful.
root@mpc8315e-rdb:/mnt/sda1/home/perl-5.12.2# gdb ./perl
GNU gdb (GDB) 7.2
...
This GDB was configured as "powerpc-poky-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /mnt/sda1/home/perl-5.12.2/perl...done.
(gdb) set args ../perl-tmp/1.t
(gdb) b main
b Breakpoint 1 at 0x10000ac8: file perlmain.c, line 79.
(gdb) b Perl_do_print
Function "Perl_do_print" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 2 (Perl_do_print) pending.
(gdb) b PerlIO_printf
Function "PerlIO_printf" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 3 (PerlIO_printf) pending.
(gdb) r
Starting program: /mnt/sda1/home/perl-5.12.2/perl ../perl-tmp/1.t
[Thread debugging using libthread_db enabled]
Breakpoint 1, main (argc=2, argv=0xbffffd24, env=0xbffffd30) at perlmain.c:79
79 PL_use_safe_putenv = 0;
(gdb) c
Continuing.
Breakpoint 2, Perl_do_print (my_perl=0x10012008, sv=0x1002c808, fp=0x10028ac0) at doio.c:1207
1207 if (!sv)
(gdb) n
1209 if (SvTYPE(sv) == SVt_IV && SvIOK(sv)) {
(gdb) n
1211 if (SvIsUV(sv))
(gdb) n
1214 PerlIO_printf(fp, "%"IVdf, (IV)SvIVX(sv));
(gdb) where
#0 Perl_do_print (my_perl=0x10012008, sv=0x1002c808, fp=0x10028ac0) at doio.c:1214
#1 0x0fe8b32c in Perl_pp_print (my_perl=0x10012008) at pp_hot.c:777
#2 0x0fe87350 in Perl_runops_standard (my_perl=0x10012008) at run.c:40
#3 0x0fde6914 in S_run_body (my_perl=0x10012008, oldscope=1) at perl.c:2308
#4 0x0fde634c in perl_run (my_perl=0x10012008) at perl.c:2233
#5 0x10000bf4 in main (argc=2, argv=0xbffffd24, env=0xbffffd30) at perlmain.c:117
(gdb) s
627860480
Program exited normally.
I am not sure why it can't jump into the function "PerlIO_printf" even though I set up a breakpoint on it. I also posted the source code of "PerlIO_printf" in perlio.c.
#undef PerlIO_printf
int
PerlIO_printf(PerlIO *f, const char *fmt, ...)
{
va_list ap;
int result;
va_start(ap, fmt);
result = PerlIO_vprintf(f, fmt, ap);
va_end(ap);
return result;
}
I think it is related to the definition of "va_list" on PPC platform and it is also related to gcc. Sorry, I'm not sure.
is this issue only on PPC ? how about other arches ? With 20100423 build on autobuilder, git commit 653cd1423793a3fd66da5c5682021d5c5b729cfe On qemuarm, qemumips and routerstationpro images, there is no this issue. This issue only happened on qemuppc and mpc8315e-rdb (ppc hardware). I found this problem disappeared after perl was updated to 5.12.3. as perl upgrade fixes the issue, closing this bug |