GetBox not called correctly on Linux GTK 3 3.0.2.0?

On Fedora 24, 32-bit, Python 2.7.12, wxPython 3.0.2.0, SWIG-1.3.29,
the following call to DrawEllipticArc causes a segmentation fault:

import wx

class DrawPanel(wx.Frame):
def init(self):
wx.Frame.init(self, None, title=“Draw on Panel”)
self.Bind(wx.EVT_PAINT, self.OnPaint)

def OnPaint(self, event=None):
    dc = wx.PaintDC(self)
    dc.Clear()
    dc.SetPen(wx.Pen(wx.BLACK, 4))
    dc.SetBrush(wx.TRANSPARENT_BRUSH)

    dc.DrawEllipticArc(10, 10, 350, 200, 0, 180)

app = wx.App(False)
frame = DrawPanel()
frame.Show()
app.MainLoop()

GDB shows the following:

Thread 1 “python” received signal SIGSEGV, Segmentation fault.
0xb6ed6657 in wxGraphicsPath::GetBox(double*, double*, double*, double*) const () from /lib/libwx_gtk3u_core-3.0.so.0
(gdb) bt
#0 0xb6ed6657 in wxGraphicsPath::GetBox(double*, double*, double*, double*) const () from /lib/libwx_gtk3u_core-3.0.so.0
#1 0xb6ed8674 in wxGraphicsPath::GetBox() const () from /lib/libwx_gtk3u_core-3.0.so.0
#2 0xb6e7df16 in wxGCDCImpl::DoDrawEllipticArc(int, int, int, int, double, double) () from /lib/libwx_gtk3u_core-3.0.so.0
#3 0xafe438b7 in _wrap_DC_DrawEllipticArc () from /usr/lib/python2.7/site-packages/wx-3.0-gtk3/wx/gdi.so

There was no crash here:
Fedora 22, 64-bit, Python 2.7.10, wxPython 3.0.2.0, (SWIG-3.0.7 but not sure if the one for 3.0.2)
Also worked with wxPython 3.0.3 recent dev.

terça-feira, 20 de Setembro de 2016 às 17:17:32 UTC+1, ABC escreveu:

···

On Fedora 24, 32-bit, Python 2.7.12, wxPython 3.0.2.0, SWIG-1.3.29,
the following call to DrawEllipticArc causes a segmentation fault:

import wx

class DrawPanel(wx.Frame):
def init(self):
wx.Frame.init(self, None, title=“Draw on Panel”)
self.Bind(wx.EVT_PAINT, self.OnPaint)

def OnPaint(self, event=None):
    dc = wx.PaintDC(self)
    dc.Clear()
    dc.SetPen(wx.Pen(wx.BLACK, 4))
    dc.SetBrush(wx.TRANSPARENT_BRUSH)

    dc.DrawEllipticArc(10, 10, 350, 200, 0, 180)

app = wx.App(False)
frame = DrawPanel()
frame.Show()
app.MainLoop()

GDB shows the following:

Thread 1 “python” received signal SIGSEGV, Segmentation fault.
0xb6ed6657 in wxGraphicsPath::GetBox(double*, double*, double*, double*) const () from /lib/libwx_gtk3u_core-3.0.so.0
(gdb) bt
#0 0xb6ed6657 in wxGraphicsPath::GetBox(double*, double*, double*, double*) const () from /lib/libwx_gtk3u_core-3.0.so.0
#1 0xb6ed8674 in wxGraphicsPath::GetBox() const () from /lib/libwx_gtk3u_core-3.0.so.0
#2 0xb6e7df16 in wxGCDCImpl::DoDrawEllipticArc(int, int, int, int, double, double) () from /lib/libwx_gtk3u_core-3.0.so.0
#3 0xafe438b7 in _wrap_DC_DrawEllipticArc () from /usr/lib/python2.7/site-packages/wx-3.0-gtk3/wx/gdi.so

I can reproduce it.

It looks like it was fixed in wxWidgets some time ago:
https://github.com/wxWidgets/wxWidgets/commit/148971013ee48926dfe153ca39c94be92acde37c

Do you use the Fedora packages for wxWidgets? If so, I can update them to include the patch. If not, you'll probably have to patch the source yourself as I don't expect Robin will make any more wxPython Classic releases.

···

On Tue, 20 Sep 2016, Hélio Guilherme wrote:

There was no crash here:
Fedora 22, 64-bit, Python 2.7.10, wxPython 3.0.2.0, (SWIG-3.0.7 but not sure
if the one for 3.0.2)
Also worked with wxPython 3.0.3 recent dev.

