473,856 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

hp 11.11 64 bit python 2.5 build gets error "import site failed"

I am on a hp 11.11 machine doing a 64 bit python 2.5 build. When I get
my python executable created and run it, I get the error:

"import site failed"
OverflowError: signed integer is greater than the maximum.
This is happening in the convertsimple() routine when it tries to
return a signed int:

ival = PyInt_AsLong(ar g)

the ival is larger than what is defined in INT_MAX.

Why is this happening in a standard HP 64 bit build?
Any help on fixing this problem is greatly appreciated.

Brad

May 2 '07 #1
6 2066
"import site failed"
OverflowError: signed integer is greater than the maximum.
This is happening in the convertsimple() routine when it tries to
return a signed int:

ival = PyInt_AsLong(ar g)

the ival is larger than what is defined in INT_MAX.

Why is this happening in a standard HP 64 bit build?
Can you provide a complete gdb/dbx backtrace?

Some function tries to convert a Python int into a C int,
using the "i" conversion character. Python int uses C long
for internal representation, and that particular C long
happens to be larger than INT_MAX. This is quite reasonable
to happen in principle, but shouldn't happen on interpreter
startup.

So the questions are:
- what are the callers of convertsimple here? (in particular,
where does the call to PyArg_ParseTupl e come from?)
- what is the value of ival?
- where does that number come from?

The first two questions are best answered with a C debugger.
Depending on the answer, the third question may nor may not
need an answer.

Good luck,
Martin

P.S. If you are asking in the more abstract sense "why is that
happening to me?", the answer is "because you are using an
uncommon platform on which Python sees little or no testing".
To work around, try a 32-bit build, or switch to Solaris,
OS X, Debian Linux, or (heaven forbid) MS Windows :-)
May 2 '07 #2
On May 2, 5:09 pm, "Martin v. Löwis" <mar...@v.loewi s.dewrote:
"import site failed"
OverflowError: signed integer is greater than the maximum.
This is happening in the convertsimple() routine when it tries to
return a signed int:
ival = PyInt_AsLong(ar g)
the ival is larger than what is defined in INT_MAX.
Why is this happening in a standard HP 64 bit build?

Can you provide a complete gdb/dbx backtrace?

Some function tries to convert a Python int into a C int,
using the "i" conversion character. Python int uses C long
for internal representation, and that particular C long
happens to be larger than INT_MAX. This is quite reasonable
to happen in principle, but shouldn't happen on interpreter
startup.

So the questions are:
- what are the callers of convertsimple here? (in particular,
where does the call to PyArg_ParseTupl e come from?)
- what is the value of ival?
- where does that number come from?

The first two questions are best answered with a C debugger.
Depending on the answer, the third question may nor may not
need an answer.

Good luck,
Martin

P.S. If you are asking in the more abstract sense "why is that
happening to me?", the answer is "because you are using an
uncommon platform on which Python sees little or no testing".
To work around, try a 32-bit build, or switch to Solaris,
OS X, Debian Linux, or (heaven forbid) MS Windows :-)

- what are the callers of convertsimple here? (in particular,
where does the call to PyArg_ParseTupl e come from?)
since the debugger locks up when I run, here is a printf call stack of
where things are happening:

import site # precompiled from ...
builtin___impor t__
PyArg_ParseTupl eAndKeywords
vgetargskeyword s: positional arg: 0
convertitem
vgetargskeyword s: positional arg: 1
convertitem
vgetargskeyword s: positional arg: 2
convertitem
vgetargskeyword s: positional arg: 3
convertitem
vgetargskeyword s: positional arg: 4
convertitem
- what is the value of ival?
ival: 4294967295
- where does that number come from?
It is coming from the call to PyInt_AsLong. In that function there is
a call to:
PyInt_AS_LONG(( PyIntObject*)op )
which returns the value of ival.

I wish we could just skip this port, but it is required for our
product that we have HP 64 bit. This did not happen with python 2.3.1
or 2.0.

Thanks for the help.

Brad

May 3 '07 #3
bh**********@gm ail.com schrieb:
I am on a hp 11.11 machine doing a 64 bit python 2.5 build. When I get
my python executable created and run it, I get the error:

"import site failed"
OverflowError: signed integer is greater than the maximum.
Are you sure about the error message? That error is never produced
in Python. Instead, it may print an OverflowError with

signed integer is greater than maximum

(i.e. no period, no "the").

