I am trying to build lyx 1.3.3 with a qt frontend on cygwin. I got to the point that qt and lyx both build successfully (no changes to the lyx sources, and almost none to qt-x11). Qt runs the examples, but lyx dies before it opens the first window. It says it crashed with a segmentation fault and asks to report the bug.


Here are the details:

I built qt-x11 with gcc-2.95.3-10 (cygwin special); I couldn't get it to compile with gcc 3. I did this by using the cygwin mkspec, but changing to gcc-2 and g++2, by telling it not to use DNS, and not to build the network module. I also forced the OS and WS to UNIX and X11, because qt discovers (using a gcc macro) that it is on cygwin and tries to do a windows build, which fails because you can't do it in the GPL version. So this works, the examples run well. This is a static qt, not a dll. I couldn't build the dll.

Next LyX. I was able to compile it and link with g++-2. I had to force it not to use -fnative-struct, otherwise the program crashed on the first call to Qt (to get the screen DPI). I also used -fno-exceptions, like Qt. This program runs for a short bit but crashes. When I used strace, I found that it crashed because it was trying to do mmap2 on about a gigabyte (anonymous), right after opening and calling fstat() on banner.ppm. A little more searching found that the problem was coming from the C++ std library, which tries to use MMAP for the file buffer on rdbuf on a file stream. On linux it allocates small buffers and continues, on cygwin it tries to allocate a huge buffer and dies.

I tried to build a new version of the C++ std library without MMAP, but was not able to build thd gcc2 binaries and libraries properly. The version I have came from the KDE-CYGWIN project.

I find it hard to believe that the problem is a bug in the stream IO library of g++ 2.95.3, so I think that the problem is probably some memory overwriting. Perhaps it is caused by some linking problem (like native-structs vs non-native structs), and perhaps from a bug in lyx. I tried lyx 1.3.2 and the same problem appeared.

I think that I am pretty close to getting this to work with versions of qt and lyx that are not hacked at all, but I really got stuck with this problem. If somebody has any idea, please let me know (and please cc me on the email).

Regards, Sivan Toledo

Reply via email to