Summary

Error when loading the qt egg

Metadata

Attachments

Description

Using the qt egg just installed (fetched from Alaric's machine):

 $ /usr/local/chicken-4.3.0/bin/csi -n
 
 CHICKEN
 (c)2008-2009 The Chicken Team
 (c)2000-2007 Felix L. Winkelmann
 Version 4.3.0
 linux-unix-gnu-x86 [ manyargs dload ptables ]
 compiled 2009-12-15 on dellito (Linux)
 
 #;1> (use qt)
 ; loading /usr/local/chicken-4.3.0/lib/chicken/4/qt.import.so ...
 ; loading /usr/local/chicken-4.3.0/lib/chicken/4/scheme.import.so ...
 ; loading /usr/local/chicken-4.3.0/lib/chicken/4/chicken.import.so ...
 ; loading /usr/local/chicken-4.3.0/lib/chicken/4/foreign.import.so ...
 ; loading /usr/local/chicken-4.3.0/lib/chicken/4/easyffi.import.so ...
 ; loading /usr/local/chicken-4.3.0/lib/chicken/4/srfi-4.import.so ...
 ; loading /usr/local/chicken-4.3.0/lib/chicken/4/srfi-1.import.so ...
 ; loading /usr/local/chicken-4.3.0/lib/chicken/4/protobj.import.so ...
 ; loading /usr/local/chicken-4.3.0/lib/chicken/4/matchable.import.so ...
 ; loading /usr/local/chicken-4.3.0/lib/chicken/4/data-structures.import.so ...
 ; loading /usr/local/chicken-4.3.0/lib/chicken/4/extras.import.so ...
 ; loading /usr/local/chicken-4.3.0/lib/chicken/4/qt.so ...
 
 Error: call of non-procedure: #(#(
 Error: unprintable non-immediate object encountered
 
         Call history:
 
         <syntax>                (import scheme chicken)
         <syntax>                (##core#undefined)
         data-structures.import.scm: 27   ##sys#register-primitive-module
         extras.import.scm: 27   ##sys#register-primitive-module 
         <syntax>                (##core#undefined)
         <syntax>                (##core#undefined)
         <syntax>                (##core#undefined)
         <eval>          (##sys#require (quote qt))      <--
 #;1> (load "/usr/local/chicken-4.3.0/lib/chicken/4/qt.so")
 ; loading /usr/local/chicken-4.3.0/lib/chicken/4/qt.so ...
 Segmentation fault

The exact same behavior can be reproduced using chicken 4.2.0.

The system is an Ubuntu Linux 9.10 with the following Qt package version:4.5.3really4.5.2-0ubuntu1.

The machine is an Intel Core2Duo P8600 running a 32bit system. Chicken has been compiled with:

 $ make PLATFORM=linux PREFIX=/usr/local/chicken-4.3.0



 $ gcc --version
 gcc (Ubuntu 4.4.1-4ubuntu8) 4.4.1

Changes and comments

[2009-12-16 07:55:50 UTC] felix wrote:

What's the output of `ldd <repo-path>/qt.so` ? Is it possible that some library paths are mixed up? Does the error persist if you rebuild all installed eggs for that installation? Can you build chicken with debugging info and run the crashing program under gdb?

[2009-12-16 08:16:03 UTC] felix changed priority from not urgent at all to critical

[2009-12-16 08:16:03 UTC] felix wrote:

You can also try

 % LD_DEBUG=libs /usr/local/chicken-4.3.0/bin/csi -R qt

[2009-12-17 11:02:58 UTC] mario changed status from new to closed

[2009-12-17 11:02:58 UTC] mario set resolution to invalid

[2009-12-17 11:02:58 UTC] mario wrote:

Replying to felix: > What's the output of `ldd <repo-path>/qt.so` ? > Is it possible that some library paths are mixed up?

That was it. qt.so was being linked against libchicken.so.3. Thanks for the tips and sorry for the noise.

My canonical chicken installation is still chicken 3.4.0. I have /usr/bin/<chicken-tools> symlinked to /usr/local/chicken-3.4.0/bin/<chicken-tools>.

To use chicken 4, I explicitly execute <chicken-tools> from /usr/local/chicken-4.3.0/bin (which are not in PATH). I guess chicken-4 picks some tools (maybe chicken) from PATH, so it ended up calling something from chicken 3.

Installing the qt egg with

 QTDIR=/usr PATH=/usr/local/chicken-4.3.0/bin/:$PATH /usr/local/chicken-4.3.0/bin/chicken-install qt

made it work.

I don't know if that is expected. I mean, whether chicken-install is supposed to use chicken tools from PATH instead of from the build-time configured PREFIX path.

I'm closing this ticket as invalid.

[2009-12-17 11:10:48 UTC] felix wrote:

Replying to mario: > > To use chicken 4, I explicitly execute <chicken-tools> from /usr/local/chicken-4.3.0/bin (which are not in PATH). I guess chicken-4 picks some tools (maybe chicken) from PATH, so it ended up calling something from chicken 3. >

That shouldn't be the case (and we should fix it, if it does).

Note that you can install the chicken tools with a prefix or suffix added to the name (`PROGRAM_PREFIX`and `PROGRAM_SUFFIX` make(1) variables), like:

 % make ... PROGRAM_SUFFIX=-4
 % make ... PROGRAM_SUFFIX=-4 install
 % ln -s <prefix>/bin/csc-4 <path>
 % ln -s <prefix>/bin/chicken-install-4 <path>

[2009-12-17 23:12:13 UTC] mario wrote:

Replying to felix: > Replying to mario: > > > > To use chicken 4, I explicitly execute <chicken-tools> from /usr/local/chicken-4.3.0/bin (which are not in PATH). I guess chicken-4 picks some tools (maybe chicken) from PATH, so it ended up calling something from chicken 3. > > That shouldn't be the case (and we should fix it, if it does).

The call to csc from the PATH is actually made by something in the qt.setup file. Here's the full compilation log (I've added (run-verbose #t) to the setup file):

 $ QTDIR=/usr /usr/local/chicken-4.3.0/bin/chicken-install qt.setup
 retrieving ...
 checking dependencies for `qt' ...
 install order:
 ("qt")
 installing qt: ...
 changing current directory to /home/mario/src/chicken-eggs/release/4/qt/trunk
   /usr/local/chicken-4.3.0/bin/csi -bnq -setup-mode -e "(require-library setup-api)" -e "(import setup-api)" -e "(extension-name-and-version '(\"qt\" \"\"))" /home/mario/src/chicken-eggs/release/4/qt/trunk/qt.setup
   /usr/local/chicken-4.3.0/bin/csc -feature compiling-extension -setup-mode   -t qt-base.scm -O2 -d1 -X easyffi -C -g -j qt
 
 Warning: re-importing already imported syntax: foreign-declare
 
 Warning: global variable `qt#g301' is never used
 
 Warning: global variable `qt#g317' is never used
 
 Warning: global variable `qt#g318' is never used
   /usr/local/chicken-4.3.0/bin/csc -feature compiling-extension -setup-mode   -s qt.import.scm -O2 -d0
   /usr/bin/qmake qt.pro
   make
 /usr/bin/moc-qt4 -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtUiTools -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I/usr/X11R6/include -I. main.cpp -o main.moc
 g++ -c -pipe -g -w `csc -cflags` -D_REENTRANT -Wall -W -fPIC -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtUiTools -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I/usr/X11R6/include -I. -o main.o main.cpp
 gcc -c -pipe -g -w `csc -cflags` -D_REENTRANT -Wall -W -fPIC -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtUiTools -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I/usr/X11R6/include -I. -o qt-base.o qt-base.c
 rm -f libqtb.so.1.0.0 libqtb.so libqtb.so.1 libqtb.so.1.0
 g++ `csc -libs -ldflags` -shared -Wl,-soname,libqtb.so.1 -o libqtb.so.1.0.0 main.o qt-base.o   -L/usr/lib -L/usr/X11R6/lib -lQtOpenGL -lQtGui -lQtCore -lGLU -lGL -lpthread -lQtUiTools
 ln -s libqtb.so.1.0.0 libqtb.so
 ln -s libqtb.so.1.0.0 libqtb.so.1
 ln -s libqtb.so.1.0.0 libqtb.so.1.0
   cp libqtb.so.1.0.0 qt.so
   rm -fr /usr/local/chicken-4.3.0/lib/chicken/4/qt.so
   cp -r qt.so /usr/local/chicken-4.3.0/lib/chicken/4/qt.so
   chmod a+r /usr/local/chicken-4.3.0/lib/chicken/4/qt.so
   rm -fr /usr/local/chicken-4.3.0/lib/chicken/4/qt.import.so
   cp -r qt.import.so /usr/local/chicken-4.3.0/lib/chicken/4/qt.import.so
   chmod a+r /usr/local/chicken-4.3.0/lib/chicken/4/qt.import.so
 
 * Installing documentation files in /usr/local/chicken-4.3.0/share/chicken/doc:
 
 Warning: file does not exist: "qt.html"
 
   chmod a+r /usr/local/chicken-4.3.0/lib/chicken/4/qt.setup-info

Notice that there are calls to `csc -libs -ldflags` and `csc -cflags` which take csc from the system PATH.

I supposed the following definitions from qt.pro cause this problem:

 unix:QMAKE_LFLAGS_DEBUG+=`csc -libs -ldflags`
 unix:QMAKE_CFLAGS_DEBUG+=-w `csc -cflags`
 unix:QMAKE_CXXFLAGS_DEBUG+=-w `csc -cflags`

One solution I see is making qt.setup generate qt.pro. A patch is attached.

[2009-12-17 23:13:42 UTC] mario attached qt-pro.patch (description=qt.pro generated by qt.setup)

[2009-12-18 12:04:15 UTC] felix removed resolution invalid

[2009-12-18 12:04:15 UTC] felix wrote:

Replying to mario: > Replying to felix: > > Replying to mario: > > > > > Notice that there are calls to `csc -libs -ldflags` and `csc -cflags` which take csc from the system PATH.

That is indeed the cause of the problem.

> > One solution I see is making qt.setup generate qt.pro. A patch is attached. >

Thanks a lot. Will fix.

[2009-12-18 12:04:15 UTC] felix changed status from closed to reopened

[2009-12-18 12:04:26 UTC] felix changed status from reopened to accepted

[2009-12-18 12:04:26 UTC] felix set owner to felix

[2009-12-29 02:11:38 UTC] felix changed version from 4.3.0 to 4.3.x

[2009-12-29 02:11:38 UTC] felix changed milestone from 4.3.0 to 4.4.0

[2009-12-31 00:37:08 UTC] felix changed status from accepted to closed

[2009-12-31 00:37:08 UTC] felix set resolution to fixed

[2010-03-11 10:33:12 UTC] Milestone 4.4.0 deleted