terça-feira, 20 de Setembro de 2016 às 17:17:32 UTC+1, ABC escreveu:
      On Fedora 24, 32-bit, Python 2.7.12, wxPython 3.0.2.0,
      SWIG-1.3.29,
      the following call to DrawEllipticArc causes a segmentation
      fault:

      import wx

      class DrawPanel(wx.Frame):
       def __init__(self):
       wx.Frame.__init__(self, None, title="Draw on Panel")
       self.Bind(wx.EVT_PAINT, self.OnPaint)

       def OnPaint(self, event=None):
       dc = wx.PaintDC(self)
       dc.Clear()
       dc.SetPen(wx.Pen(wx.BLACK, 4))
       dc.SetBrush(wx.TRANSPARENT_BRUSH)

       dc.DrawEllipticArc(10, 10, 350, 200, 0, 180)

      app = wx.App(False)
      frame = DrawPanel()
      frame.Show()
      app.MainLoop()

      GDB shows the following:

      Thread 1 "python" received signal SIGSEGV, Segmentation fault.
      0xb6ed6657 in wxGraphicsPath::GetBox(double*, double*, double*,
      double*) const () from /lib/libwx_gtk3u_core-3.0.so.0
      (gdb) bt
      #0 0xb6ed6657 in wxGraphicsPath::GetBox(double*, double*,
      double*, double*) const () from /lib/libwx_gtk3u_core-3.0.so.0
      #1 0xb6ed8674 in wxGraphicsPath::GetBox() const () from
      /lib/libwx_gtk3u_core-3.0.so.0
      #2 0xb6e7df16 in wxGCDCImpl::DoDrawEllipticArc(int, int, int,
      int, double, double) () from /lib/libwx_gtk3u_core-3.0.so.0
      #3 0xafe438b7 in _wrap_DC_DrawEllipticArc () from
      /usr/lib/python2.7/site-packages/wx-3.0-gtk3/wx/_gdi_.so

--
You received this message because you are subscribed to the Google Groups
"wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxPython-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thank you folks for testing it out!
It would be a tremendous help, if this fix can find its way into a
form, that I can automatically bring it over with Fedora and wxPython.
I don't have the knowledge to build the code myself.

When I check
dnf install wxWidgets
my Fedora 24 reports:
Package wxGTK3-3.0.2-19.fc24.i686 is already installed, skipping.

For wxPython I get:
Package wxPython-3.0.2.0-10.fc24.i686 is already installed, skipping.

···

On Tue, Sep 20, 2016 at 5:02 PM, Scott Talbert <swt@techie.net> wrote:

I can reproduce it.

It looks like it was fixed in wxWidgets some time ago:
fix crash in wxGCDC::DrawEllipticArc() after r76954, closes #16623 · wxWidgets/wxWidgets@1489710 · GitHub

Do you use the Fedora packages for wxWidgets? If so, I can update them to
include the patch. If not, you'll probably have to patch the source
yourself as I don't expect Robin will make any more wxPython Classic
releases.

On Tue, 20 Sep 2016, Hélio Guilherme wrote:

There was no crash here:
Fedora 22, 64-bit, Python 2.7.10, wxPython 3.0.2.0, (SWIG-3.0.7 but not
sure
if the one for 3.0.2)
Also worked with wxPython 3.0.3 recent dev.

terça-feira, 20 de Setembro de 2016 às 17:17:32 UTC+1, ABC escreveu:
      On Fedora 24, 32-bit, Python 2.7.12, wxPython 3.0.2.0,
      SWIG-1.3.29,
      the following call to DrawEllipticArc causes a segmentation
      fault:

      import wx

      class DrawPanel(wx.Frame):
          def __init__(self):
              wx.Frame.__init__(self, None, title="Draw on Panel")
              self.Bind(wx.EVT_PAINT, self.OnPaint)

          def OnPaint(self, event=None):
              dc = wx.PaintDC(self)
              dc.Clear()
              dc.SetPen(wx.Pen(wx.BLACK, 4))
              dc.SetBrush(wx.TRANSPARENT_BRUSH)

              dc.DrawEllipticArc(10, 10, 350, 200, 0, 180)

      app = wx.App(False)
      frame = DrawPanel()
      frame.Show()
      app.MainLoop()

      GDB shows the following:

      Thread 1 "python" received signal SIGSEGV, Segmentation fault.
      0xb6ed6657 in wxGraphicsPath::GetBox(double*, double*, double*,
      double*) const () from /lib/libwx_gtk3u_core-3.0.so.0
      (gdb) bt
      #0 0xb6ed6657 in wxGraphicsPath::GetBox(double*, double*,
      double*, double*) const () from /lib/libwx_gtk3u_core-3.0.so.0
      #1 0xb6ed8674 in wxGraphicsPath::GetBox() const () from
      /lib/libwx_gtk3u_core-3.0.so.0
      #2 0xb6e7df16 in wxGCDCImpl::DoDrawEllipticArc(int, int, int,
      int, double, double) () from /lib/libwx_gtk3u_core-3.0.so.0
      #3 0xafe438b7 in _wrap_DC_DrawEllipticArc () from
      /usr/lib/python2.7/site-packages/wx-3.0-gtk3/wx/_gdi_.so

