DICOM Viewer plug in seg fault

Hi Everybody,

I've managed to compile and successfully run Orthanc-0.9.3 on my OS X (10.10.4 ).
I also tried to install the Orthanc-WebViewer (both 1.2 and from the master branch) however I get the following seg fault when I launch the Orthanc server:

W0909 12:32:38.786421 main.cpp:697] Orthanc version: 0.9.3
W0909 12:32:38.787125 OrthancInitialization.c/Users/rjosest/src/external/Orthanc-0.9.3-build/Configuration.jsonpp:72] Reading the configuration from: "Configuration.json"
W0909 12:32:38.790183 DicomServer.cpp:108] Loading the embedded dictionaries
W0909 12:32:38.811174 OrthancInitialization.cpp:275] Registering JPEG Lossless codecs
W0909 12:32:38.811259 OrthancInitialization.cpp:280] Registering JPEG codecs
W0909 12:32:38.811376 main.cpp:376] Loading plugin(s) from: /Users/rjosest/src/external/Orthanc-WebViewer-build/libOrthancWebViewer.mainline.dylib
Segmentation fault: 11

Does anybody have encounter a similar problem? Any clues?

I've run the server with --verbose and --trace but I don't get additional information.

Below is my configuration file in case this is useful.

Thanks a lot

Raul

Hello,

Please could you also provide a sample DICOM image that leads to the segmentation fault?

Sébastien-

Hi Sébastien,

The seg fault happens when I’m launching the server. There are no images loaded.

Thanks

/R

Sorry, I cannot reproduce your issue with Xcode 5.0.2 running on OS X Mavericks 10.9.1.

I cannot provide any further help by myself.

Hi Sébastien,

Thank you for your feedback. If this is useful, I’m using XCode 6.4. I’ll try to do some debugging and report my findings back to the list.

Thanks

/R

Hi Sébastien,

I've some done diagnostics around this seg fault problem and this is what I found.
I've traced the problem back to a EXC_BAD_ACCESS in

24L signed char* JlsContext::_tableC = CreateTableC(); -> jpegls.cpp

If ENABLE_JPEG_LOSSLESS is disabled, the viewer plug-in loads without a problem.

Has anybody encountered a similar problem?

Thanks

Raul

Hi,

Does the segfault also occurs when you do not load any plugin? If so, this is visibly a bug inside DCMTK 3.6.0 that should be reported to the Offis team. If not, this perhaps results from a bad interaction between DCMTK (in the Orthanc core) and GDCM (inside the Web viewer plugin).

I hope there will be soon an new official release of DCMTK, as I know that many fixes have been implemented since its latest official release (3.6.0 is 4 years old). Maybe this crash has been fixed since that time.

Regards,
Sébastien-

Hi,

It only happens when I load the plugin. I can also load the plugin successfully if I disabled compressed JPEG. I agree with you that this looks more like a DCMTK bug.

Thanks

/R

Hello,

FYI, the Orthanc repository now has a “dcmtk-3.6.1” branch that uses the latest snapshot of forthcoming DCMTK 3.6.1, instead of DCMTK 3.6.0 [1].

Would it be possible for you to check whether this branch fixes your segfault?

Sébastien-

[1] https://bitbucket.org/sjodogne/orthanc/branch/dcmtk-3.6.1

Hi Sébastien,

I tried the dcmtk-3.6.1 branch with the latest orthanc-dicomweb-viewer and the same problem persist. See below the backtrace.

The problem is on L106 in context.h CreateTableC(). For some reason the call

rgtableC.push_back(-128);

triggers a bad allocation when loading the Plugin. This is related to GDCM.

As you suggested, it looks like there is a conflict between the Charls library in dcmtk and GDCM when loading the plugin. Could this be related to name mangling?

/R

Bracktrace of seg fautl:

Hello,

You are right: Under OS X, the shared library was publicly exposing symbols from GDCM that should have been hidden.

The mainline of the Web viewer plugin now only exposes 4 public symbols. Would it be possible for you to try again?

Thanks,
Sébastien-

Hello,

Looks like this only happens with dynamic linking of the plugin dependencies.
Adding -DSTATIC_BUILD=OFF -DALLOW_DOWNLOADS=ON to the plugin build should be enough to solve your issue.

Thibault,
Osimis S.A.

I’ve mistyped,

it’s of course -DSTATIC_BUILD=ON -DALLOW_DOWNLOADS=ON.

Thibault,
Osimis S.A.