Hello Florian, On Thu, Aug 09, 2018 at 08:27:46AM +0200, Florian Weimer wrote: > On 08/08/2018 10:23 PM, Michael Brunnbauer wrote: > > #6 0x0806fb2f in posix_listdir (self=0x0, args=0x80d542c) > > at ./Modules/posixmodule.c:1028 > > I would expect that posix_listdir is looping for some reason. Perhaps you > can single-step through it and confirm this hypothesis? > > Do you have a copy the source code (posixmodule.c)? https://www.python.org/ftp/python/2.1.3/Python-2.1.3.tgz The loop seems to be this one (starting with line 1017 of posixmodule.c, which was my breakpoint when testing it): while ((ep = readdir(dirp)) != NULL) { if (ep->d_name[0] == '.' && (NAMLEN(ep) == 1 || (ep->d_name[1] == '.' && NAMLEN(ep) == 2))) continue; v = PyString_FromStringAndSize(ep->d_name, NAMLEN(ep)); if (v == NULL) { Py_DECREF(d); d = NULL; break; } if (PyList_Append(d, v) != 0) { Py_DECREF(v); Py_DECREF(d); d = NULL; break; } Py_DECREF(v); } Here is a sample gdb session. It seems readdir always returns the same empty string: Reading symbols from ./bin/python...done. (gdb) b posixmodule.c:1017 Breakpoint 1 at 0x806fad7: file ./Modules/posixmodule.c, line 1017. (gdb) run Starting program: /home/zope/old/2.6.0/bin/python [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/libthread_db.so.1". Breakpoint 1, posix_listdir (self=0x0, args=0x80d542c) at ./Modules/posixmodule.c:1018 1018 ./Modules/posixmodule.c: No such file or directory. (gdb) continue 10000 Will ignore next 9999 crossings of breakpoint 1. Continuing. Breakpoint 1, posix_listdir (self=0x0, args=0x80d542c) at ./Modules/posixmodule.c:1018 1018 in ./Modules/posixmodule.c (gdb) print ep $1 = (struct dirent *) 0x8103c0c (gdb) print ep->d_name $2 = "\000\207V\000\000\200\016\315\022\020\000\000..\000\000\000\034Z\000\000\200\264\265\026$\000\000_mysql_exceptions.pyc\000\000\000\000\035Z\000\000\200\362\034!\024\000\000README\000\000\000\036Z\000\000\200w\323\070 \000\000CompatMysqldb.pyc\000\000\000\000\037Z\000\000\200\240Y;\030\000\000_mysql.so\000\000\000\000 Z\000\000\200\370vT\024\000\000csv.so\000\000\000!Z\000\000\200\314\314^\034\000\000CompatMysqldb.py\000\"Z\000\000\000\276\332v \000\000_mysql_excep"... (gdb) continue 10 Will ignore next 9 crossings of breakpoint 1. Continuing. Breakpoint 1, posix_listdir (self=0x0, args=0x80d542c) at ./Modules/posixmodule.c:1018 1018 in ./Modules/posixmodule.c (gdb) print ep $3 = (struct dirent *) 0x8103c0c (gdb) print ep->d_name $4 = "\000\207V\000\000\200\016\315\022\020\000\000..\000\000\000\034Z\000\000\200\264\265\026$\000\000_mysql_exceptions.pyc\000\000\000\000\035Z\000\000\200\362\034!\024\000\000README\000\000\000\036Z\000\000\200w\323\070 \000\000CompatMysqldb.pyc\000\000\000\000\037Z\000\000\200\240Y;\030\000\000_mysql.so\000\000\000\000 Z\000\000\200\370vT\024\000\000csv.so\000\000\000!Z\000\000\200\314\314^\034\000\000CompatMysqldb.py\000\"Z\000\000\000\276\332v \000\000_mysql_excep"... Regards, Michael Brunnbauer -- ++ Michael Brunnbauer ++ netEstate GmbH ++ Geisenhausener Straße 11a ++ 81379 München ++ Tel +49 89 32 19 77 80 ++ Fax +49 89 32 19 77 89 ++ E-Mail brunni@netestate.de ++ https://www.netestate.de/ ++ ++ Sitz: München, HRB Nr.142452 (Handelsregister B München) ++ USt-IdNr. DE221033342 ++ Geschäftsführer: Michael Brunnbauer, Franz Brunnbauer ++ Prokurist: Dipl. Kfm. (Univ.) Markus Hendel