--
You received this message because you are subscribed to the Google Groups
"wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxPython-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "wxPython-dev" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/wxPython-dev/_NU0PAYTrIE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
wxPython-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Please let me know whether you’ll be able to port the bug fix into Fedora’s wxGTK3 package.

Are the steps to compile wxGTK as listed in the wiki?
https://wiki.wxpython.org/How to install wxPython

I appreciate your effort in maintaining ver 3.0 while preparing Phoenix for official release.

Yes, I plan to do so. There's currently already a wxGTK3 package update in testing and it's tied to a wxGTK (2.8.x) update, so I'd rather let that go through first and then do another update. So, it might take a week or so.

Scott

···

On Fri, 23 Sep 2016, ABC wrote:

Please let me know whether you'll be able to port the bug fix into Fedora's
wxGTK3 package.

Are the steps to compile wxGTK as listed in the wiki?
https://wiki.wxpython.org/How to install wxPython

I appreciate your effort in maintaining ver 3.0 while preparing Phoenix for
official release.

OK, it's built and in Rawhide. I'll do an update for the stable releases once the current update clears.

Scott

···

On Fri, 23 Sep 2016, ABC wrote:

Please let me know whether you'll be able to port the bug fix into Fedora's
wxGTK3 package.

Are the steps to compile wxGTK as listed in the wiki?
https://wiki.wxpython.org/How to install wxPython

I appreciate your effort in maintaining ver 3.0 while preparing Phoenix for
official release.

If you want to use the packages now, you can download them directly from Koji and install them manually:

http://koji.fedoraproject.org/koji/buildinfo?buildID=804157

Scott

···

On Sat, 24 Sep 2016, Scott Talbert wrote:

Please let me know whether you'll be able to port the bug fix into Fedora's
wxGTK3 package.

Are the steps to compile wxGTK as listed in the wiki?
https://wiki.wxpython.org/How to install wxPython

I appreciate your effort in maintaining ver 3.0 while preparing Phoenix for
official release.

OK, it's built and in Rawhide. I'll do an update for the stable releases once the current update clears.

Thank you for porting the bug fixes.
I'd rather avoid doing this myself, if I can,
therefore I'll wait until you prepare the Fedora package, and then use
dnf to bring it over.

···

On Sat, Sep 24, 2016 at 4:12 PM, Scott Talbert <swt@techie.net> wrote:

On Sat, 24 Sep 2016, Scott Talbert wrote:

Please let me know whether you'll be able to port the bug fix into
Fedora's
wxGTK3 package.

Are the steps to compile wxGTK as listed in the wiki?
https://wiki.wxpython.org/How to install wxPython

I appreciate your effort in maintaining ver 3.0 while preparing Phoenix
for
official release.

OK, it's built and in Rawhide. I'll do an update for the stable releases
once the current update clears.

If you want to use the packages now, you can download them directly from
Koji and install them manually:

wxGTK3-3.0.2-24.fc24 | Build Info | koji

Scott

--
You received this message because you are subscribed to a topic in the
Google Groups "wxPython-dev" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/wxPython-dev/_NU0PAYTrIE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
wxPython-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I manually updated my installed packages with your rpm files, and now it works.
Thanks for the fix.

Great. There is an update in progress (there was one previously but it got obsoleted so the time delay got reset), so the official packages should be out soon.

···

On Mon, 10 Oct 2016, ABC wrote:

I manually updated my installed packages with your rpm files, and now it
works.
Thanks for the fix.

--
You received this message because you are subscribed to the Google Groups
"wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxPython-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

If I want to update an Ubuntu 16.04 with your latest fix, how can I do that?

You want the same patch to be released with an official Ubuntu 16.04 update, or you just want a package with the patch applied?

···

On Fri, 14 Oct 2016, ABC wrote:

If I want to update an Ubuntu 16.04 with your latest fix, how can I do that?

I'm not sure whether my Fedora 24 pyInstaller-compiled wxPython
program will run and work identically on Ubuntu 16.04 LTS.
So I thought of preparing for the need to compile my program on Ubuntu too.
But from further research, I think both distros use glibc 2.23, so
perhaps I won't need to recompile on Ubuntu.

