Opened 4 years ago

Closed 3 years ago

#1210 closed defect (fixed)

76-preferences.t fails while passing all the tests

Reported by: claudio Owned by: szabgab
Priority: major Milestone:
Component: Automated Build and Test Version: 0.85
Keywords: testing preferences Cc:

Description

From make test on GNU/Linux, 64-bit (Ubuntu 10.10), perlbrewed perl 5.12.3, cpanm'ed Wx.pm:

[...]
t/76-preferences.t ......... All 6 subtests passed
Test Summary Report


t/76-preferences.t (Wstat: 11 Tests: 6 Failed: 0)

Non-zero wait status: 11

Files=60, Tests=1027, 80 wallclock secs ( 0.36 usr 0.19 sys + 22.02 cusr 3.02 csys = 25.59 CPU)
Result: FAIL
Failed 1/60 test programs. 0/1027 subtests failed.

make: * [test_dynamic] Error 255

or more verbose:
$ prove -b -v t/76-preferences.t
t/76-preferences.t ..
1..6
ok 1 - use Padre::Wx::Dialog::Preferences2;
ok 2 - The object isa Padre
ok 3 - The object isa Padre::Wx::Main
ok 4 - The object isa Padre::Wx::Dialog::Preferences2
ok 5 - The object isa Wx::Treebook
ok 6 - The object isa Padre::Config
All 6 subtests passed

Test Summary Report


t/76-preferences.t (Wstat: 11 Tests: 6 Failed: 0)

Non-zero wait status: 11

Files=1, Tests=6, 4 wallclock secs ( 0.03 usr 0.00 sys + 1.23 cusr 0.09 csys = 1.35 CPU)
Result: FAIL


"test_dynamic" make me think it's a C-like library segfaulting. Any ideas?

Change History (6)

comment:1 Changed 4 years ago by claudio

  • Version changed from 0.84 to 0.85

comment:2 Changed 3 years ago by bowtie

Observation only 6 test run.

t/76-preferences.t .. 
1..9
ok 1 - use Padre::Wx::Dialog::Preferences;
ok 2 - The object isa Padre
ok 3 - The object isa Padre::Wx::Main
ok 4 - The object isa Padre::Wx::Dialog::Preferences
ok 5 - The object isa Wx::Treebook
ok 6 - The object isa Padre::Config
Failed 3/9 subtests 

Test Summary Report
-------------------
t/76-preferences.t (Wstat: 11 Tests: 6 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 9 tests but ran 6.
Files=1, Tests=6,  4 wallclock secs ( 0.07 usr  0.01 sys +  2.78 cusr  0.22 csys =  3.08 CPU)
Result: FAIL

comment:3 Changed 3 years ago by bowtie

  • Owner set to szabgab
  • Status changed from new to assigned

comment:4 Changed 3 years ago by claudio

It is indeed a C-link crash. I see this in the system log:
[12707.641752] perl[18857]: segfault at 0 ip 00002b34f4bdb699 sp 00007fff3add6840 error 4 in libwx_gtk2u_core-2.8.so.0.8.0[2b34f4a1a000+3df000]

claudio@adelaide:~/Code/Padre?/trunk/Padre$ find /lib /usr /lib64 ~ -name libwx_gtk2u_core-2.8.so.0.8.0 2>/dev/null
/home/claudio/lib/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/x86_64-linux-gnu-thread-multi/Alien/wxWidgets/gtk_2_8_12_uni/lib/libwx_gtk2u_core-2.8.so.0.8.0
/home/claudio/.cpanm/work/1305283766.28299/Alien-wxWidgets-0.52/wxWidgets-2.8.12/bld/lib/libwx_gtk2u_core-2.8.so.0.8.0

So, a result of Alien::WxWidgets??

comment:5 Changed 3 years ago by garu

This is the offending code, stripped away from Padre. It never reaches 'print "yay"', and segfaults inside $ctrl->SetSelectedFont():

use strict;
use warnings;
use Wx (':everything');

my $ctrl = Wx::FontPickerCtrl->new();
my $value = '';

my $font = Wx::Font->new(Wx::wxNullFont);
{
    local $@;
    eval { $font->SetNativeFontInfoUserDesc($value); };
    if ($@) {
        warn "something's wrong: $@";
        $font = Wx::Font->new(Wx::wxNullFont) 
    }
}
$ctrl->SetSelectedFont($font);

print "yay";
Last edited 3 years ago by garu (previous) (diff)

comment:6 Changed 3 years ago by garu

  • Resolution set to fixed
  • Status changed from assigned to closed

Mark Dootson is awesome, and easily spotted how to fix this. Apparently, SetSelectedFont?() is not meant to work on a wxNullFont, and silently fails on other OS's while segfaulting on Linux.

The simplest fix of doing it only if $font->IsOk? made the segfault go away.

Patched padre is r14390, tests should pass again now =)

Note: See TracTickets for help on using tickets.