[GRASS-dev] [GRASS GIS] #765: g.gui fails to launch wxpython IU

#765: g.gui fails to launch wxpython IU
--------------------+-------------------------------------------------------
Reporter: marisn | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Keywords: | Platform: Linux
      Cpu: x86-64 |
--------------------+-------------------------------------------------------
When I attempt to launch new wx GUI with g.gui, I get nothing. Same applys
to 6.5 and trunk. If I switch default UI to wxpython one, it starts from
init.sh.
{{{
$ g.gui gui=wxpython
D1/5: Attempting to start 'wxpython' GUI ...
D3/5: forking 'python' ...

$ echo $?
0

$ env | grep -i python
GRASS_PYTHON=python
PYTHONPATH=/home/maris/soft/grass_64/dist.x86_64-unknown-linux-
gnu/etc/python

$ python --version
Python 2.6.2

glacier ~ # equery l '*wx*'
  * Searching for *wx* ...
[IP-] [ ~] app-admin/eselect-wxwidgets-1.1 (0)
[IP-] [ ~] dev-python/wxpython-2.8.10.1 (2.8)
[IP-] [ ~] x11-libs/wxGTK-2.8.10.1-r3 (2.8)

glacier ~ # equery l '*python*'
  * Searching for *python* ...
[IP-] [ ~] app-admin/eselect-python-20090824 (0)
[IP-] [ ~] app-admin/python-updater-0.7 (0)
[IP-] [ ] dev-lang/python-2.4.6 (2.4)
[I-O] [M ] dev-lang/python-2.5.4-r2 (2.5)
[IP-] [ ~] dev-lang/python-2.6.2-r2 (2.6)
[IP-] [ ~] dev-lang/python-3.1.1-r1 (3.1)
[IP-] [ ~] dev-python/dbus-python-0.83.0-r1 (0)
[IP-] [ ~] dev-python/mysql-python-1.2.3_rc1 (0)
[IP-] [ ] dev-python/notify-python-0.1.1-r1 (0)
[IP-] [ ~] dev-python/wxpython-2.8.10.1 (2.8)

}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/765&gt;
GRASS GIS <http://grass.osgeo.org>

#765: g.gui fails to launch wxpython IU
-------------------------+--------------------------------------------------
  Reporter: marisn | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: worksforme | Keywords:
  Platform: Linux | Cpu: x86-64
-------------------------+--------------------------------------------------
Changes (by cmbarton):

  * status: new => closed
  * resolution: => worksforme

Comment:

No one else has mentioned this since it was reported. I cannot reproduce
it. It sort of looks more like a wxwidgets/python version mismatch. I'm
closing with a 'works for me' unless someone still has this problem.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/765#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#765: g.gui fails to launch wxpython IU
---------------------+------------------------------------------------------
  Reporter: marisn | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-64
---------------------+------------------------------------------------------
Changes (by marisn):

  * status: closed => reopened
  * resolution: worksforme =>

Comment:

Michael, please, do NOT close bug only because it works on Your Mac! We
don't have so many testers on various systems and thus it's highly
possible that nobody else has stumbled on specific software configuration
that triggers this issue. Still I would rather love to see this bug fixed
before release and not reopened in few days after release when user
feedback will start to flow in. It still app-lays to my Gentoo system. I
made svn up && make clean on 6.5 branch and every bit of this report is
still true.

g.gui fails to launch new wxgui AND fails to report failure. init.sh works
just fine. If it's Python version mismatch, then it needs to be fixed, as
in such case g.gui and init.sh use different pythons and it may cause also
other bugs.

Updated bits:
{{{
# python --version
Python 2.6.4
# equery l '*python*'
[IP-] [ ~] app-admin/eselect-python-20090824 (0)
[IP-] [ ~] app-admin/python-updater-0.7 (0)
[IP-] [ ] dev-lang/python-2.4.6 (2.4)
[I-O] [M ] dev-lang/python-2.5.4-r2 (2.5)
[IP-] [ ~] dev-lang/python-2.6.4 (2.6)
[IP-] [ ~] dev-lang/python-3.1.1-r1 (3.1)
[IP-] [ ~] dev-python/dbus-python-0.83.0-r1 (0)
[IP-] [ ~] dev-python/mysql-python-1.2.3_rc1 (0)
[IP-] [ ] dev-python/notify-python-0.1.1-r1 (0)
[IP-] [ ~] dev-python/wxpython-2.8.10.1 (2.8)
[IP-] [ ~] kde-base/krosspython-4.3.4 (4.3)
}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/765#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#765: g.gui fails to launch wxpython IU
---------------------+------------------------------------------------------
  Reporter: marisn | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-64
---------------------+------------------------------------------------------
Comment (by yarma):

Same bug in the same conditions on my computer: on my Gentoo box, the
wxpython gui is working very fine if i start grass with gui, but nothing
appends when i try to launch it ussing g.gui ...

my gentoo system is uptodate and i just fetch and build the last svn
grass-6.5 release ...

{{{
GRASS 6.5.svn :~ > g.gui gui=wxpython
D1/5: Attempting to start 'wxpython' GUI ...

GRASS 6.5.svn (Mac):~ > echo $?
0

GRASS 6.5.svn :~ > env | grep -i python
GRASS_PYTHON=python
PYTHONPATH=/opt/grass65/grass-6.5.svn/etc/python

GRASS 6.5.svn :~ > python --version
Python 2.6.4

SuperTux yarma # equery list wx
[ Searching for package 'wx' in all categories among: ]
  * installed packages
[I--] [ ~] app-admin/eselect-wxwidgets-1.1 (0)
[I--] [ ] dev-python/wxpython-2.8.10.1 (2.8)
[I--] [ ~] x11-libs/wxGTK-2.8.10.1-r3 (2.8)

SuperTux yarma # equery list python
[ Searching for package 'python' in all categories among: ]
  * installed packages
[I--] [ ~] app-admin/eselect-python-20090824 (0)
[I--] [ ] app-admin/python-updater-0.7 (0)
[I--] [ ] dev-lang/python-2.6.4 (2.6)
[I--] [ ] dev-python/bug-buddy-python-2.26.0 (0)
[I--] [M~] dev-python/compizconfig-python-0.8.2 (0)
[I--] [ ] dev-python/dbus-python-0.83.0-r1 (0)
[I--] [ ] dev-python/gconf-python-2.26.1 (2)
[I--] [ ] dev-python/gnome-applets-python-2.26.0 (0)
[I--] [ ] dev-python/gnome-desktop-python-2.26.0 (0)
[I--] [ ] dev-python/gnome-keyring-python-2.26.0 (0)
[I--] [ ] dev-python/gnome-python-2.26.1 (2)
[I--] [ ] dev-python/gnome-python-base-2.26.1 (2)
[I--] [ ] dev-python/gnome-python-desktop-base-2.26.0 (0)
[I--] [ ] dev-python/gnome-vfs-python-2.26.1 (2)
[I--] [ ] dev-python/gst-python-0.10.16 (0.10)
[I--] [ ] dev-python/libbonobo-python-2.26.1 (2)
[I--] [ ] dev-python/libgnome-python-2.26.1 (2)
[I--] [ ] dev-python/libgnomecanvas-python-2.26.1 (2)
[I--] [ ] dev-python/libgnomeprint-python-2.26.0 (0)
[I--] [ ] dev-python/libwnck-python-2.26.0 (0)
[I--] [ ] dev-python/python-ldap-2.3.9 (0)
[I--] [ ] dev-python/wxpython-2.8.10.1 (2.8)

}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/765#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#765: g.gui fails to launch wxpython IU
---------------------+------------------------------------------------------
  Reporter: marisn | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-64
---------------------+------------------------------------------------------
Comment (by hamish):

I think you will have to de-fork the call in the g.gui source code in
order to more easily debug it. ie rework the G_spawn_ex() line to
something simpler like G_system().

either that or add in a bunch of debug messages to the G_spawn_ex()
function in lib/gis/ to get a better idea of what's going on.

a bit more involved than your typical debugging advice, but I assume that
folks running Gentoo don't mind poking about under the lid ...

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/765#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#765: g.gui fails to launch wxpython IU
---------------------+------------------------------------------------------
  Reporter: marisn | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-64
---------------------+------------------------------------------------------
Comment (by cmbarton):

Sorry if this is still a problem. Just no one had reported any problem on
this but you and there are often old bugs that get fixed but no one
closes. One thing that is important to sort out is if this is just a
problem with your box, a specific Gentoo version, or all Gentoo.

As to a wxPython and Python mixmatch, I was referring to the possibility
that you have installed the wrong wxPython for the Python that you are
using. The GUI doesn't install wxPython during compilation. If you are
using a pre-compiled binary (it doesn't say in the report), this might be
important. For Mac and Windows, bundling wxPython with the binary solved a
lot of issues. I don't know if this is feasible on Linux or not. If it is,
it might be worth considering.

Michael

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/765#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#765: g.gui fails to launch wxpython IU
---------------------+------------------------------------------------------
  Reporter: marisn | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-64
---------------------+------------------------------------------------------
Comment (by glynn):

Replying to [comment:2 marisn]:

> It still app-lays to my Gentoo system. I made svn up && make clean on
6.5 branch
> and every bit of this report is still true.
>
> g.gui fails to launch new wxgui AND fails to report failure.

It's a Gentoo bug. Gentoo's `/usr/bin/python` is a symlink to `python-
wrapper` which invokes the version of python selected by
`/etc/env.d/python/config`, `$EPYTHON`, etc.

Unfortunately, it also inspects `argv[0]` (which it has no business
doing), which breaks when `argv[0]` is something other than the Python
interpreter or the script.

g.gui passed "wxgui" as `argv[0]`; I "fixed" this in 7.0 with r39764, but
that was before I discovered that it was Gentoo's bug. I'm not sure
whether this should be back-ported or reverted.

This bug has been reported at
[http://bugs.gentoo.org/show_bug.cgi?id=286191], but the Gentoo developers
only appear to be concerned with how it affects Gentoo itself.

As to what to do about it: part of me says to revert it on principle
(Gentoo isn't Microsoft, and shouldn't assume that the rest of the world
will change to accommodate them). OTOH, I don't see any advantage to
passing an "unusual" value for `argv[0]`.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/765#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#765: g.gui fails to launch wxpython IU
---------------------+------------------------------------------------------
  Reporter: marisn | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-64
---------------------+------------------------------------------------------
Comment (by cmbarton):

Does it work if you give the full version of the command ("g.gui
gui=wxpython&") instead of the short version ("g.gui &" or "g.gui
wxpython&")?

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/765#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#765: g.gui fails to launch wxpython IU
---------------------+------------------------------------------------------
  Reporter: marisn | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-64
---------------------+------------------------------------------------------
Comment (by glynn):

Replying to [comment:7 cmbarton]:
> Does it work if you give the full version of the command ("g.gui
gui=wxpython&") instead of the short version ("g.gui &" or "g.gui
wxpython&")?

No. The arguments to g.gui don't have any effect upon `argv[0]`; it won't
work on Gentoo without the r39764 change.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/765#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#765: g.gui fails to launch wxpython IU
---------------------+------------------------------------------------------
  Reporter: marisn | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-64
---------------------+------------------------------------------------------
Comment (by hamish):

Replying to [comment:7 cmbarton]:
> Does it work if you give the full version of the command
> ("g.gui gui=wxpython&") instead of the short version ("g.gui &"
> or "g.gui wxpython&")?

note the "&" should no longer be needed. It backgrounds itself (wait 3
sec).

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/765#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>

#765: g.gui fails to launch wxpython IU
---------------------+------------------------------------------------------
  Reporter: marisn | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-64
---------------------+------------------------------------------------------
Comment (by hamish):

Replying to [comment:8 glynn]:
> The arguments to g.gui don't have any effect upon `argv[0]`; it
> won't work on Gentoo without the r39764 change.

maybe the emerge script for gentoo could apply the needed patch as needed?

(eg the Debian package applies a series of patches to satisfy various
debian-specific quirks which are not relevant to other platforms)

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/765#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>

#765: g.gui fails to launch wxpython IU
---------------------+------------------------------------------------------
  Reporter: marisn | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-64
---------------------+------------------------------------------------------
Comment (by cmbarton):

Unfortunately, the "&" is still needed on the Mac. Run it without the "&"
and the GUI runs modally. I wish it were otherwise.

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/765#comment:11&gt;
GRASS GIS <http://grass.osgeo.org>

#765: g.gui fails to launch wxpython IU
---------------------+------------------------------------------------------
  Reporter: marisn | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-64
---------------------+------------------------------------------------------
Comment (by glynn):

Replying to [comment:11 cmbarton]:
> Unfortunately, the "&" is still needed on the Mac. Run it without the
"&" and the GUI runs modally. I wish it were otherwise.

Which version are you referring to?

7.0 (trunk) and 6.5 (develbranch_6) run it in the background, 6.4
(releasebranch_6_4) runs it in the foreground.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/765#comment:12&gt;
GRASS GIS <http://grass.osgeo.org>

#765: g.gui fails to launch wxpython IU
---------------------+------------------------------------------------------
  Reporter: marisn | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-64
---------------------+------------------------------------------------------
Comment (by cmbarton):

I stand corrected!

I didn't notice, probably because I go back and forth between versions.
Thanks very much.

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/765#comment:13&gt;
GRASS GIS <http://grass.osgeo.org>

#765: g.gui fails to launch wxpython IU
----------------------+-----------------------------------------------------
  Reporter: marisn | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: invalid | Keywords:
  Platform: Linux | Cpu: x86-64
----------------------+-----------------------------------------------------
Changes (by marisn):

  * status: reopened => closed
  * resolution: => invalid

Comment:

Glynn - thanks for hints. Indeed it's a broken python-wrapper. Closing
this bug, as it's a Gentoo issue. After fixing segfault, g.gui now
launches wxpython interface. Still ps fax says "python2.6 /path/to/wxgui".
Does some wgui code relays on argv[0] == wxgui?

Gentoo python-wrapper.c has been written by similar skilled C coders, as
I. char *foo = NULL; if(*foo) -> segfault :slight_smile: Damn' pointers!

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/765#comment:14&gt;
GRASS GIS <http://grass.osgeo.org>

#765: g.gui fails to launch wxpython IU
----------------------+-----------------------------------------------------
  Reporter: marisn | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: invalid | Keywords:
  Platform: Linux | Cpu: x86-64
----------------------+-----------------------------------------------------
Comment (by glynn):

Replying to [comment:14 marisn]:

> Glynn - thanks for hints. Indeed it's a broken python-wrapper. Closing
this bug, as it's a Gentoo issue. After fixing segfault, g.gui now
launches wxpython interface. Still ps fax says "python2.6 /path/to/wxgui".
Does some wgui code relays on `argv[0]` == wxgui?

I'm fairly sure that wxgui doesn't care what `argv[0]` is set to. But
setting it to the full path to the script is "normal" and keeps python-
wrapper happy.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/765#comment:15&gt;
GRASS GIS <http://grass.osgeo.org>