dicomscope fails to start with "undefined symbol" error

Bug #960022 reported by MarcS
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
dicomscope (Debian)
Fix Released
Unknown
dicomscope (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When starting dicomscope, it immediately aborts with the following message printed to the console:

$ dicomscope
starting DICOMscope
please wait...
Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/lib/libjInterface.so: /usr/lib/libdcmtls.so.2: undefined symbol: _ZTI22DcmTransportConnection
 at java.lang.ClassLoader$NativeLibrary.load(Native Method)
 at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1750)
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1675)
 at java.lang.Runtime.loadLibrary0(Runtime.java:840)
 at java.lang.System.loadLibrary(System.java:1047)
 at main.MainContext.<clinit>(MainContext.java:58)
 at dicomscope.DICOMscope.main(DICOMscope.java:91)

What I've found so far is:

The missing symbol is:
$ c++filt _ZTI22DcmTransportConnection
typeinfo for DcmTransportConnection

Which is indeed undefined in libdcmtls:
$ objdump -CT /usr/lib/libdcmtls.so.2 | grep "typeinfo for DcmTransportConnection"
00000000 D *UND* 00000000 typeinfo for DcmTransportConnection

And defined in libdcmnet:
$ objdump -CT /usr/lib/libdcmnet.so.2 | grep "typeinfo for DcmTransportConnection"
000d468c w DO .data.rel.ro 00000008 Base typeinfo for DcmTransportConnection

But since libdcmtls does not "need" libdcmnet:
$ objdump -x /usr/lib/libdcmtls.so.2 | grep NEEDED
  NEEDED libgcc_s.so.1
  NEEDED libc.so.6

libdcmnet is not loaded when libdcmtls is, and so the start fails.

I have confirmed this by compiling the affected libraries myself and linking them with the correct dependencies, with which dicomscope starts and works.

System info:
$ lsb_release -rd
Description: Ubuntu 11.10
Release: 11.10

$ apt-cache policy dicomscope
dicomscope:
  Installed: 3.6.0-6.1
  Candidate: 3.6.0-6.1
  Version table:
 *** 3.6.0-6.1 0
        500 http://de.archive.ubuntu.com/ubuntu/ oneiric/universe i386 Packages
        100 /var/lib/dpkg/status

$ apt-cache policy libdcmtk2
libdcmtk2:
  Installed: 3.6.0-6ubuntu1
  Candidate: 3.6.0-6ubuntu1
  Version table:
 *** 3.6.0-6ubuntu1 0
        500 http://de.archive.ubuntu.com/ubuntu/ oneiric/universe i386 Packages
        100 /var/lib/dpkg/status

$ apt-cache policy openjdk-6-jre
openjdk-6-jre:
  Installed: 6b23~pre11-0ubuntu1.11.10.2
  Candidate: 6b23~pre11-0ubuntu1.11.10.2
  Version table:
 *** 6b23~pre11-0ubuntu1.11.10.2 0
        500 http://de.archive.ubuntu.com/ubuntu/ oneiric-updates/main i386 Packages
        500 http://security.ubuntu.com/ubuntu/ oneiric-security/main i386 Packages
        100 /var/lib/dpkg/status
     6b23~pre10-0ubuntu5 0
        500 http://de.archive.ubuntu.com/ubuntu/ oneiric/main i386 Packages

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in dicomscope (Ubuntu):
status: New → Confirmed
Revision history for this message
Neal McBurnett (nealmcb) wrote :

The same thing happened for me in the official Precise 12.04 version.

Is this app totally broken for everyone in both oneiric and precise?

MarcS, can you share details on how you built a working version? Thanks!

Revision history for this message
MarcS (marc-schmitzer) wrote :

The problem is - as far as I understand it - that some dcmtk libraries (libdcmtls in the example) use symbols from other libraries (i.e. libdcmnet), but are not linked against them.

Because of that, the java library-loader does not know it also needs to load dcmnet when it loads dcmtls.

Basically, all that is needed specifying the required libraries with the "-l" linker flag when compiling the dcmtk libs. One can use "--Xlinker --no-undefined" to enforce that all required libraries are listed.

I verified this by recompiling some of the libraries by hand. Sadly I have no clue about cmake and don't know how to fix the dcmtk build process.

Revision history for this message
Neal McBurnett (nealmcb) wrote :

The actual error I got in precise 12.04 had an extra "jni/" in the path, so google didn't find this bug report:

$ dicomscope
starting DICOMscope
please wait...
Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/lib/jni/libjInterface.so: /usr/lib/libdcmtls.so.2: undefined symbol: _ZTI22DcmTransportConnection
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1750)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1675)
        at java.lang.Runtime.loadLibrary0(Runtime.java:840)
        at java.lang.System.loadLibrary(System.java:1047)
        at main.MainContext.<clinit>(MainContext.java:58)
        at dicomscope.DICOMscope.main(DICOMscope.java:91)

Revision history for this message
MarcS (marc-schmitzer) wrote :

Two possible workarounds:
 - Link libjInterface (part of dicomscope) against libdcmnet and other indirectly needed libraries.
 - Manually load the needed libraries in dicomscope itself before loading libjInterface in tkgui/main/MainContext.java .

I have not tried these myself, though.

Revision history for this message
Dylan Aïssi (daissi) wrote :

Fixed since dicomscope (3.6.0-10) in Trusty.

   * Fix underlinked java module. Closes: #694846

Changed in dicomscope (Ubuntu):
status: Confirmed → Fix Released
Changed in dicomscope (Debian):
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.