Bug 111372 - karbon: KLibrary: Undefined symbol "init_libkarbonpart"
Summary: karbon: KLibrary: Undefined symbol "init_libkarbonpart"
Status: RESOLVED FIXED
Alias: None
Product: karbon
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified FreeBSD
: NOR crash
Target Milestone: ---
Assignee: Rob Buis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-23 20:09 UTC by missive
Modified: 2005-11-25 20:39 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description missive 2005-08-23 20:09:48 UTC
Version:           1.4.1 (using KDE 3.4.2, compiled sources)
Compiler:          gcc version 2.95.4 20020320 [FreeBSD]
OS:                FreeBSD (i386) release 4.11-STABLE

After upgrading to 1.4.1, karbon will no longer start. The output to the console is this:

kdecore (KLibLoader): WARNING: KLibrary: Undefined symbol "init_libkarbonpart"
kdecore (KLibLoader): WARNING: The library libkarbonpart does not offer an init_libkarbonpart function.
koffice (lib kofficecore): WARNING: The library libkarbonpart does not offer an init_libkarbonpart function.


Which may or may not be involved... There is no core file dropped, but no main window ever appears.
Comment 1 Thiago Macieira 2005-08-24 05:42:11 UTC
I have no such symbol either, but Karbon works fine
(KOffice trunk r449049)
Comment 2 Inge Wallin 2005-08-24 10:56:54 UTC
Which Linux dist and version is this?  From the wording of the bug report I assume that you haven't compiled karbon from sources.
Comment 3 missive 2005-08-24 12:52:35 UTC
FreeBSD 4.11 compiled from source using FreeBSD ports system.

I tried the official FreeBSD package first with same result. Then tried compiling my own.

Seems like the init_libkarbonpart warning may be just a coincidence...
Comment 4 Inge Wallin 2005-08-24 12:59:44 UTC
That should teach me to write "which OS" instead of "which dist".

Anyway, do you perhaps have a backtrace?
Comment 5 Thiago Macieira 2005-08-29 17:32:32 UTC
I don't think it's crashing, so it won't generate a backtrace. He'd have to find the proper line in KLibLoader and set a breakpoint on it --- provided that the compilation was done with debugging symbols.
Comment 6 Kevin G. Eliuk 2005-10-08 19:34:35 UTC
Having same symptom with
Version: 1.4.1,1 built from sources
OS: FreeBSD 5.4-RELEASE-p1

Captured the following backtrace from attempting to open a vector graphic from koffice menu.

[Switching to LWP 100100]
0x2934667b in wait4 () from /lib/libc.so.5
#0  0x2934667b in wait4 () from /lib/libc.so.5
#1  0x29337adb in waitpid () from /lib/libc.so.5
#2  0x292db095 in waitpid () from /usr/lib/libpthread.so.1
#3  0x28834399 in KCrash::defaultCrashHandler ()
   from /usr/local/lib/libkdecore.so.6
#4  0x292e18fc in sigaction () from /usr/lib/libpthread.so.1
#5  0xbfbfff94 in ?? ()
#6  0x0000000b in ?? ()
#7  0xbfbfd8b0 in ?? ()
#8  0xbfbfd5f0 in ?? ()
#9  0x00000000 in ?? ()
#10 0x292e1560 in sigaction () from /usr/lib/libpthread.so.1
#11 0x297352a0 in KoShellWindow::slotFileOpen ()
   from /usr/local/lib/libkdeinit_koshell.so
#12 0x29887894 in KoMainWindow::qt_invoke ()
   from /usr/local/lib/libkofficecore.so.2
#13 0x29735ed1 in KoShellWindow::qt_invoke ()
   from /usr/local/lib/libkdeinit_koshell.so
#14 0x28c6d8f6 in QObject::activate_signal ()
   from /usr/X11R6/lib/libqt-mt.so.3
