Open fedorov opened 7 years ago
Further investigation showed that:
1) it was possible to complete the conversion task by using --skip
flag to the converter, which does not encode empty frames. The conversion process was also a lot faster.
2) I was able to reproduce the reported memory allocation problem after a very very long wait in the end of the conversion process:
itkimage2segimage(28547,0x7fffb50373c0) malloc: *** mach_vm_map(size=2305843009052147712) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc
@michaelonken my plan is to investigate this by adding valgrind tests and first making sure there are no memory leaks in the dcmqi code. Once that is done, we can look into DCMTK if the problem still persists. I am sure there are memory leaks in dcmqi! Let me know if you have a better suggestion!
from @michaelonken
I fixed some variable declarations/computations when the GE aviation team reported problems with their large segmentation objects, too.
The fixes have been applied in June 2018, and it seems to me dcmqi master is based on DCMTK 3.6.2 from July 2017, and the github issue is from August 2017.
Maybe it's worth to try updating DCMTK (3.6.3, 3.6.4?) to see whether it fixes the problem.
Indeed, need to test with the current DCMTK master.
@michaelonken indeed - there is no crash with the current DCMTK master! I will need to update dcmqi (it is more than one line change, since I need to re-do pre-built DCMTK binary we use for Appveyor). Thank you for pointing this out!
As reported by a user, there is an example where dcmqi SEG converter crashes with a memory allocation failure. The dataset to reproduce the issue has been provided. The crash stack is below (crash appears to happen in DCMTK):