Thomas Deniau
2006-Feb-22 15:44 UTC
[Xapian-discuss] Python or PHP hangs when loading a cygwin Xapian module
Hi, As you may already know, I've been working for some days on getting the PHP bindings compiled with Cygwin, and getting them to work. For my previous status report see http://article.gmane.org/gmane.comp.search.xapian.general/2312 Now, thanks to changes made to SWIG, the PHP bindings compile correctly even with ZTS enabled. You get a DLL that is installed in PHP's ext/ directory. However, when you try to load it, PHP just hangs (both when running as an Apache module and when running standalone). I then tried to use the Python bindings (maybe I could have re-programmed my client web site using Python...). The Python bindings compile just fine using the same tricks I used for PHP (copying python24.dll to libpython24.dll, compile the Windows sources with Cygwin to get the necessary header files, etc.). The test made by make then fails, but you get a working DLL file that you can copy to Python24\DLLs. However, when I try to load the Python module, Python just... hangs. Just like PHP. I also tried the instructions put forth by Patrick Mezard at http://article.gmane.org/gmane.comp.search.xapian.general/2071 (generate a libpython24.a by hand), but the exact same problem occurs. I tried to run a dependency check on the DLLs and I found out that they require a file named "apphelp.dll" which couldn't be found. Google reports that that's a DLL required by IE6, but that only WinXP has it, not Win2K (and IE still works fine, but any other apps have problems loading the DLLs). Since Patrick seems not to have had any such problems, and since he is running WinXP, I'm wondering if I'm doing something wrong or if I fail because I'm using Win2K. However, before I copied cygxapian10.dll to a DLL include dir, I had gotten error messages about missing DLLs, so I think that if there was a dependency problem I would get the same message again. Has anyone had any luck with any bindings with Cygwin (reminder : I'm trying to use Cygwin bindings with native Windows apps - a binary Windows distribution of PHP and/or Python and a module compiled with Cygwin) ? Thanks... -- Thomas Deniau
Olly Betts
2006-Feb-22 16:35 UTC
[Xapian-discuss] Python or PHP hangs when loading a cygwin Xapian module
On Wed, Feb 22, 2006 at 04:43:37PM +0100, Thomas Deniau wrote:> However, when I try to load the Python module, Python just... hangs. Just like > PHP.I wonder if this is a clash between the cygwin runtime and the MSVC runtime. I can imagine things going wrong if memory allocated by malloc in one is passed to free in the other, etc. Did you try compiling with "-mno-cygwin"? That tells the cygwin-hosted gcc to compile for mingw (an unusual form of cross-compiling in a sense). Mingw uses the MSVC runtime DLL (or the CRTL runtime DLL depending how it is configured). Otherwise I can't think of anything to suggest I'm afraid. Cheers, Olly
Patrick Mézard
2006-Feb-22 16:44 UTC
[Xapian-discuss] Python or PHP hangs when loading a cygwin Xapian module
Hello, Thomas Deniau wrote: [...]> I then tried to use the Python bindings (maybe I could have re-programmed my > client web site using Python...). > > The Python bindings compile just fine using the same tricks I used for PHP > (copying python24.dll to libpython24.dll, compile the Windows sources with > Cygwin to get the necessary header files, etc.). The test made by make then > fails, but you get a working DLL file that you can copy to Python24\DLLs. > > However, when I try to load the Python module, Python just... hangs. Just like > PHP. > > I also tried the instructions put forth by Patrick Mezard at > http://article.gmane.org/gmane.comp.search.xapian.general/2071 (generate a > libpython24.a by hand), but the exact same problem occurs. > > > I tried to run a dependency check on the DLLs and I found out that they require > a file named "apphelp.dll" which couldn't be found. Google reports that that's > a DLL required by IE6, but that only WinXP has it, not Win2K (and IE still > works fine, but any other apps have problems loading the DLLs). Since Patrick > seems not to have had any such problems, and since he is running WinXP, I'm > wondering if I'm doing something wrong or if I fail because I'm using Win2K.I just checked the dependencies of both DLLs: - cygxapian-8.dll depends on kernel32.dll and msvcrt.dll only. - _xapian.pyd depends on many many DLLs, including apphelp.dll which is available in %SYSTEM_ROOT%\system32. It also depends on msjava.dll which cannot be found in my system. apphelp.dll is needed through : python24.dll <= advapi32.dll <= secur32.dll <= netapi32.dll <= dnsapi.dll <= iphlpapi.dll <= mprapi.dll <= setupapi.dll <= apphelp.dll. There are probably other dependency paths. Since you built everything from Win2k stuff or directly from sources, it is strange an undeployed DLL is required by the final binaries. -- Patrick M?zard