#15 0x28c6d80a in QObject::activate_signal ()
   from /usr/X11R6/lib/libqt-mt.so.3
#16 0x28529066 in KAction::activated () from /usr/local/lib/libkdeui.so.6
#17 0x285288a5 in KAction::slotActivated () from /usr/local/lib/libkdeui.so.6
#18 0x285289d0 in KAction::slotPopupActivated ()
   from /usr/local/lib/libkdeui.so.6
#19 0x285292fa in KAction::qt_invoke () from /usr/local/lib/libkdeui.so.6
#20 0x28c6d8f6 in QObject::activate_signal ()
   from /usr/X11R6/lib/libqt-mt.so.3
#21 0x28f6ae29 in QSignal::signal () from /usr/X11R6/lib/libqt-mt.so.3
#22 0x28c85750 in QSignal::activate () from /usr/X11R6/lib/libqt-mt.so.3
#23 0x28d5fc48 in QPopupMenu::mouseReleaseEvent ()
   from /usr/X11R6/lib/libqt-mt.so.3
#24 0x285157d6 in KPopupMenu::mouseReleaseEvent ()
   from /usr/local/lib/libkdeui.so.6
#25 0x28ca13dd in QWidget::event () from /usr/X11R6/lib/libqt-mt.so.3
#26 0x28c14e15 in QApplication::internalNotify ()
   from /usr/X11R6/lib/libqt-mt.so.3
#27 0x28c144b5 in QApplication::notify () from /usr/X11R6/lib/libqt-mt.so.3
#28 0x287a574d in KApplication::notify () from /usr/local/lib/libkdecore.so.6
#29 0x28baf6ee in QETWidget::translateMouseEvent ()
   from /usr/X11R6/lib/libqt-mt.so.3
#30 0x28bad66e in QApplication::x11ProcessEvent ()
   from /usr/X11R6/lib/libqt-mt.so.3
#31 0x28bc36e9 in QEventLoop::processEvents ()
   from /usr/X11R6/lib/libqt-mt.so.3
#32 0x28c2606f in QEventLoop::enterLoop () from /usr/X11R6/lib/libqt-mt.so.3
#33 0x28c25fc8 in QEventLoop::exec () from /usr/X11R6/lib/libqt-mt.so.3
#34 0x28c14f6c in QApplication::exec () from /usr/X11R6/lib/libqt-mt.so.3
#35 0x29731ad6 in kdemain () from /usr/local/lib/libkdeinit_koshell.so
#36 0x2971c7e2 in kdeinitmain () from /usr/local/lib/kde3/koshell.so
#37 0x0804dcb5 in execpath_avoid_loops ()
#38 0x0804eccd in execpath_avoid_loops ()
#39 0x0804f236 in execpath_avoid_loops ()
#40 0x080504f0 in main ()
Comment 7 Melchior Franz 2005-10-14 20:27:09 UTC
Same problem here: Linux 2.6.12.3/i386, gcc 3.3.4 (SuSE 9.3), libc 2.2.3. Karbon just exits because it's unable to find the symbol in libkarbonpart, which is no wonder because this symbol simply isn't there. I followed the karbon startup process in gdb, and it does exit right after the unsuccessful query.

You'll find the same bug mentioned several times on google, mostly related to compiling on BSD. But again: I'm running Linux. The rest of koffice works wonderfully.
Comment 8 Melchior Franz 2005-10-14 20:39:04 UTC
BTW, all koffice apps but karbon have this init_lib{foo}part:

$ for i in krita kword kpresenter kformula kspread kugar kivio karbon; do echo -ne "$i:\t"; nm $KDEDIR/lib/kde3/lib${i}part.so|grep init_lib${i}part >/dev/null&& echo OK || echo NO-NO-NO-NO-NO-NO; done

krita:  OK
kword:  OK
kpresenter:     OK
kformula:       OK
kspread:        OK
kugar:  OK
kivio:  OK
karbon: NO-NO-NO-NO-NO-NO


