Crashes using FileDialog on Centos5

Hi All,

I am getting a segmentation fault when launching a simple FileDialog on Centos5.

Python 2.6.5 (r265:1380, Oct 31 2014, 11:02:49)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-55)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import wx
wx.version()
‘3.0.1.1 gtk2 (classic)’

``

When I try the attached sample program I see the FileDialog momentarily flash up before disappearing due to the Seg Fault.

I have tried the sample on both Ubuntu and Windows without any problems.

From trawling through the mailing lists I have seen past references to problems with FileDialog but nothing recent. Has anyone else seen this problem?

Thanks

Glen

sample.py (277 Bytes)

Hi All,

I am getting a segmentation fault when launching a simple FileDialog on Centos5.

Can you install the faulthandler module, set it up in your script, and tell us the error it catches? (faulthandler helps to debug segfaults)

When I try the attached sample program I see the FileDialog momentarily flash up before disappearing due to the Seg Fault.

any difference if you pass frame to the function? or if you define the function after creating your frame object?

···

On Sunday, December 14, 2014 4:48:43 PM UTC-8, Glen Olafsen wrote:

Thanks Nathan

I tried passing the frame to the function and moving the function declaration to after the frame had been created and got the same result.

[golafsen@centos5]$ python sample.py
Fatal Python error: Segmentation fault

Current thread 0xb7f318e0 (most recent call first):
File “/work/packages/arch/linux-gcc41-x86/lib/python2.6/site-packages/wx-3.0-gtk2/wx/_windows.py”, line 805 in ShowModal
File “sample.py”, line 6 in dialog_func
File “/work/packages/arch/linux-gcc41-x86/lib/python2.6/site-packages/wx-3.0-gtk2/wx/_core.py”, line 16863 in Notify
File “/work/packages/arch/linux-gcc41-x86/lib/python2.6/site-packages/wx-3.0-gtk2/wx/_misc.py”, line 1367 in Notify
File “/work/packages/arch/linux-gcc41-x86/lib/python2.6/site-packages/wx-3.0-gtk2/wx/_core.py”, line 7952 in MainLoop
File “/work/packages/arch/linux-gcc41-x86/lib/python2.6/site-packages/wx-3.0-gtk2/wx/_core.py”, line 8657 in MainLoop
File “sample.py”, line 20 in
Segmentation fault

``

After including the faulthandler module I got the following printout.

Cheers,

Glen

Glen,

A few years ago, I did some work on Centos 5.5 using Python 2.4, wxPython 2.8.9
The below code worked for me.
Notice that I specified the wx.FileDialog parameters.

wildcard = "HMI Initialization (*.ini)|*.ini"
defdir = self.mainw.currentDirectory
deffile = self.initialFilename
dlg = wx.FileDialog(self, "Save INI file", defaultDir=defdir, defaultFile=deffile, wildcard=wildcard, style=wx.SAVE | wx.OVERWRITE_PROMPT)
if dlg.ShowModal() == wx.ID_OK:
    ....

Bruce

···

On Monday, December 15, 2014 9:43:46 PM UTC-5, Glen Olafsen wrote:

Thanks Nathan

I tried passing the frame to the function and moving the function declaration to after the frame had been created and got the same result.

[golafsen@centos5]$ python sample.py
Fatal Python error: Segmentation fault

Current thread 0xb7f318e0 (most recent call first):
File “/work/packages/arch/linux-gcc41-x86/lib/python2.6/site-packages/wx-3.0-gtk2/wx/_windows.py”, line 805 in ShowModal
File “sample.py”, line 6 in dialog_func
File “/work/packages/arch/linux-gcc41-x86/lib/python2.6/site-packages/wx-3.0-gtk2/wx/_core.py”, line 16863 in Notify
File “/work/packages/arch/linux-gcc41-x86/lib/python2.6/site-packages/wx-3.0-gtk2/wx/_misc.py”, line 1367 in Notify
File “/work/packages/arch/linux-gcc41-x86/lib/python2.6/site-packages/wx-3.0-gtk2/wx/_core.py”, line 7952 in MainLoop
File “/work/packages/arch/linux-gcc41-x86/lib/python2.6/site-packages/wx-3.0-gtk2/wx/_core.py”, line 8657 in MainLoop
File “sample.py”, line 20 in
Segmentation fault

``

After including the faulthandler module I got the following printout.

Cheers,

Glen

Thanks Bruce,

I tried setting the params as you suggested and found that there was no change, still got the seg fault.

We just recently updated to wxPython 3.0.1.1 from 2.8.11, so I switched back to 2.8.11 and found that the file dialog launches with no issues. So for us at least it has been introduced in the upgrade to wxPython 3.

Glen

···

On Wednesday, December 17, 2014 4:15:49 AM UTC+10:30, bruce g wrote:

Glen,

A few years ago, I did some work on Centos 5.5 using Python 2.4, wxPython 2.8.9
The below code worked for me.
Notice that I specified the wx.FileDialog parameters.

wildcard = "HMI Initialization (*.ini)|*.ini"
defdir = self.mainw.currentDirectory
deffile = self.initialFilename
dlg = wx.FileDialog(self, "Save INI file", defaultDir=defdir, defaultFile=deffile, wildcard=wildcard, style=wx.SAVE | wx.OVERWRITE_PROMPT)
if dlg.ShowModal() == wx.ID_OK:
    ....

Bruce

On Monday, December 15, 2014 9:43:46 PM UTC-5, Glen Olafsen wrote:

Thanks Nathan

I tried passing the frame to the function and moving the function declaration to after the frame had been created and got the same result.

[golafsen@centos5]$ python sample.py
Fatal Python error: Segmentation fault

Current thread 0xb7f318e0 (most recent call first):
File “/work/packages/arch/linux-gcc41-x86/lib/python2.6/site-packages/wx-3.0-gtk2/wx/_windows.py”, line 805 in ShowModal
File “sample.py”, line 6 in dialog_func
File “/work/packages/arch/linux-gcc41-x86/lib/python2.6/site-packages/wx-3.0-gtk2/wx/_core.py”, line 16863 in Notify
File “/work/packages/arch/linux-gcc41-x86/lib/python2.6/site-packages/wx-3.0-gtk2/wx/_misc.py”, line 1367 in Notify
File “/work/packages/arch/linux-gcc41-x86/lib/python2.6/site-packages/wx-3.0-gtk2/wx/_core.py”, line 7952 in MainLoop
File “/work/packages/arch/linux-gcc41-x86/lib/python2.6/site-packages/wx-3.0-gtk2/wx/_core.py”, line 8657 in MainLoop
File “sample.py”, line 20 in
Segmentation fault

``

After including the faulthandler module I got the following printout.

Cheers,

Glen

The variable 'frame' is not defined in your method 'dialog_func', what happens if you change that to 'None' or pass it in as a parameter to the method?

Werner

···

On 12/15/2014 1:48, Glen Olafsen wrote:

Hi All,

I am getting a segmentation fault when launching a simple FileDialog on Centos5.

You should wxPython 3.0.2 a try, maybe this has been fixed :confused:

···

On Tuesday, December 16, 2014 2:49:34 PM UTC-8, Glen Olafsen wrote:

Thanks Bruce,

I tried setting the params as you suggested and found that there was no change, still got the seg fault.

We just recently updated to wxPython 3.0.1.1 from 2.8.11, so I switched back to 2.8.11 and found that the file dialog launches with no issues. So for us at least it has been introduced in the upgrade to wxPython 3.