Sun Aug 15 13:15:30 2010: Request 59916 was acted upon.
Transaction: Correspondence added by mattia.bar...@libero.it
       Queue: Wx
     Subject: Re: [rt.cpan.org #59916] Wx makes perl dumping core when no 
DISPLAY set
   Broken in: 0.9701, 0.9702
    Severity: Critical
       Owner: Nobody
  Requestors: rehs...@cpan.org
      Status: open
 Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=59916 >


Jens Rehsack via RT wrote:

   Hi,

> On Thu Aug 12 16:53:02 2010, mattia.bar...@libero.it wrote:
>> Jens Rehsack via RT wrote:
>>
>>    Hi,
>>
>>> On Sun Aug 01 06:35:07 2010, mattia.bar...@libero.it wrote:
>>>> Jens Rehsack via RT wrote:
>>>>
>>>>    Hi,
>>>>
>>>>> I've seen RT#41716 - and this RT is more or less the same report with
>>>>> another background.
>>>>>
>>>>> We (pkgsrc) package some perl modules using Wx - at least Padre
> and some
>>>>> plugins. All these package fail the bulk builds with perl core dumps,
>>>>> because of the Wx requirement.
>>>>    If you do a simple 'use Wx', does it crash that way?  Is there a 
>>>> simple test case for the bug?
>>> $ env DISPLAY= perl -e 'use Wx qw(:allclasses); print wxYES, "\n";';
>>> Error: Unable to initialize gtk, is DISPLAY set properly?
>>> Segmentation fault (core dumped)
>>>
>>> $ env DISPLAY= perl -e 'use Wx qw(wxYES); print wxYES, "\n";';Error:
>>> Unable to initialize gtk, is DISPLAY set properly?
>>> 2
>>>
>>> $ env DISPLAY= perl -Mblib t/01_load.t   
>>> 1..6
>>> Error: Unable to initialize gtk, is DISPLAY set properly?
>>> Use of uninitialized value $Wx::_universal in concatenation (.) or
>>> string at /usr/pkgsrc/x11/p5-Wx/work/Wx-0.9702/blib/lib/Wx.pm line 160.
>>> Use of uninitialized value $Wx::_static in concatenation (.) or string
>>> at /usr/pkgsrc/x11/p5-Wx/work/Wx-0.9702/blib/lib/Wx.pm line 161.
>>> ok 1 - use Wx;
>>> Segmentation fault (core dumped)
>>>
>>> How much simpler should the test case be?
>>    This simple... from the first bug report I got the impression that 
>> the problem occurred in the Padre test suite.
> 
> My fault - there I detected it first time. I'm a bit EHEADEVERYWHERE at
> the moment, sorry.
> 
>>> I'm sorry, I'm no GUI developer, neither using Wx nor any other graphics
>>> library. I can't do more than showing you with your own code, where it
>>> fails.
>>    I am not using NetBSD either, and I might say the same thing :-) 
> 
> Again my fault. It crashes on MacOS X (X11 environment), Ubuntu and
> Solaris, too.
> It's not related to NetBSD.

   Actually, I did try under Linux and it did not crash; I tried now and 
I can reproduce it; no idea what I did wrong the first time...

>> anyway, I'm currently installing NetBSD in a VM.  I'm not sure when I 
>> will be able to look into the crash; keep in mind thath Wx is never 
>> going to pass any tests with display unset, the best I can do is to make 
>> it fail without a crash.
> 
> If it wouldn't dump core on 'use Wx qw(:allclasses);', would be enough.
> I don't want request a magical fix what might bring Wx working without
> an output device, but a core dump leads me to the assumption, that
> something is going heavily wrong.

   Agreed.  Debugging it further, the failure is inside wxWidgets and is 
not fixable: if the wxWidgets initialization fails, using it to load 
libraries (as done by :allclasses) is always going to crash (because 
some needed non-GUI components are not initialized).  I added some code 
that die()s if the wxWidgets initialization fails:

$ perl -Mblib -MWx=:allclasses -e 42
Error: Unable to initialize gtk, is DISPLAY set properly?
Failed to initialize wxWidgets at -e line 0
Compilation failed in require.
BEGIN failed--compilation aborted.
$

HTH,
Mattia


Reply via email to