:-)
Comment 9 Melchior Franz 2005-10-18 12:34:13 UTC
People have this problem who are using "LDFLAGS=-Wl,--as-needed", which seems to be a lot more common on BSD. This only links libraries that are *really* needed. Currently, though, libkarbonpart.so is only dummy.o linked with libkarboncommon.so, and dummy.cpp is empty. That is: it falsely doesn't claim to depend on anything. Consequently, libkarbonpart.so is empty, too.

Other koffice applications have dummy.cpp files which do at least declare functions in required libs as extern (kspread), or they link 'real' objects and no dummies (krita).

As a workaround, configure without LDFLAGS set:

$ LDFLAGS= ./configure
Comment 10 Michael Nottebrock 2005-11-24 15:36:04 UTC
Obviously this is a real bug in karbon we're dealing with here (--as-needed is disabled for all of KDE on FreeBSD by the way - it breaks at much lower levels, for instance by 'optimizing' away pthread symbols).

Could someone set this bug to confirmed, please?
Comment 11 David Faure 2005-11-24 18:03:12 UTC
SVN commit 482973 by dfaure:

Move the part entry point (init_libkarbonpart) to the part itself, for systems
where dlopen doesn't look in dependent libraries.
BUG: 111372


 M  +2 -5      Makefile.am  
 M  +0 -4      karbon_factory.cc  
 A             karbon_factory_init.cc   [License: no copyright]


--- trunk/koffice/karbon/Makefile.am #482972:482973
@@ -30,7 +30,7 @@
 libkarbonbase_la_LDFLAGS = $(KDE_RPATH) -version-info 2:0:0 -no-undefined
 libkarbonbase_la_LIBADD = $(LIB_KOFFICEUI)
 
-libkarboncommon_la_LDFLAGS = $(KDE_RPATH) $(LIBFREETYPE_RPATH)
+libkarboncommon_la_LDFLAGS = $(KDE_RPATH) $(LIBFREETYPE_RPATH) -no-undefined
 libkarboncommon_la_LIBADD = $(LIB_KOFFICECORE) $(LIB_KOFFICEUI) $(LIB_KOPALETTE) $(LIB_KOPAINTER) $(LIB_KOTEXT) \
 	dockers/libkarbondockers.la \
 	widgets/libkarbonwidgets.la \
@@ -47,7 +47,7 @@
 	$(LIBMAGICK_LIBS) \
 	$(LIBFREETYPE_LIBS)
 
-libkarbonpart_la_SOURCES = dummy.cpp
+libkarbonpart_la_SOURCES = karbon_factory_init.cc
 libkarbonpart_la_LDFLAGS = $(KDE_PLUGIN) $(LIBFREETYPE_RPATH)
 libkarbonpart_la_LIBADD = libkarboncommon.la
 libkarbonpart_la_METASOURCES = AUTO
@@ -58,9 +58,6 @@
 karbon_la_LDFLAGS = $(all_libraries) -module -avoid-version
 karbon_la_LIBADD = libkarboncommon.la
 
-dummy.cpp:
-	echo > dummy.cpp
-
 noinst_HEADERS = \
 	karbon_factory.h \
 	karbon_part_base.h \
--- trunk/koffice/karbon/karbon_factory.cc #482972:482973
@@ -36,12 +36,8 @@
 
 #include <kdebug.h>
 
-
 KarbonResourceServer* KarbonFactory::s_rserver = 0;
 
-
-K_EXPORT_COMPONENT_FACTORY( libkarbonpart, KarbonFactory() )
-
 KInstance* KarbonFactory::s_instance = 0L;
 KAboutData* KarbonFactory::s_aboutData = 0L;
 
Comment 12 Michael Nottebrock 2005-11-25 20:39:30 UTC
Please backport to branches/1.4 as well, the diffs apply verbatim. Thanks for fixing!