View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003040 | Slicer4 | Core: Building (CMake, Superbuild) | public | 2013-04-01 06:50 | 2017-06-07 23:27 |
Reporter | pieper | Assigned To | jcfr | ||
Priority | urgent | Severity | block | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | |||||
Target Version | Slicer 4.3.0 | Fixed in Version | Slicer 4.3.0 | ||
Summary | 0003040: Building DCMTK in shared mode prevents crash at startup | ||||
Description | On a recent mac build (r21851) with up to date xcode 4.6 and 10.8.2 slicer crashed on startup in the initialization of dcmtk. The stack trace is in the Additional Information below. I changed the DCMTK built to be shared and slicer works fine. Since we have had a lot of problems on various platforms when using a static DCMTK in multiple shared libraries (CLIs, Modules, etc) I suggest we switch to shared DCMTK. There will no doubt need to be some changes to the packaging and perhaps the app launcher, but that is probably worth it at this point. | ||||
Steps To Reproduce | This is the change to make slicer work correctly in a local build. 0000233 Slicer (master *%=)$ git diff | ||||
Additional Information | (lldb) bt all
| ||||
Tags | No tags attached. | ||||
Agree. |
|
My Mac Slicer build is showing the same error. |
|
Interestingly there are no issues on both the old and new factory. Could you check the CMakeCache.txt to check if the correct DCMTK library are found ? With the new DCMTKConfig.cmake they should. Do you have any extensions built against a different version of DCMTK that are installed ? |
|
I had completely wiped out my build tree and still had this issue. DCMTK_DIR:PATH=/Users/200005014/Projects/Slicer4-git/Slicer4-build/DCMTK-build |
|
Here are the paths for me in the shared build (where things work). These paths are correct. I don't have the non-shared build anymore but I believe I checked and the paths were correct. 0000013 Slicer-superbuild $ grep DCMTK_DIR */CMakeCache.txt |
|
It is strange to see the variable "DCMTK_DIR_ROOT" in your Slicer cache, this probably mean that you didn't do a clean build. If it exists, make sure to remove the folder "/Users/pieper/slicer4/latest/Slicer-superbuild/DCMTK-install" Could you then confirm that a clean build or current trunk using default option gives a Slicer executable failing to start ? |
|
Jim already reported that a clean build crashes on startup... |
|
Here are all my DCMTK paths % grep DCMTK_DIR */CMakeCache.txt |
|
Following the NA-MIC tcon of April 4th, we discussed that Jim will be creating a small program reproducing the issue. Based on his findings, we will be sending an email to DCMTK folks. DCMTK commit "b2b14d78c" is suspected to introduce the regression: Update oflog to log4cplus 1.1.0 |
|
This is tricky. The following code works without issue. #include "itkImage.h" int main(int argc, char* argv[]) typedef itk::Image<unsigned char,2> ImageType; ReaderType::Pointer reader = ReaderType::New(); typedef itk::ImageFileWriter<ImageType> WriterType; WriterType::Pointer writer = WriterType::New(); I guess I need to get the "default" factories not to load and have the DCMTKImageIO library loaded from the ITK_AUTOLOAD_PATH |
|
I modified my ITK build so that GDCM is not in the default factory list. Then I modified the DCMTKImageIOFactory to have an itkLoad function. The following test program then runs without issue. It loads DCMTKImageIO from the ITK_AUTOLOAD_PATH. #include "itkImage.h" int main(int argc, char* argv[]) ReaderType::Pointer reader = ReaderType::New(); typedef itk::ImageFileWriter<ImageType> WriterType; WriterType::Pointer writer = WriterType::New(); |
|
A program using just the DCMTK logger works if only linked against oflog #include "dcmtk/oflog/oflog.h" int main(int argc, char* argv[]) OFLOG_INFO(my_log, "Testing the DCMTK logger"); |
|
But when linked against oflog and ITK_LIBRARIES, then it crashes |
|
That is great. Seems you are able to come with a simpler use case :) Do you think, you could come with an example that produce the crash without involving ITK at all ? By for example, having:
With that in hand, we would be able to have the argument to discuss with Offis team. Thanks again, |
|
Where do we stand on this? Right now people need to change DCMTK to shared in order to run their builds at all on mac (maybe linux too). I think we should move to a shared DCMTK to fix the problem rather than trying to convince the Offis people to accept our use case (which they think is not really a valid one if I understand correctly). |
|
I tried writing a test program that used oflog like above AND did a dlopen on a library that used oflog. I thought this would mimic the ITK issue. Unfortunately, that program works find. I had to change my Mac built to using a shared DCMTK as I had other work that needed my attention. |
|
I did a completely fresh test build in release mode with DCMTK built shared: Here is the resulting package, which works for me and is able to load dicom data: https://s3.amazonaws.com/extra.isomics.com/tmp/Slicer-4.2.0-2013-04-24-macosx-amd64.dmg All the shared libraries appear to be in the normal spots, so I would think this will work on all platforms. @jcfr - do you have an objection to having this change checked in? It only seems for the better from my point of view. |
|
@steve: The only think I am thinking about are dcmtk apps. I think they won't work without being run using the Slicer launcher. If this is a none issue. It should be good. On platform like windows and linux, the launcher setting would have to be updated. There are no rpath within the install tree. No real show stopper. |
|
The dcmtk apps (dcmdump, storescp) are used now in subshells from slicer (AFIAIK) so they should inherit the environment and work I would think. If people need to use slicer's compiled versions of them outside slicer, then I guess having to use the launcher is fair, just like running a CLI. Regarding the launcher though, I don't think a change needs to be made since the dcmtk libraries should show up in lib/Slicer-4.2 along with all the other shared libraries. Since this is a problem for developers right now, I'm going to check in the change and we can see if there is any fallout. |
|
Fixed in this commit: http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=21914 |
|
Confirmed that dcmtk built in shared mode works correctly on nightly builds for all platforms. http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=21942 |
|
Slicer: 2145-support-for-installing-extension-from-file 0410e935 2013-04-24 17:27:04 Details Diff |
BUG: 0003040 build DCMTK as shared libraries This avoids issues where dcmtk code is statically linked into more than one shared library, meaning that some static initialization and destructor code is being invoked more than once. See the bug report for details. http://www.na-mic.org/Bug/view.php?id=3040 git-svn-id: http://svn.slicer.org/Slicer4/trunk@21914 3bd1e089-480b-0410-8dfb-8563597acbee |
||
mod - SuperBuild/External_DCMTK.cmake | Diff File | ||
Slicer: 2145-support-for-installing-extension-from-file 800445da 2013-04-26 17:22:32 Details Diff |
COMP: Include DCMTK shared libraries in packages Now that DCMTK is built as shared rather than static, the dlls need to be copied into the install tree for packaging. See also commit 21914 and bug 0003040. git-svn-id: http://svn.slicer.org/Slicer4/trunk@21944 3bd1e089-480b-0410-8dfb-8563597acbee |
||
add - CMake/SlicerBlockInstallDCMTKLibs.cmake | Diff File | ||
mod - CMake/SlicerCPack.cmake | Diff File | ||
Slicer: 2145-support-for-installing-extension-from-file 9feb3bd2 2013-04-26 18:01:17 Details Diff |
COMP: Tweak installation of DCMTK libraries for MacOSX packaging Following commit r21914, DCMTK libraries are build as shared library. Commit r21944 ensured that they were installed. Since on MacOSX the fixup process takes care of copying the library associated with external projects, this commit exclude the systematic installation of DCMTK libraries and teach the fixup script where these libraries are located. See issue 0003040 git-svn-id: http://svn.slicer.org/Slicer4/trunk@21947 3bd1e089-480b-0410-8dfb-8563597acbee |
||
mod - CMake/SlicerCPack.cmake | Diff File | ||
mod - CMake/SlicerCPackBundleFixup.cmake.in | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-04-01 06:50 | pieper | New Issue | |
2013-04-01 06:50 | pieper | Status | new => assigned |
2013-04-01 06:50 | pieper | Assigned To | => jcfr |
2013-04-01 10:59 | jcfr | Note Added: 0008274 | |
2013-04-01 11:00 | jcfr | Priority | normal => high |
2013-04-02 09:42 | millerjv | Note Added: 0008287 | |
2013-04-02 09:45 | jcfr | Note Added: 0008288 | |
2013-04-02 10:03 | millerjv | Note Added: 0008291 | |
2013-04-02 13:42 | pieper | Note Added: 0008296 | |
2013-04-02 13:54 | jcfr | Note Added: 0008297 | |
2013-04-02 13:55 | jcfr | Note Edited: 0008297 | |
2013-04-02 14:04 | pieper | Note Added: 0008298 | |
2013-04-04 05:32 | millerjv | Note Added: 0008307 | |
2013-04-04 12:08 | jcfr | Note Added: 0008314 | |
2013-04-04 12:08 | jcfr | Status | assigned => feedback |
2013-04-04 12:08 | jcfr | Note Edited: 0008314 | |
2013-04-04 12:46 | millerjv | Note Added: 0008315 | |
2013-04-05 05:31 | jcfr | Relationship added | has duplicate 0003048 |
2013-04-10 07:46 | millerjv | Note Added: 0008360 | |
2013-04-10 08:04 | millerjv | Note Added: 0008361 | |
2013-04-10 08:04 | millerjv | Note Edited: 0008361 | |
2013-04-10 08:05 | millerjv | Note Added: 0008362 | |
2013-04-10 08:05 | millerjv | Note Edited: 0008361 | |
2013-04-10 08:13 | jcfr | Note Added: 0008363 | |
2013-04-24 05:28 | pieper | Note Added: 0008470 | |
2013-04-24 06:33 | millerjv | Note Added: 0008472 | |
2013-04-24 13:00 | pieper | Note Added: 0008481 | |
2013-04-24 13:01 | pieper | Priority | high => urgent |
2013-04-24 13:01 | pieper | Severity | crash => block |
2013-04-24 13:05 | jcfr | Note Added: 0008482 | |
2013-04-24 13:05 | jcfr | Note Edited: 0008482 | |
2013-04-24 13:06 | jcfr | Note Edited: 0008482 | |
2013-04-24 13:23 | pieper | Note Added: 0008483 | |
2013-04-24 13:30 | pieper | Note Added: 0008484 | |
2013-04-24 13:30 | pieper | Status | feedback => resolved |
2013-04-24 13:30 | pieper | Fixed in Version | => Slicer 4.3.0 |
2013-04-24 13:30 | pieper | Resolution | open => fixed |
2013-04-27 06:42 | pieper | Note Added: 0008527 | |
2013-04-27 06:42 | pieper | Status | resolved => closed |
2013-05-09 10:38 | pieper | Relationship added | has duplicate 0002963 |
2013-05-09 10:40 | pieper | Relationship added | has duplicate 0002459 |
2017-06-07 23:27 | jcfr | Changeset attached | => Slicer 2145-support-for-installing-extension-from-file 9feb3bd2 |
2017-06-07 23:27 | pieper | Changeset attached | => Slicer 2145-support-for-installing-extension-from-file 800445da |
2017-06-07 23:27 | pieper | Changeset attached | => Slicer 2145-support-for-installing-extension-from-file 0410e935 |