Regards,
Martin
May 3 '07 #4
>>"import site failed"
>>OverflowError : signed integer is greater than the maximum.
>- what is the value of ival?
ival: 4294967295
I see. This is 0xFFFFFFFF, which would be -1 if it were of type
int. So perhaps some value got cast incorrectly at some point,
breaking subsequent computations
>
>- where does that number come from?

It is coming from the call to PyInt_AsLong. In that function there is
a call to:
PyInt_AS_LONG(( PyIntObject*)op )
which returns the value of ival.
That was not my question, really. I wanted to know where the object
whose AsLong value was taken came from. And before you say "it's
in the arg parameter" of convertsimple() - sure it is. However, how
did it get there? It's in an argument tuple - and where came
that from?

IOW, you really need to know who the caller of convertsimple is,
and what line of Python code precisely was triggering that call.

Regards,
Martin
May 3 '07 #5
On May 3, 2:54 pm, "Martin v. Löwis" <mar...@v.loewi s.dewrote:
>"import site failed"
OverflowErro r: signed integer is greater than the maximum.
- what is the value of ival?
ival: 4294967295

I see. This is 0xFFFFFFFF, which would be -1 if it were of type
int. So perhaps some value got cast incorrectly at some point,
breaking subsequent computations
- where does that number come from?
It is coming from the call to PyInt_AsLong. In that function there is
a call to:
PyInt_AS_LONG(( PyIntObject*)op )
which returns the value of ival.

That was not my question, really. I wanted to know where the object
whose AsLong value was taken came from. And before you say "it's
in the arg parameter" of convertsimple() - sure it is. However, how
did it get there? It's in an argument tuple - and where came
that from?
Looking at the call stack OP posted, -1 is coming as forth parameter
of
__import__, I *guess* at the first import in site.py or at implicit
"import site". I think it'd be helpful if OP also tried if it works:
python -S -c -v "print -1, type(-1), id(0), id(-1)"
-- Leo

May 4 '07 #6
On May 4, 1:17 am, Leo Kislov <Leo.Kis...@gma il.comwrote:
On May 3, 2:54 pm, "Martin v. Löwis" <mar...@v.loewi s.dewrote:
>>"import site failed"
>>OverflowError : signed integer is greater than the maximum.
>- what is the value of ival?
ival: 4294967295
I see. This is 0xFFFFFFFF, which would be -1 if it were of type
int. So perhaps some value got cast incorrectly at some point,
breaking subsequent computations
>- where does that number come from?
It is coming from the call to PyInt_AsLong. In that function there is
a call to:
PyInt_AS_LONG(( PyIntObject*)op )
which returns the value of ival.
That was not my question, really. I wanted to know where the object
whose AsLong value was taken came from. And before you say "it's
in the arg parameter" of convertsimple() - sure it is. However, how
did it get there? It's in an argument tuple - and where came
that from?

Looking at the call stack OP posted, -1 is coming as forth parameter
of
__import__, I *guess* at the first import in site.py or at implicit
"import site". I think it'd be helpful if OP also tried if it works:
python -S -c -v "print -1, type(-1), id(0), id(-1)"

-- Leo
Here is the output, along with my printf statements that show the call
stack:

builtin___impor t__
PyArg_ParseTupl eAndKeywords
vgetargskeyword s: positional arg: 0
convertitem
vgetargskeyword s: positional arg: 1
convertitem
vgetargskeyword s: positional arg: 2
convertitem
vgetargskeyword s: positional arg: 3
convertitem
builtin___impor t__
PyArg_ParseTupl eAndKeywords
vgetargskeyword s: positional arg: 0
convertitem
vgetargskeyword s: positional arg: 1
convertitem
vgetargskeyword s: positional arg: 2
convertitem
vgetargskeyword s: positional arg: 3
convertitem
BRAD 20
PyArg_ParseTupl eAndKeywords
vgetargskeyword s: positional arg: 0
convertitem
vgetargskeyword s: positional arg: 1
convertitem
vgetargskeyword s: positional arg: 2
convertitem
builtin___impor t__
PyArg_ParseTupl eAndKeywords
vgetargskeyword s: positional arg: 0
convertitem
vgetargskeyword s: positional arg: 1
convertitem
vgetargskeyword s: positional arg: 2
convertitem
vgetargskeyword s: positional arg: 3
convertitem
builtin___impor t__
PyArg_ParseTupl eAndKeywords
vgetargskeyword s: positional arg: 0
convertitem
vgetargskeyword s: positional arg: 1
convertitem
vgetargskeyword s: positional arg: 2
convertitem
vgetargskeyword s: positional arg: 3
convertitem
convertitem
convertitem
convertitem
convertitem
builtin___impor t__
PyArg_ParseTupl eAndKeywords
vgetargskeyword s: positional arg: 0
convertitem
vgetargskeyword s: positional arg: 1
convertitem
vgetargskeyword s: positional arg: 2
convertitem
vgetargskeyword s: positional arg: 3
convertitem
vgetargskeyword s: positional arg: 4
convertitem
ival: 4294967295
builtin___impor t__
PyArg_ParseTupl eAndKeywords
vgetargskeyword s: positional arg: 0
convertitem
vgetargskeyword s: positional arg: 1
convertitem
vgetargskeyword s: positional arg: 2
convertitem
vgetargskeyword s: positional arg: 3
convertitem
vgetargskeyword s: positional arg: 4
convertitem
ival: 4294967295
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'v' is not defined

