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:
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.
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.
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?
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.