Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > "Error en el bus" from python

Reply
Thread Tools

"Error en el bus" from python

 
 
Yusniel
Guest
Posts: n/a
 
      10-11-2009
Hi. I did installed a library for python named pyswip-0.2.2 but when I
run a python example with the next lines, the python interpreter, it
throw me the following error: "Error en el bus". The code lines are:

from pyswip.prolog import Prolog
from pyswip.easy import getList, registerForeign

N = 3 # Number of disks

def main():
def notify(t):
print "move disk from %s pole to %s pole." % tuple(t)
notify.arity = 1

prolog = Prolog()
registerForeign(notify)
prolog.consult("hanoi.pl")
list(prolog.query("hanoi(%d)" % N))

if __name__ == "__main__":
main()

where "hanoy.pl" is a program with python code. Any solution for this
error?. Thanks.
 
Reply With Quote
 
 
 
 
Steven D'Aprano
Guest
Posts: n/a
 
      10-11-2009
On Sun, 11 Oct 2009 13:45:54 -0700, Yusniel wrote:

> Hi. I did installed a library for python named pyswip-0.2.2 but when I
> run a python example with the next lines, the python interpreter, it
> throw me the following error: "Error en el bus".

....
> where "hanoy.pl" is a program with python code. Any solution for this
> error?. Thanks.


Please post the entire traceback.


--
Steven
 
Reply With Quote
 
 
 
 
Yusniel
Guest
Posts: n/a
 
      10-12-2009
On 11 oct, 18:29, Steven D'Aprano <st...@REMOVE-THIS-
cybersource.com.au> wrote:
> On Sun, 11 Oct 2009 13:45:54 -0700, Yusniel wrote:
> > Hi. I did installed a library for python named pyswip-0.2.2 but when I
> > run a python example with the next lines, the python interpreter, it
> > throw me the following error: "Error en el bus".

> ...
> > where "hanoy.pl" is a program with python code. Any solution for this
> > error?. Thanks.

>
> Please post the entire traceback.
>
> --
> Steven


Steven. Thanks for your answer. In this case, I am running the script
in a terminal and the error is: "Error en el bus" only this, not more.
Any idea?.
 
Reply With Quote
 
Philip Semanchuk
Guest
Posts: n/a
 
      10-12-2009

On Oct 11, 2009, at 4:45 PM, Yusniel wrote:

> Hi. I did installed a library for python named pyswip-0.2.2 but when I
> run a python example with the next lines, the python interpreter, it
> throw me the following error: "Error en el bus". The code lines are:
>
> from pyswip.prolog import Prolog
> from pyswip.easy import getList, registerForeign
>
> N = 3 # Number of disks
>
> def main():
> def notify(t):
> print "move disk from %s pole to %s pole." % tuple(t)
> notify.arity = 1
>
> prolog = Prolog()
> registerForeign(notify)
> prolog.consult("hanoi.pl")
> list(prolog.query("hanoi(%d)" % N))
>
> if __name__ == "__main__":
> main()
>
> where "hanoy.pl" is a program with python code. Any solution for this
> error?. Thanks.


Are you on a Mac by any chance? I get a "bus error" out of Python once
in a while, usually when a C library has done something bad. I don't
know if this error is specific to OS X or not.

The first thing you need to do is comment out lines one by one to see
where the problem occurs. I'd start by commenting out all four calls
to the pyswip.prolog library:

# prolog = Prolog()
# registerForeign(notify)
# prolog.consult("hanoi.pl")
# list(prolog.query("hanoi(%d)" % N))

If the bus error no longer occurs, then you know the problem is in the
pyswip.prolog library. With that knowledge, I'd move to the mailing
list or newsgroup for pyswip.

Hope that helps
Philip




 
Reply With Quote
 
Dennis Lee Bieber
Guest
Posts: n/a
 
      10-12-2009
On Sun, 11 Oct 2009 13:45:54 -0700 (PDT), Yusniel <(E-Mail Removed)>
declaimed the following in gmane.comp.python.general:


> prolog.consult("hanoi.pl")

<snip>
> where "hanoy.pl" is a program with python code. Any solution for this
> error?. Thanks.


Are you sure? .pl is a common extension for PERL programs, not
Python.
--
Wulfraed Dennis Lee Bieber KD6MOG
http://www.velocityreviews.com/forums/(E-Mail Removed) HTTP://wlfraed.home.netcom.com/

 
Reply With Quote
 
Philip Semanchuk
Guest
Posts: n/a
 
      10-12-2009

On Oct 11, 2009, at 11:56 PM, Dennis Lee Bieber wrote:

> On Sun, 11 Oct 2009 13:45:54 -0700 (PDT), Yusniel <(E-Mail Removed)
> >

> declaimed the following in gmane.comp.python.general:
>
>
>> prolog.consult("hanoi.pl")

> <snip>
>> where "hanoy.pl" is a program with python code. Any solution for this
>> error?. Thanks.

>
> Are you sure? .pl is a common extension for PERL programs, not
> Python.


