From: Guenter S. <Gue...@ph...> - 2009-08-31 17:03:01
|
I ran into a number of problems with vpython on Linux which appear to be all related. The problems do not happen in Windows. My system is ubuntu 9.04, vpython 5.12 compiled from source (5.11 gives identical results). Thee common feature I see on Linux is, whenever vpython raises an exception, python seg. faults. Example 1: In [1]: from visual import * In [2]: a = vector(1,2,3) In [3]: for i in a: ...: print i ...: ...: 1.0 2.0 3.0 Segmentation fault ~ $ but the following works: Example 2: In [1]: from visual import * In [2]: a = vector(1,2,3) In [3]: for i in a: ...: print i ...: if i>2: ...: break ...: ...: 1.0 2.0 3.0 This seems to point to the raising a StopIteration exception as the problem point. Example 3: In [1]: from visual import * In [2]: a = [1,2,3] In [3]: mag2(a) Out[3]: 14.0 In [4]: a = [1,2,'x'] In [5]: mag2(a) Segmentation fault ~ $ It should have raised a TypeError as in this case In [1]: from visual import * In [2]: a = [1,2,'x'] In [3]: print a[0]*a[0]+a[1]*a[1]+a[2]*a[2] ------> print(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Finally this fails as well: Example 5: In [1]: from visual import * In [2]: quit() Do you really want to exit ([y]/n)? Segmentation fault ~ $ This error is probably caused by a SystemExit exception. Is something wrong with my install? Hard to see how to go wrong there, it's configure, make, make install and taking care of site-packages in ubuntu 9.04. Thank you for your help and the great work. Guenter Schneider |
From: Bruce S. <Bru...@nc...> - 2009-08-31 22:38:00
|
I too am running Ubuntu 9.04, Visual 5.12, and I cannot reproduce any of these errors. I have no idea what could be wrong. What is the statement you used to configure the make? Moreover, your Example 1 is exceptionally strange, as it should not give an error of any kind (nor does it give an error for me). Is it possible that there's a typo in your reporting of Example 1? Bruce Sherwood Guenter Schneider wrote: > I ran into a number of problems with vpython on Linux which appear to be > all related. The problems do not happen in Windows. My system is ubuntu > 9.04, vpython 5.12 compiled from source (5.11 gives identical results). > > Thee common feature I see on Linux is, whenever vpython raises an > exception, python seg. faults. > > Example 1: > > In [1]: from visual import * > > In [2]: a = vector(1,2,3) > > In [3]: for i in a: > ...: print i > ...: > ...: > 1.0 > 2.0 > 3.0 > Segmentation fault > ~ $ > > but the following works: > > Example 2: > > In [1]: from visual import * > > In [2]: a = vector(1,2,3) > > In [3]: for i in a: > ...: print i > ...: if i>2: > ...: break > ...: > ...: > 1.0 > 2.0 > 3.0 > > This seems to point to the raising a StopIteration exception as the > problem point. > > Example 3: > In [1]: from visual import * > > In [2]: a = [1,2,3] > > In [3]: mag2(a) > Out[3]: 14.0 > > In [4]: a = [1,2,'x'] > > In [5]: mag2(a) > Segmentation fault > ~ $ > > It should have raised a TypeError as in this case > > In [1]: from visual import * > > In [2]: a = [1,2,'x'] > > In [3]: print a[0]*a[0]+a[1]*a[1]+a[2]*a[2] > ------> print(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]) > --------------------------------------------------------------------------- > TypeError Traceback (most recent call last) > > Finally this fails as well: > > Example 5: > In [1]: from visual import * > > In [2]: quit() > Do you really want to exit ([y]/n)? > Segmentation fault > ~ $ > > This error is probably caused by a SystemExit exception. > > Is something wrong with my install? Hard to see how to go wrong there, > it's configure, make, make install and taking care of site-packages in > ubuntu 9.04. > > Thank you for your help and the great work. > > Guenter Schneider > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |
From: Guenter S. <Gue...@ph...> - 2009-08-31 23:55:22
|
Thank you for the prompt answers and I am glad it's my setup because that should be easy to fix. There is no typo in the examples. All is cut and paste out of ipython sessions. I should have mentioned I use 64bit Ubuntu. I use boost 1.35 (libboost1.35-dev) and python 2.6.2 I use this script to build and install vpython #!/bin/bash SOFTWARE=visual-5.12_release ARCHIVE=$SOFTWARE.tar.bz2 ARCHIVEDIR="$SOFTWARE" BUILDDIR=$SOFTWARE-install tar jxvf $ARCHIVE mkdir -p $BUILDDIR cd $BUILDDIR aptitude -y install libboost1.35-dev aptitude -y install libsigc++-2.0-dev libgtkmm-2.4-dev libgtkglext1-dev libgtkglext1 libgtkglextmm-x11-1.2-0 libgtkglextmm-x11-1.2-dev libglademm-2.4-1c2a libglademm-2.4-dev ../$ARCHIVEDIR/configure --prefix /usr make #as root cd $BUILDDIR make install echo /usr/lib/python2.6/site-packages >> /usr/lib/python2.6/dist-packages/site-packages.pth If necessary I will setup a clean system from scratch and install vpython there, but I'd rather fix it without going this route. Guenter Schneider Bruce Sherwood wrote: > I too am running Ubuntu 9.04, Visual 5.12, and I cannot reproduce any of these > errors. I have no idea what could be wrong. What is the statement you used to > configure the make? > > Moreover, your Example 1 is exceptionally strange, as it should not give an > error of any kind (nor does it give an error for me). Is it possible that > there's a typo in your reporting of Example 1? > > Bruce Sherwood > > Guenter Schneider wrote: >> I ran into a number of problems with vpython on Linux which appear to be >> all related. The problems do not happen in Windows. My system is ubuntu >> 9.04, vpython 5.12 compiled from source (5.11 gives identical results). >> >> Thee common feature I see on Linux is, whenever vpython raises an >> exception, python seg. faults. >> >> Example 1: >> >> In [1]: from visual import * >> >> In [2]: a = vector(1,2,3) >> >> In [3]: for i in a: >> ...: print i >> ...: >> ...: >> 1.0 >> 2.0 >> 3.0 >> Segmentation fault >> ~ $ >> >> but the following works: >> >> Example 2: >> >> In [1]: from visual import * >> >> In [2]: a = vector(1,2,3) >> >> In [3]: for i in a: >> ...: print i >> ...: if i>2: >> ...: break >> ...: >> ...: >> 1.0 >> 2.0 >> 3.0 >> >> This seems to point to the raising a StopIteration exception as the >> problem point. >> >> Example 3: >> In [1]: from visual import * >> >> In [2]: a = [1,2,3] >> >> In [3]: mag2(a) >> Out[3]: 14.0 >> >> In [4]: a = [1,2,'x'] >> >> In [5]: mag2(a) >> Segmentation fault >> ~ $ >> >> It should have raised a TypeError as in this case >> >> In [1]: from visual import * >> >> In [2]: a = [1,2,'x'] >> >> In [3]: print a[0]*a[0]+a[1]*a[1]+a[2]*a[2] >> ------> print(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]) >> --------------------------------------------------------------------------- >> TypeError Traceback (most recent call last) >> >> Finally this fails as well: >> >> Example 5: >> In [1]: from visual import * >> >> In [2]: quit() >> Do you really want to exit ([y]/n)? >> Segmentation fault >> ~ $ >> >> This error is probably caused by a SystemExit exception. >> >> Is something wrong with my install? Hard to see how to go wrong there, >> it's configure, make, make install and taking care of site-packages in >> ubuntu 9.04. >> >> Thank you for your help and the great work. >> >> Guenter Schneider >> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day >> trial. Simplify your report design, integration and deployment - and focus on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> _______________________________________________ >> Visualpython-users mailing list >> Vis...@li... >> https://lists.sourceforge.net/lists/listinfo/visualpython-users > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |
From: Bruce S. <Bru...@nc...> - 2009-09-01 03:34:43
|
I don't understand enough about building on Linux to be sure that it would help, but it might be worth building according to the instructions in INSTALL.txt, since that's how I've built Visual and it works. Moreover, the configure stage will tell you if you're missing certain dependencies. On the other hand, it seems possible that there's some incompatibility between Visual and 64bit Ubuntu (I only have access to 32bit Ubuntu). You suspect that "whenever vpython raises an exception, python seg. faults", but in your Example 1 there's no reason why VPython would raise an exception. Bruce Sherwood Guenter Schneider wrote: > Thank you for the prompt answers and I am glad it's my setup because > that should be easy to fix. > > There is no typo in the examples. All is cut and paste out of ipython > sessions. > > I should have mentioned I use 64bit Ubuntu. > I use boost 1.35 (libboost1.35-dev) and python 2.6.2 > > I use this script to build and install vpython > > #!/bin/bash > > SOFTWARE=visual-5.12_release > ARCHIVE=$SOFTWARE.tar.bz2 > ARCHIVEDIR="$SOFTWARE" > BUILDDIR=$SOFTWARE-install > tar jxvf $ARCHIVE > mkdir -p $BUILDDIR > cd $BUILDDIR > aptitude -y install libboost1.35-dev > aptitude -y install libsigc++-2.0-dev libgtkmm-2.4-dev libgtkglext1-dev > libgtkglext1 libgtkglextmm-x11-1.2-0 libgtkglextmm-x11-1.2-dev > libglademm-2.4-1c2a libglademm-2.4-dev > ../$ARCHIVEDIR/configure --prefix /usr > make > > #as root > cd $BUILDDIR > make install > echo /usr/lib/python2.6/site-packages >> > /usr/lib/python2.6/dist-packages/site-packages.pth > > If necessary I will setup a clean system from scratch and install > vpython there, but I'd rather fix it without going this route. > > Guenter Schneider > |
From: Guenter S. <Gue...@ph...> - 2009-09-16 02:20:29
|
I'll summarize what I learned about installing vpython on ubuntu in a new thread. As for why I believe that exceptions are common to all the examples I presented, a python loop 1 for item in sequence: 2 body is internally equivalent to 1 iter = sequence.__iter__() 2 try: 3 while True: 4 item = iter.next() 5 body 6 except StopIteration: 7 pass Guenter Bruce Sherwood wrote: > I don't understand enough about building on Linux to be sure that it would help, > but it might be worth building according to the instructions in INSTALL.txt, > since that's how I've built Visual and it works. Moreover, the configure stage > will tell you if you're missing certain dependencies. On the other hand, it > seems possible that there's some incompatibility between Visual and 64bit Ubuntu > (I only have access to 32bit Ubuntu). > > You suspect that "whenever vpython raises an exception, python seg. faults", but > in your Example 1 there's no reason why VPython would raise an exception. > > Bruce Sherwood > > Guenter Schneider wrote: >> Thank you for the prompt answers and I am glad it's my setup because >> that should be easy to fix. >> >> There is no typo in the examples. All is cut and paste out of ipython >> sessions. >> >> I should have mentioned I use 64bit Ubuntu. >> I use boost 1.35 (libboost1.35-dev) and python 2.6.2 >> >> I use this script to build and install vpython >> >> #!/bin/bash >> >> SOFTWARE=visual-5.12_release >> ARCHIVE=$SOFTWARE.tar.bz2 >> ARCHIVEDIR="$SOFTWARE" >> BUILDDIR=$SOFTWARE-install >> tar jxvf $ARCHIVE >> mkdir -p $BUILDDIR >> cd $BUILDDIR >> aptitude -y install libboost1.35-dev >> aptitude -y install libsigc++-2.0-dev libgtkmm-2.4-dev libgtkglext1-dev >> libgtkglext1 libgtkglextmm-x11-1.2-0 libgtkglextmm-x11-1.2-dev >> libglademm-2.4-1c2a libglademm-2.4-dev >> ../$ARCHIVEDIR/configure --prefix /usr >> make >> >> #as root >> cd $BUILDDIR >> make install >> echo /usr/lib/python2.6/site-packages >> >> /usr/lib/python2.6/dist-packages/site-packages.pth >> >> If necessary I will setup a clean system from scratch and install >> vpython there, but I'd rather fix it without going this route. >> >> Guenter Schneider >> > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |
From: Robert X. <nne...@gm...> - 2009-08-31 23:09:27
|
---------- Forwarded message ---------- From: Robert Xiao <nne...@gm...> Date: 2009/8/31 Subject: Re: [Visualpython-users] Problems with exception handling in vpython on Linux To: Guenter Schneider <Gue...@ph...> 2009/8/31 Guenter Schneider <Gue...@ph...> > I ran into a number of problems with vpython on Linux which appear to be > all related. The problems do not happen in Windows. My system is ubuntu > 9.04, vpython 5.12 compiled from source (5.11 gives identical results). > What version of the Boost libraries are you using? > Thee common feature I see on Linux is, whenever vpython raises an > exception, python seg. faults. > > Example 1: > > In [1]: from visual import * > > In [2]: a = vector(1,2,3) > > In [3]: for i in a: > ...: print i > ...: > ...: > 1.0 > 2.0 > 3.0 > Segmentation fault > ~ $ > > but the following works: > > Example 2: > > In [1]: from visual import * > > In [2]: a = vector(1,2,3) > > In [3]: for i in a: > ...: print i > ...: if i>2: > ...: break > ...: > ...: > 1.0 > 2.0 > 3.0 > > This seems to point to the raising a StopIteration exception as the > problem point. > > Example 3: > In [1]: from visual import * > > In [2]: a = [1,2,3] > > In [3]: mag2(a) > Out[3]: 14.0 > > In [4]: a = [1,2,'x'] > > In [5]: mag2(a) > Segmentation fault > ~ $ > > It should have raised a TypeError as in this case > It's actually Boost.Python.ArgumentError, since [1,2,'x'] can't be coerced to a vector, so it is passed in as a list. >>> visual.mag2([1,2,'x']) Traceback (most recent call last): File "<stdin>", line 1, in <module> Boost.Python.ArgumentError: Python argument types in visual.cvisual.mag2(list) did not match C++ signature: mag2(class cvisual::vector) mag2(class boost::python::numeric::array) > Finally this fails as well: > > Example 5: > In [1]: from visual import * > > In [2]: quit() > Do you really want to exit ([y]/n)? > Segmentation fault > ~ $ > quit() is a Python built-in, and it isn't overridden by Visual. Does quit() work if you don't import visual? Can you try these tests: vector(1,2,3)[4] # throws std::out_of_range vector('x') faces(pos=[1]) faces(normal=[]) These all directly throw exceptions. 2009/8/31 Bruce Sherwood <Bru...@nc...> > Moreover, your Example 1 is exceptionally strange, as it should not give an > error of any kind (nor does it give an error for me). Is it possible that > there's a typo in your reporting of Example 1? > StopIteration is raised by an iterator when it has no more objects to iterate over. It is not an error, but it can be raised by an iterator. Robert |
From: Guenter S. <Gue...@ph...> - 2009-09-01 03:53:01
|
See below. Robert Xiao wrote: > > > ---------- Forwarded message ---------- > From: *Robert Xiao* <nne...@gm... <mailto:nne...@gm...>> > Date: 2009/8/31 > Subject: Re: [Visualpython-users] Problems with exception handling in > vpython on Linux > To: Guenter Schneider <Gue...@ph... > <mailto:Gue...@ph...>> > > > 2009/8/31 Guenter Schneider <Gue...@ph... > <mailto:Gue...@ph...>> > > I ran into a number of problems with vpython on Linux which appear to be > all related. The problems do not happen in Windows. My system is ubuntu > 9.04, vpython 5.12 compiled from source (5.11 gives identical results). > > > What version of the Boost libraries are you using? boost 1.35 (libboost1.35-dev) > > > Thee common feature I see on Linux is, whenever vpython raises an > exception, python seg. faults. > > Example 1: > > In [1]: from visual import * > > In [2]: a = vector(1,2,3) > > In [3]: for i in a: > ...: print i > ...: > ...: > 1.0 > 2.0 > 3.0 > Segmentation fault > ~ $ > > but the following works: > > Example 2: > > In [1]: from visual import * > > In [2]: a = vector(1,2,3) > > In [3]: for i in a: > ...: print i > ...: if i>2: > ...: break > ...: > ...: > 1.0 > 2.0 > 3.0 > > This seems to point to the raising a StopIteration exception as the > problem point. > > > Example 3: > In [1]: from visual import * > > In [2]: a = [1,2,3] > > In [3]: mag2(a) > Out[3]: 14.0 > > In [4]: a = [1,2,'x'] > > In [5]: mag2(a) > Segmentation fault > ~ $ > > > It should have raised a TypeError as in this case > > It's actually Boost.Python.ArgumentError, since [1,2,'x'] can't be > coerced to a vector, so it is passed in as a list. I was guessing and did not try everything on Windows. > > >>> visual.mag2([1,2,'x']) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > Boost.Python.ArgumentError: Python argument types in > visual.cvisual.mag2(list) > did not match C++ signature: > mag2(class cvisual::vector) > mag2(class boost::python::numeric::array) > > > Finally this fails as well: > > Example 5: > In [1]: from visual import * > > In [2]: quit() > Do you really want to exit ([y]/n)? > Segmentation fault > ~ $ > > quit() is a Python built-in, and it isn't overridden by Visual. Does > quit() work if you don't import visual? Yes. > > Can you try these tests: > vector(1,2,3)[4] # throws std::out_of_range > vector('x') > faces(pos=[1]) > faces(normal=[]) > > These all directly throw exceptions. > All end in seg. faults on my system. In [1]: from visual import * In [2]: faces(normal=[]) Segmentation fault I appreciate your help. Guenter > > > 2009/8/31 Bruce Sherwood <Bru...@nc... > <mailto:Bru...@nc...>> > > Moreover, your Example 1 is exceptionally strange, as it should not > give an > > error of any kind (nor does it give an error for me). Is it possible > that > there's a typo in your reporting of Example 1? > > > StopIteration is raised by an iterator when it has no more objects to > iterate over. It is not an error, but it can be raised by an iterator. > > Robert > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > > > ------------------------------------------------------------------------ > > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users -- ----------------------------------------------------- Guenter Schneider Email: Gue...@ph... Phone: 541 737 1706 Fax: 541 737 1683 Oregon State University Department of Physics 301 Weniger Hall Corvallis, OR 97331-6507, USA ----------------------------------------------------- |
From: Jim T. <jt...@mi...> - 2009-09-01 15:50:33
|
I'm running Ubuntu 9.04 AMD64. I do not get the errors you describe running visual 5.1 built from source. I did have an older version of visual installed from the repositories before that so perhaps there is some dependency that is installed on my system that configure did not catch on yours? However I do remember spending some time satisfying the dependencies to build it. JT Guenter Schneider wrote: > I ran into a number of problems with vpython on Linux which appear to be > all related. The problems do not happen in Windows. My system is ubuntu > 9.04, vpython 5.12 compiled from source (5.11 gives identical results). > > Thee common feature I see on Linux is, whenever vpython raises an > exception, python seg. faults. > > Example 1: > > In [1]: from visual import * > > In [2]: a = vector(1,2,3) > > In [3]: for i in a: > ...: print i > ...: > ...: > 1.0 > 2.0 > 3.0 > Segmentation fault > ~ $ > > but the following works: > > Example 2: > > In [1]: from visual import * > > In [2]: a = vector(1,2,3) > > In [3]: for i in a: > ...: print i > ...: if i>2: > ...: break > ...: > ...: > 1.0 > 2.0 > 3.0 > > This seems to point to the raising a StopIteration exception as the > problem point. > > Example 3: > In [1]: from visual import * > > In [2]: a = [1,2,3] > > In [3]: mag2(a) > Out[3]: 14.0 > > In [4]: a = [1,2,'x'] > > In [5]: mag2(a) > Segmentation fault > ~ $ > > It should have raised a TypeError as in this case > > In [1]: from visual import * > > In [2]: a = [1,2,'x'] > > In [3]: print a[0]*a[0]+a[1]*a[1]+a[2]*a[2] > ------> print(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]) > --------------------------------------------------------------------------- > TypeError Traceback (most recent call last) > > Finally this fails as well: > > Example 5: > In [1]: from visual import * > > In [2]: quit() > Do you really want to exit ([y]/n)? > Segmentation fault > ~ $ > > This error is probably caused by a SystemExit exception. > > Is something wrong with my install? Hard to see how to go wrong there, > it's configure, make, make install and taking care of site-packages in > ubuntu 9.04. > > Thank you for your help and the great work. > > Guenter Schneider > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |