[Python-bugs-list] [ python-Bugs-639022 ] Install script goes into infinite loop

noreply@sourceforge.net noreply@sourceforge.net
Mon, 18 Nov 2002 08:08:46 -0800


Bugs item #639022, was opened at 2002-11-15 13:09
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=639022&group_id=5470

Category: Installation
Group: Python 2.2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Mel (meldh)
Assigned to: Nobody/Anonymous (nobody)
Summary: Install script goes into infinite loop

Initial Comment:
./configure -- works
make -- works
make test -- works
make install -- gets as far as trying to do this:

PYTHONPATH=/usr/local/lib/python2.2 \
	./python -tt /usr/local/lib/python2.2/compileall.py -x 
badsyntax \
        /usr/local/lib/python2.2
Listing /usr/local/lib/python2.2 ...
Listing /usr/local/lib/python2.2/ ...

and then goes off into infinite loop, repeating the last line until Ctrl-
C.

Debian 2.2 (potato), 2.2.18pre21 kernel version.



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

>Comment By: Neal Norwitz (nnorwitz)
Date: 2002-11-18 11:08

Message:
Logged In: YES 
user_id=33168

I think this is b/c posix is shared.  This is the process
you need to do (hopefully this is correct, it's from memory):

 gdb python
 run
 >>> import os
 >>> # press Ctrl-C to get back to gdb
 (gdb) br posix_listdir
 (gdb) continue
 >>> os.listdir("/usr/local/lib/python2.2")


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

Comment By: Mel (meldh)
Date: 2002-11-18 10:36

Message:
Logged In: YES 
user_id=649744

I should add that it does seem to set up the breakpoint correctly; it 
reports that it's setting up breakpoint 1 in ./Modules/posixmodule.c, line 
1157 (on both machines)

(Appreciate all your work on this, folks.)


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

Comment By: Mel (meldh)
Date: 2002-11-18 10:35

Message:
Logged In: YES 
user_id=649744

I have gdb installed but doing:

gdb python
break posix_listdir
run
import os
os.listdir("/some/directory")

doesn't actually cause a break; it does the same as last time 
(produces a list of empty pairs of quotes) and then ends normally when 
I quit out of it.

It also doesn't break there in the working version.

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-11-18 10:13

Message:
Logged In: YES 
user_id=33168

Are you able to use a debugger and break in posix_listdir()
to see what's going on?

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

Comment By: Mel (meldh)
Date: 2002-11-18 09:42

Message:
Logged In: YES 
user_id=649744

Erk.

On the working install, it returns ['filename','filename',....,'filename'] (in 
other words, it looks wholly normal)

On the not-working install, it returns ['','','',...,''] (if the exact number of 
empty pairs of quotes is critical, I can count them)

I checked whether it would list other directories and no, it does the 
same thing on those also; produces a bunch of empty pairs of quotes 
(one per file, from the looks of it)

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

Comment By: Jack Jansen (jackjansen)
Date: 2002-11-18 09:20

Message:
Logged In: YES 
user_id=45365

If os.listdir("/usr/local/lib/python2.2") would return an empty string as the first item in it's output (it shouldn't, of course) I could imagine this happening.

Could you do the following:
% PYTHONPATH=/usr/local/lib/python2.2 ./python
>>> import os
>>> os.listdir("/usr/local/lib/python2.2")
and show us the results?

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

Comment By: Mel (meldh)
Date: 2002-11-18 08:51

Message:
Logged In: YES 
user_id=649744

Nope, all components of /usr/local/lib appear to be normal, healthy 
directories; no symlinks in there at all.

The actual built copies of python awaiting install are slightly different 
sizes on the two machines, which may or may not be significant 
(2177764 on working machine, 2177796 on not-working machine)

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

Comment By: Mel (meldh)
Date: 2002-11-18 08:35

Message:
Logged In: YES 
user_id=649744

Output of ./configure is identical on both machines.

Output of make is slightly different (much of the difference is because 
one machine is 586 arch. and the other 686)

Attached tgz file includes all three logs for each machine and a diff file 
for each set. Logs prefixed with 'sun-' are from the machine where the 
install works; logs prefixed with 'van-' are from the machine where the 
install fails.


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

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-11-18 08:29

Message:
Logged In: YES 
user_id=33168

Mel, is any path in /usr/local/lib/python2.2 a symlink,
meaning:  /usr, /usr/local, or /usr/local/lib ?

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

Comment By: Mel (meldh)
Date: 2002-11-18 07:36

Message:
Logged In: YES 
user_id=649744

OK, I've started reinstalling from scratch on both machines, and I'm 
logging the outputs from ./configure, make, make test, make install. 
_Something's_ got to be different...

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

Comment By: Mel (meldh)
Date: 2002-11-18 07:28

Message:
Logged In: YES 
user_id=649744

And still fails to work on the first machine. One thing I did notice was that 
on the second machine (the one on which the install works), there were 
a _lot_ more tests done with 'make test'. 240 or so, versus 6 on the not-
working machine.


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

Comment By: Martin v. Löwis (loewis)
Date: 2002-11-18 07:25

Message:
Logged In: YES 
user_id=21627

I'm not surprised it works; this behaviour is expected.
Python recursively traverses all directories under
/usr/local/lib/python2.2, and produces bytecode files for
each .py file. For some reason, it concludes that
/usr/local/lib/python2.2/ is a subdirectory of
/usr/local/lib/python2.2 on your first machine, which is
non-sense.

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

Comment By: Mel (meldh)
Date: 2002-11-18 07:20

Message:
Logged In: YES 
user_id=649744

... which, bizarrely, works. The main difference seems to be that it gets 
as far as the line which reads:

Listing /usr/local/lib/python2.2 ...

and then it _doesn't_ go on to produce a(n infinite number of) lines 
saying:

Listing /usr/local/lib/python2.2/ ...

(with the extra / appended to the name of the directory listing). What's 
actually _supposed_ to happen with that line? It passes a directory 
listing back to the shell? (Listings work OK on the problem machine as 
far as I can tell.)

OK, next step. Delete build directory, delete install directory, untar the 
tarball again and start over from scratch.



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

Comment By: Mel (meldh)
Date: 2002-11-18 07:07

Message:
Logged In: YES 
user_id=649744

I'm just trying to install from the same .tar.gz file I originally downloaded 
on a machine with a very similar setup (not, sadly, identical). Let's see if 
it does the same thing.

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

Comment By: Martin v. Löwis (loewis)
Date: 2002-11-18 07:04

Message:
Logged In: YES 
user_id=21627

Ok, I give up. Unless somebody else has any idea, I will
close this as unreproducable. 

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

Comment By: Mel (meldh)
Date: 2002-11-18 06:43

Message:
Logged In: YES 
user_id=649744

fsck reports /usr('s filesystem) is clean.

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

Comment By: Mel (meldh)
Date: 2002-11-17 17:38

Message:
Logged In: YES 
user_id=649744

I can't do an fsck on that filesystem until I'm in front of the 
console tomorrow - no reason to suspect problems, though. 
I've attached a gzipped version of the output of 'strace 
make install'.

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

Comment By: Martin v. Löwis (loewis)
Date: 2002-11-17 16:00

Message:
Logged In: YES 
user_id=21627

Ok, more tests: Can you please perform a file system check
on that file system? Normally, I would also ask for strace
output, but I suppose your strace won't decode getdents64.

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

Comment By: Mel (meldh)
Date: 2002-11-17 14:16

Message:
Logged In: YES 
user_id=649744

Zero output from that, I'm afraid. This is very weird.

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

Comment By: Martin v. Löwis (loewis)
Date: 2002-11-16 11:31

Message:
Logged In: YES 
user_id=21627

I'm now convinced that there must be cyclic symbolic link
somewhere. Please report the output of

find /usr/local/lib/python2.2 -type l -print



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

Comment By: Mel (meldh)
Date: 2002-11-16 10:59

Message:
Logged In: YES 
user_id=649744

That's OK, me neither. ;) I've patched compileall.py and 
reran 'make install'. The log file doesn't tell me a whole lot 
more but I confess I'm no Python expert (I need to get it 
installed for a different app which requires it).

Log file attached. Be warned, uncompressed it is about 
6Mb.


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

Comment By: Martin v. Löwis (loewis)
Date: 2002-11-16 09:35

Message:
Logged In: YES 
user_id=21627

I still have no clue what is going on here. Can you please
apply the attached compileall.diff, rerun installation, and
attach the resulting log file (or a significant portion
thereof)?

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

Comment By: Mel (meldh)
Date: 2002-11-16 05:36

Message:
Logged In: YES 
user_id=649744

I downloaded it from 
http://www.python.org/ftp/python/2.2.2/Python-2.2.2.tgz 
(the most obvious link off www.python.org).

Directory listing attached (I hope)

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

Comment By: Martin v. Löwis (loewis)
Date: 2002-11-16 04:52

Message:
Logged In: YES 
user_id=21627

As a procedural comment: What is the source package that 
you use (precise URL please)?

Can you please provide the output of

ls -l /usr/local/lib/python2.2

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

Comment By: Mel (meldh)
Date: 2002-11-15 18:57

Message:
Logged In: YES 
user_id=649744

Sure. (attached at end)

Running the command from the shell does seem to do the 
same thing.

There is no obvious symlink within /usr/local/lib/python2.2 
(if a directory listing would be useful, let me know)

Log excerpt: 

/usr/bin/install -c -m 
644 ./Lib/distutils/command/install_scripts.py /usr/local/lib
/python2.2/distutils/command
/usr/bin/install -c -m 
644 ./Lib/distutils/command/sdist.py /usr/local/lib/python2
.2/distutils/command
/usr/bin/install -c -m 
644 ./Lib/xml/__init__.py /usr/local/lib/python2.2/xml
/usr/bin/install -c -m 
644 ./Lib/xml/dom/__init__.py /usr/local/lib/python2.2/xml/
dom
/usr/bin/install -c -m 
644 ./Lib/xml/dom/domreg.py /usr/local/lib/python2.2/xml/
dom
/usr/bin/install -c -m 
644 ./Lib/xml/dom/minidom.py /usr/local/lib/python2.2/xml
/dom
/usr/bin/install -c -m 
644 ./Lib/xml/dom/pulldom.py /usr/local/lib/python2.2/xml/
dom
/usr/bin/install -c -m 
644 ./Lib/xml/parsers/__init__.py /usr/local/lib/python2.2/x
ml/parsers
/usr/bin/install -c -m 
644 ./Lib/xml/parsers/expat.py /usr/local/lib/python2.2/xm
l/parsers
/usr/bin/install -c -m 
644 ./Lib/xml/sax/__init__.py /usr/local/lib/python2.2/xml/s
ax
/usr/bin/install -c -m 
644 ./Lib/xml/sax/_exceptions.py /usr/local/lib/python2.2/x
ml/sax
/usr/bin/install -c -m 
644 ./Lib/xml/sax/expatreader.py /usr/local/lib/python2.2/
xml/sax
/usr/bin/install -c -m 
644 ./Lib/xml/sax/handler.py /usr/local/lib/python2.2/xml/s
ax
/usr/bin/install -c -m 
644 ./Lib/xml/sax/saxutils.py /usr/local/lib/python2.2/xml/s
ax
/usr/bin/install -c -m 
644 ./Lib/xml/sax/xmlreader.py /usr/local/lib/python2.2/xm
l/sax
/usr/bin/install -c -m 
644 ./Lib/curses/__init__.py /usr/local/lib/python2.2/curses
/usr/bin/install -c -m 
644 ./Lib/curses/ascii.py /usr/local/lib/python2.2/curses
/usr/bin/install -c -m 
644 ./Lib/curses/has_key.py /usr/local/lib/python2.2/curse
s
/usr/bin/install -c -m 
644 ./Lib/curses/panel.py /usr/local/lib/python2.2/curses
/usr/bin/install -c -m 
644 ./Lib/curses/textpad.py /usr/local/lib/python2.2/curse
s
/usr/bin/install -c -m 
644 ./Lib/curses/wrapper.py /usr/local/lib/python2.2/curse
s
/usr/bin/install -c -m 644 ./Lib/plat-
linux2/CDROM.py /usr/local/lib/python2.2/plat-linux2
/usr/bin/install -c -m 644 ./Lib/plat-
linux2/DLFCN.py /usr/local/lib/python2.2/plat-linux2
/usr/bin/install -c -m 644 ./Lib/plat-
linux2/IN.py /usr/local/lib/python2.2/plat-linux2
/usr/bin/install -c -m 644 ./Lib/plat-
linux2/TYPES.py /usr/local/lib/python2.2/plat-linux2
/usr/bin/install -c ./Lib/plat-
linux2/regen /usr/local/lib/python2.2/plat-linux2
/usr/bin/install -c -m 
644 ./LICENSE /usr/local/lib/python2.2/LICENSE.txt
PYTHONPATH=/usr/local/lib/python2.2 \
	./python -
tt /usr/local/lib/python2.2/compileall.py -x badsyntax \
        /usr/local/lib/python2.2
Listing /usr/local/lib/python2.2 ...
Listing /usr/local/lib/python2.2/ ...
Listing /usr/local/lib/python2.2/ ...
Listing /usr/local/lib/python2.2/ ...
Listing /usr/local/lib/python2.2/ ...
Listing /usr/local/lib/python2.2/ ...
Listing /usr/local/lib/python2.2/ ...
Listing /usr/local/lib/python2.2/ ...
Listing /usr/local/lib/python2.2/ ...
Listing /usr/local/lib/python2.2/ ...
Listing /usr/local/lib/python2.2/ ...
Listing /usr/local/lib/python2.2/ ...
Listing /usr/local/lib/python2.2/ ...
Listing /usr/local/lib/python2.2/ ...
Listing /usr/local/lib/python2.2/ ...
Listing /usr/local/lib/python2.2/ ...
Listing /usr/local/lib/python2.2/ ...
Listing /usr/local/lib/python2.2/ ...
Listing /usr/local/lib/python2.2/ ...
Listing /usr/local/lib/python2.2/ ...
Listing /usr/local/lib/python2.2/ ...
(etc.)



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

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-11-15 18:48

Message:
Logged In: YES 
user_id=33168

Ok, could you paste a few listing lines and about 20 or so
before that.  Did you try running the command from the
shell?  Something like:  

  PYTHONPATH=/usr/local/lib/python2.2 \
    ./python -tt /usr/local/lib/python2.2/compileall.py \
        -x badsyntax /usr/local/lib/python2.2 

Does that do the same thing?

Is it possible there is a symlink in
/usr/local/lib/python2.2 to the same directory (or .)?

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

Comment By: Mel (meldh)
Date: 2002-11-15 18:44

Message:
Logged In: YES 
user_id=649744

I give in, it just doesn't want to let me attach the file. It has 
about 10000 repeats of that same 'Listing' line, in any case.

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

Comment By: Mel (meldh)
Date: 2002-11-15 18:43

Message:
Logged In: YES 
user_id=649744

Yeah, I tried that. In between the problems with file sizes, 
file names and the like, it doesn't seem to have worked. I'm 
giving it another go now.

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-11-15 18:40

Message:
Logged In: YES 
user_id=33168

There's no file.  You have to click the checkbox next to
"Check to Upload and Attach a File" in addition to entering
the filename.

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

Comment By: Mel (meldh)
Date: 2002-11-15 18:38

Message:
Logged In: YES 
user_id=649744

Log file now attached, gzipped

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

Comment By: Mel (meldh)
Date: 2002-11-15 18:38

Message:
Logged In: YES 
user_id=649744

Log file now attached, gzipped

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

Comment By: Mel (meldh)
Date: 2002-11-15 18:34

Message:
Logged In: YES 
user_id=649744

Here's the log file. I let it run for about 10000 repeats and 
then killed it - there may be a lot of files, but _that_ many?

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

Comment By: Mel (meldh)
Date: 2002-11-15 18:23

Message:
Logged In: YES 
user_id=649744

It definitely isn't printing out anything else except 
the 'Listing...' line. I can let it run for a few minutes and see 
if it's printing that one-per-file or something, instead of just 
looping... hang on.

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

Comment By: Mel (meldh)
Date: 2002-11-15 18:22

Message:
Logged In: YES 
user_id=649744

It definitely isn't printing out anything else except 
the 'Listing...' line. I can let it run for a few minutes and see 
if it's printing that one-per-file or something, instead of just 
looping... hang on.

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-11-15 18:09

Message:
Logged In: YES 
user_id=33168

Are you sure you let the process finish?  It looks like
there are at least 2 passes.  One to generate .pyc files and
the other to generate .pyo (optimized) files.  There are a
lot of files to run through.  

Does it only print the "Listing /usr/local/lib/python2.2 ...
" lines and nothing in between?  

Could you save the output and attach it to this bug report?

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

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