May 4 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2592
by: Vio | last post by:
Hi, I've been trying to embed (statically) wxPy alongside an embedded py interpreter on a linux/gtk box. At one point, for some reason misc.o linking reported "multiple definitions of wxGetFreeMemory()". Since wxGetFreeMemory() seemed effectively unused in gtk, I just commented it out in misc_wrap.cpp (didn't want to patch SWIG to regenerate the wrapper code, so hacked the generated cpp source), and replaced...
3
3925
by: gerald.maher | last post by:
Hi, I am trying to excuate the follwong code: I get the following error: Here is my Lib path:
0
2734
by: Bill Davy | last post by:
I am working with MSVC6 on Windows XP. I have created an MSVC project called SHIP I have a file SHIP.i with "%module SHIP" as the first line (file is below). I run SHIP.i through SWIG 1.3.24 to obtain SHIP_wrap.cpp and SHIP.py; the latter contains the line "import _SHIP". I compile SHIP_wrap.cpp and a bunch of files into a DLL which I have the
0
2201
by: camaro77 majau via DotNetMonster.com | last post by:
Sorry by my english but i'm from spain. I have a problem and after search by the web i have know that is due by framework. The message is : setup error "failed to load ressouces from resource file please check your setup" It only appears when i'm using a p2p program called elephant,who needs framework to run.some month ago I instaled for first time elephant and framework,but i don't remember whar version of framework i had
3
5437
by: Mudcat | last post by:
I have a directory structure that contains different modules that run depending on what the user selects. They are identical in name and structure, but what varies is the content of the functions. They will only need to be run once per execution. Example (directory level): Sys1: A B C
5
2642
by: Vijaya P Krishna | last post by:
Hi, I have a .NET Windows Forms application, written in VB.NET and C#. I am opening a URL from the application using Process.Start(). The URL points to a java servlet running on apache-tomcat. For some users the application shows an error dialog with following information. Another very interesting observation is that it's sending a lot of requests to the servlet within no time. Please note that this is not happening for all users.
3
6875
by: Jim Hill | last post by:
Well, I've found about a hundred thousand web pages where people have had the same problem I have but nary a page with a solution that works for me. I want to do a simple embed, so I've followed the example in the Extending and Embedding documentation: In the .c file, #include <Python.h>
5
3286
by: xieliwei | last post by:
I have a freshly installed openSuSe 10.2 with PHP4 from http://download.opensuse.org/repositories/home:/michal-m:/php4/openSUSE_10.2/ (openSuSe abandoned PHP4 since version 10, but I have customers who need php4 support) The version strings are as follows: # uname -a Linux server2 2.6.18.2-34-default #1 SMP Mon Nov 27 11:46:27 UTC 2006 i686 athlon i386 GNU/Linux
2
9607
by: tvnaidu | last post by:
valgrind error - "failed to start tool 'memcheck' for platform x86-linux" no such file or dir copied all lib and bin files which are generated after I compiled valgrind package, when I run my exe with valgrind, I am getting above error, any idea? lib/ -rw-r--r-- 1 0 0 27934 default.supp -rwxr-xr-x 1 0 0 4636305 cachegrind-x86-linux -rwxr-xr-x 1 0 0 4891451 callgrind-x86-linux...
0
9916
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10782
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7932
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7094
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5761
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5958
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4575
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4174
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3201
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.