[ python-Bugs-1066546 ] test_pwd fails on 64bit system (Opteron)

SourceForge.net noreply at sourceforge.net
Mon Mar 14 23:17:08 CET 2005


Bugs item #1066546, was opened at 2004-11-15 10:34
Message generated for change (Comment added) made by doerwalter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1066546&group_id=5470

Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Miki Tebeka (tebeka)
Assigned to: Nobody/Anonymous (nobody)
Summary: test_pwd fails on 64bit system (Opteron)

Initial Comment:
test test_pwd failed -- Traceback (most recent call last):
  File "/tmp/miki/Python-2.4b2/Lib/test/test_pwd.py",
line 42, in test_values
    self.assert_(pwd.getpwuid(e.pw_uid) in
entriesbyuid[e.pw_uid])
OverflowError: signed integer is greater than maximum


$ cat /proc/version 
Linux version 2.4.21-20.ELsmp
(bhcompile at dolly.build.redhat.com) (gcc version 3.2.3
20030502 (Red Hat Linux 3.2.3-42)) #1 SMP Wed Aug 18
20:34:58 EDT 2004

Processor is AMD Opteron 2.4MHz

----------------------------------------------------------------------

>Comment By: Walter Dörwald (doerwalter)
Date: 2005-03-14 23:17

Message:
Logged In: YES 
user_id=89016

On a 32bit system adding the line
nobody:x:4294967294:65534:nobody:/:/bin/false
to /etc/passwd pwd.getpwall() gives me an entry:
('nobody', 'x', -2, 65534, 'nobody', '/', '/bin/false')
and
pwd.getpwuid(-2)
gives me
('nobody', 'x', -2, 65534, 'nobody', '/', '/bin/false')

Maybe for 64bit systems the SETI macro should use
PyLong_FromUnsignedLong() instead of PyInt_FromLong()? Can
you try the following patch?

----------------------------------------------------------------------

Comment By: Miki Tebeka (tebeka)
Date: 2004-11-17 09:43

Message:
Logged In: YES 
user_id=358087

1. How do I find the largest user id?
2. It's 4294967294
3. Can't attach etc/password since it's a company machine
(IT will kill me :-)
    However there is a similar line for nobody with 65534

The hardware is 4 CPU with 16GB of memory.
OS is: Red Hat Enterprise Linux AS release 3 (Taroon Update 3)


----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2004-11-17 02:58

Message:
Logged In: YES 
user_id=33168

I just tested this on an opteron and it ran ok, so this
problem isn't necessarily opteron/64-bit specific.  What is
the largest user id on the system?  What is the value of
pw_uid that is causing a problem?  Can you attach your
/etc/passwd file?  If so, you may want to change any user info.

I have:
  nobody:x:65534:65534:nobody:/:/bin/false

I tried adding another nobody with a larger uid, but did not
have any problems with the test.  This is on a gentoo system.

----------------------------------------------------------------------

Comment By: Miki Tebeka (tebeka)
Date: 2004-11-15 10:36

Message:
Logged In: YES 
user_id=358087

Ran with -v:
$ ./python Lib/test/test_pwd.py -v
test_errors (__main__.PwdTest) ... ok
test_values (__main__.PwdTest) ... ERROR

======================================================================
ERROR: test_values (__main__.PwdTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_pwd.py", line 42, in test_values
    self.assert_(pwd.getpwuid(e.pw_uid) in
entriesbyuid[e.pw_uid])
OverflowError: signed integer is greater than maximum

----------------------------------------------------------------------
Ran 2 tests in 0.480s

FAILED (errors=1)
Traceback (most recent call last):
  File "Lib/test/test_pwd.py", line 92, in ?
    test_main()
  File "Lib/test/test_pwd.py", line 89, in test_main
    test_support.run_unittest(PwdTest)
  File "/tmp/miki/Python-2.4b2/Lib/test/test_support.py",
line 290, in run_unitt                                     
       est
    run_suite(suite, testclass)
  File "/tmp/miki/Python-2.4b2/Lib/test/test_support.py",
line 275, in run_suite
    raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
  File "Lib/test/test_pwd.py", line 42, in test_values
    self.assert_(pwd.getpwuid(e.pw_uid) in
entriesbyuid[e.pw_uid])
OverflowError: signed integer is greater than maximum


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1066546&group_id=5470


More information about the Python-bugs-list mailing list