My guess is that it is also a common extension for Prolog programs. I
think the OP's "program with python code" should have been "program
with prolog code".



 
Reply With Quote
 
Yusniel
Guest
Posts: n/a
 
      10-12-2009
On 12 oct, 00:08, Philip Semanchuk <(E-Mail Removed)> wrote:
> On Oct 11, 2009, at 11:56 PM, Dennis Lee Bieber wrote:
>
> > On Sun, 11 Oct 2009 13:45:54 -0700 (PDT), Yusniel <(E-Mail Removed)

>
> > declaimed the following in gmane.comp.python.general:

>
> >> * *prolog.consult("hanoi.pl")

> > * *<snip>
> >> where "hanoy.pl" is a program with python code. Any solution for this
> >> error?. Thanks.

>
> > * *Are you sure? .pl is a common extension for PERL programs, not
> > Python.

>
> My guess is that it is also a common extension for Prolog programs. I *
> think the OP's "program with python code" should have been "program *
> with prolog code".


Exactly. "hanoi.pl" is a prolog program. I'm using Ubuntu(9.04) 32
bit. In this case, this error is generated when I try run the above
script. However, others scripts in python, not throws this error, I
think that there are some problem with this library.
 
Reply With Quote
 
Philip Semanchuk
Guest
Posts: n/a
 
      10-12-2009

On Oct 12, 2009, at 11:27 AM, Yusniel wrote:

> On 12 oct, 00:08, Philip Semanchuk <(E-Mail Removed)> wrote:
>> On Oct 11, 2009, at 11:56 PM, Dennis Lee Bieber wrote:
>>
>>> On Sun, 11 Oct 2009 13:45:54 -0700 (PDT), Yusniel
>>> <(E-Mail Removed)

>>
>>> declaimed the following in gmane.comp.python.general:

>>
>>>> prolog.consult("hanoi.pl")
>>> <snip>
>>>> where "hanoy.pl" is a program with python code. Any solution for
>>>> this
>>>> error?. Thanks.

>>
>>> Are you sure? .pl is a common extension for PERL programs, not
>>> Python.

>>
>> My guess is that it is also a common extension for Prolog programs. I
>> think the OP's "program with python code" should have been "program
>> with prolog code".

>
> Exactly. "hanoi.pl" is a prolog program. I'm using Ubuntu(9.04) 32
> bit. In this case, this error is generated when I try run the above
> script. However, others scripts in python, not throws this error, I
> think that there are some problem with this library.



Sounds like it's time to talk to whoever supports the Prolog library,
then.

Good luck
Philip


 
Reply With Quote
 
Carsten Haese
Guest
Posts: n/a
 
      10-12-2009
Yusniel wrote:
> Exactly. "hanoi.pl" is a prolog program. I'm using Ubuntu(9.04) 32
> bit. In this case, this error is generated when I try run the above
> script. However, others scripts in python, not throws this error, I
> think that there are some problem with this library.


Maybe, but it's impossible to tell what exactly the problem is if you
don't show us your code. hanoi.pl is part of your code, but you haven't
posted it. Please post it.

--
Carsten Haese
http://informixdb.sourceforge.net

 
Reply With Quote
 
Jorgen Grahn
Guest
Posts: n/a
 
      10-12-2009
On Mon, 2009-10-12, Philip Semanchuk wrote:
>
> On Oct 11, 2009, at 4:45 PM, Yusniel wrote:
>
>> Hi. I did installed a library for python named pyswip-0.2.2 but when I
>> run a python example with the next lines, the python interpreter, it
>> throw me the following error: "Error en el bus". The code lines are:


Makes me think of that guy from the Simpsons, in the bumble-bee suit ...
fortunately you don't need to know tech Spanish to decode this one.

....
> Are you on a Mac by any chance? I get a "bus error" out of Python once
> in a while, usually when a C library has done something bad. I don't
> know if this error is specific to OS X or not.


"Bus Error" is an old BSD-ism which I guess you don't see much in
Linux or Solaris these days (or maybe I never run buggy code . It
translates roughly to "segmentation fault", but IIRC it is more about
accessing memory words on nonaligned adresses than about accessing
addresses your process doesn't own.

[...]

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: [Python-Dev] [python-committers] [RELEASED] Python 3.2 rc 1 R. David Murray Python 0 01-17-2011 02:23 PM
Re: [Python-Dev] [python-committers] [RELEASED] Python 3.2 rc 1 Senthil Kumaran Python 0 01-17-2011 10:31 AM
Re: [Python-Dev] [Python-3000] RELEASED Python 2.6a1 and 3.0a3 Martin v. L÷wis Python 0 03-01-2008 10:51 PM
Re: [Python-Dev] [Python-3000] RELEASED Python 2.6a1 and 3.0a3 Paul Moore Python 0 03-01-2008 10:39 PM
Searching comp.lang.python/python-list@python.org (was: UTF-8) skip@pobox.com Python 0 03-10-2007 02:50 PM



Advertisments