In the public interest, it is a good idea to have an Ubuntu package
ready with the patch.
I appreciate your effort in maintaining these packages!

I installed an Ubuntu 16.04 LTS on a VM, and fully updated it.
I then installed wxPython 3.0.2.0, and interestingly, there is no issue drawing elliptic arcs. Is your fix in?

The Fedora 24 pyinstaller-compiled program runs on Ubuntu, but the menu bar and toolbar do not look right, and I get tons of warnings from GTK, starting with:
Gtk-WARNING **: Theme parsing error: gtk.css:13:31: The style property GtkMenu:horizontal-padding is deprecated and shouldn’t be used anymore. It will be removed in a future version.

Running the Python code of my program on Ubuntu, looks just fine!

What’s the best approach to getting a binary to look right and work across the major Linux distros?

Ubuntu doesn't have the elliptic arc fix but perhaps the problem only affects the GTK3 build - Ubuntu uses GTK2.

I'm not sure about pyinstaller - I've never used it. Does just taking your Python source files and running them on both distributions work?

···

On Tue, 18 Oct 2016, ABC wrote:

I installed an Ubuntu 16.04 LTS on a VM, and fully updated it.
I then installed wxPython 3.0.2.0, and interestingly, there is no issue
drawing elliptic arcs. Is your fix in?

The Fedora 24 pyinstaller-compiled program runs on Ubuntu, but the menu bar
and toolbar do not look right, and I get tons of warnings from GTK, starting
with:
Gtk-WARNING **: Theme parsing error: gtk.css:13:31: The style property
GtkMenu:horizontal-padding is deprecated and shouldn't be used anymore. It
will be removed in a future version.

Running the Python code of my program on Ubuntu, looks just fine!

What's the best approach to getting a binary to look right and work across
the major Linux distros?

--
You received this message because you are subscribed to the Google Groups
"wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxPython-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yes, the native code runs fine on both, although visual differences exist:

  • Toolbar icons that don’t fit horizontally in the window are grouped into a pull-down menu.
    On Ubuntu the icons are shown OK,
    but on Fedora the pull-down list looks empty, although the tools are there and are clickable…

  • When the program window is larger than wx.Canvas size,
    on Ubuntu the space outside the canvas has the color I gave it (same as on Windows),
    but on Fedora it looks gray.

  • SpinCtrl up/down arrows are aligned horizontally on Fedora, but vertically on Ubuntu.

Yes, the native code runs fine on both, although visual differences exist:

- Toolbar icons that don't fit horizontally in the window are grouped into a
pull-down menu.
On Ubuntu the icons are shown OK,
but on Fedora the pull-down list looks empty, although the tools are there
and are clickable...

Could potentially bug in wxWidgets GTK+3 implementation? I've seen reports of similar things, I think.

- When the program window is larger than wx.Canvas size,
on Ubuntu the space outside the canvas has the color I gave it (same as on
Windows),
but on Fedora it looks gray.

Again, potentially a wxWidgets GTK+3 bug.

- SpinCtrl up/down arrows are aligned horizontally on Fedora, but vertically
on Ubuntu.

That's due to a difference between GTK+2 and GTK+3 SpinButtons. Compare:
https://developer.gnome.org/gtk2/stable/GtkSpinButton.html

Scott

···

On Wed, 19 Oct 2016, ABC wrote:

Is it supposed to be OK to run a GTK2 compiled binary (Ubuntu) on a
GTK3 system (Fedora)?
When I run my Ubuntu binary on Fedora, the first error is:
GdkPixbuf-WARNING **: Cannot open pixbuf loader module file
'/usr/lib/i386-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such
file or directory

Can I select which GTK to use, e.g. GTK2 on Fedora instead of GTK3?

It depends what you mean by binary. You're just talking about your pure wxPython code, right (.py files)? In that case, yes, it should be 100% portable. If you are talking about actual binary code, the answer is more complicated.

No, you can't generally select which GTK you want to use, as on Fedora the official wxPython package is built for GTK3 only. You could, of course, compile your own wxPython if you really wanted a GTK2 version.

···

On Wed, 19 Oct 2016, Nitzan Weinberg wrote:

Is it supposed to be OK to run a GTK2 compiled binary (Ubuntu) on a
GTK3 system (Fedora)?
When I run my Ubuntu binary on Fedora, the first error is:
GdkPixbuf-WARNING **: Cannot open pixbuf loader module file
'/usr/lib/i386-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such
file or directory

Can I select which GTK to use, e.g. GTK2 on Fedora instead of GTK3?

--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.