[Rock-dev] LD_LIBRARY_PATH and Qt::UiLoader Segfault
Alexander Duda
Alexander.Duda at dfki.de
Wed Aug 31 16:36:42 CEST 2011
I found the reason.
usr/lib/libqtruby4shared.so.2.0.0 is installed into /usr/lib by default
but I also had a version in /usr/local/lib (I do not know why) which was
picked up after LD_LIBRARY_PATH was extended. After deleting the one
from /usr/local/lib the problem disappeared.
Hmmm - not so nice
Alex
On Wed, 2011-08-31 at 16:09 +0200, Alexander Duda wrote:
> In my case it is crashing:
>
> gbd:
> Program received signal SIGSEGV, Segmentation fault.
> 0xb674f840 in findMethod(unsigned long, unsigned long, unsigned long) ()
> from /usr/local/lib/libqtruby4shared.so.2
> (gdb) bt
> #0 0xb674f840 in findMethod(unsigned long, unsigned long, unsigned
> long) () from /usr/local/lib/libqtruby4shared.so.2
> #1 0xb7f2a992 in ?? () from /usr/lib/libruby1.8.so.1.8
> #2 0xb7f36151 in ?? () from /usr/lib/libruby1.8.so.1.8
> #3 0xb7f362ea in ?? () from /usr/lib/libruby1.8.so.1.8
> #4 0xb7f3345c in ?? () from /usr/lib/libruby1.8.so.1.8
> #5 0xb7f30c6e in ?? () from /usr/lib/libruby1.8.so.1.8
> #6 0xb7f34b1b in ?? () from /usr/lib/libruby1.8.so.1.8
> #7 0xb7f40127 in rb_yield () from /usr/lib/libruby1.8.so.1.8
> ...
>
> valgrind (see file attached):
> ==9034== Invalid read of size 4
> ==9034== at 0x6A47840: findMethod(unsigned long, unsigned long,
> unsigned long) (in /usr/local/lib/libqtruby4shared.so.2.0.0)
> ==9034== by 0x4056991: ??? (in /usr/lib/libruby1.8.so.1.8.7)
> ==9034== by 0x4062150: ??? (in /usr/lib/libruby1.8.so.1.8.7)
> ==9034== by 0x40622E9: ??? (in /usr/lib/libruby1.8.so.1.8.7)
> ==9034== by 0x405F45B: ??? (in /usr/lib/libruby1.8.so.1.8.7)
> ==9034== by 0x405CC6D: ??? (in /usr/lib/libruby1.8.so.1.8.7)
> ==9034== by 0x4060B1A: ??? (in /usr/lib/libruby1.8.so.1.8.7)
> ==9034== by 0x406C126: rb_yield (in /usr/lib/libruby1.8.so.1.8.7)
> ==9034== by 0x4040548: ??? (in /usr/lib/libruby1.8.so.1.8.7)
> ==9034== by 0x40569AC: ??? (in /usr/lib/libruby1.8.so.1.8.7)
> ==9034== by 0x4062150: ??? (in /usr/lib/libruby1.8.so.1.8.7)
> ==9034== by 0x40622E9: ??? (in /usr/lib/libruby1.8.so.1.8.7)
> ==9034== Address 0x8 is not stack'd, malloc'd or (recently) free'd
> ==9034==
> /usr/lib/ruby/1.8/Qt/qtruby4.rb:2708: [BUG] Segmentation fault
> ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
>
>
> On Wed, 2011-08-31 at 15:01 +0200, Sylvain Joyeux wrote:
> > On 08/31/2011 02:14 PM, Alexander Duda wrote:
> > > On Wed, 2011-08-31 at 11:59 +0200, Sylvain Joyeux wrote:
> > >> On 08/31/2011 11:18 AM, Alexander Duda wrote:
> > >>> Someone extended the environment variable LD_LIBRARY_PATH (env.sh) with
> > >>> "/lib". The Qt::UiLoader cannot handle this and crashes.
> > >>>
> > >>> Question:
> > >>> -Why was /lib added?
> > >> It is a byproduct of the workaround in autobuild for debian rolling out
> > >> multiarch.
> > >>
> > >> In a nutshell, on Debian, pkg-config and libraries can now get installed
> > >> in /lib/<ARCH> and /usr/lib/<ARCH>
> > >>
> > >> To avoid issues with that, I started adding these to the
> > >> PKG_CONFIG_PATH. I also added them to LD_LIBRARY_PATH as at the time I
> > >> saw no drawbacks.
> > >>> -Has someone else the same problem?
> > >> How can I reproduce ? I tried loading the UILoader and starting the Qt
> > >> designer, and had no problems
> > > in my case it occurs by typing the following into the shell.
> > > . env.sh
> > > irb
> > > require 'Qt4'
> > > require 'qtuiloader'
> > > Qt::UiLoader.new
> > Just to be sure: I had to do
> >
> > require 'Qt4'
> > require 'qtuitools'
> > app = Qt::Application.new(ARGV)
> > Qt::UiLoader.new
> >
> > And it worked fine
> >
> > Have you tried starting irb / ruby with a gdb to check where it breaks ?
> > (or getting valgrind ?)
>
> _______________________________________________
> Rock-dev mailing list
> Rock-dev at dfki.de
> http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev
--
Dipl.-Ing. Alexander Duda
Unterwasserrobotik
DFKI Bremen
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany
Phone: +49 (0)421 178-456620
Fax: +49 (0)421 178-454150
E-Mail: alexander.duda at dfki.de
Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.: DE 148646973
Steuernummer: 19/673/0060/3
More information about the Rock-dev
mailing list