Efferent-Health / fo-dicom.Codecs

Cross-platform Dicom native codecs for fo-dicom
Other
64 stars 22 forks source link

Transcode dicom causing the pods to crash #39

Closed arunmk-ms closed 1 year ago

arunmk-ms commented 1 year ago

Describe the bug Application pods are crashing while transcoding a dicom file that has some characters in a different language.

To Reproduce Transcode a dcm file that has some characters in a different language.

Expected behavior The fodicom library throws an unhandled exception DicomCodecException while running on windows and the exception can be handled in the application code. We could see the full stack trace in windows. But at the same time, the application pod crashes immediately after writing the exception "FellowOakDicom.Imaging.Codec.DicomCodecException: " in Linux. As per the crash dump, the failure is from the unmanaged code while trying to format the message.

FellowOakDicom.Imaging.Codec.DicomCodecException: <REDACTED> {"name":"AppExceptions","time":"2023-03-21T15:57:14.2619107Z","tags":{"ai.application.ver":"1.0.0.0",,"ai.location.ip":"::1",,"data":{"baseType":"ExceptionData","baseData":{"ver":2,"exceptions":[{"id":7456581,"outerId":0,"typeName":"FellowOakDicom.Imaging.Codec.DicomCodecException","message":"<REDACTED>\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000","hasFullStack":true,"parsedStack":[{"level":0,"method":"FellowOakDicom.Imaging.NativeCodec.Jpeg.JpegCodec.ErrorExit","assembly":"Dicom.NativeCodecs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null","line":0},{"level":1,"method":"FellowOakDicom.Imaging.NativeCodec.Jpeg.JpegCodec.jpeg_start_decompress_12_Windows_x64","assembly":"Dicom.NativeCodecs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null","line":0},{"level":2,"method":"FellowOakDicom.Imaging.NativeCodec.Jpeg.JpegCodec.Decode","assembly":"Dicom.NativeCodecs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null","line":0},{"level":3,"method":"FellowOakDicom.Imaging.NativeCodec.DicomJpegNativeCodec.Decode","assembly":"Dicom.NativeCodecs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null","line":0},{"level":4,"method":"FellowOakDicom.Imaging.Codec.DicomTranscoder.Decode","assembly":"fo-dicom.core, Version=5.0.3.0, Culture=neutral, PublicKeyToken=","line":0},{"level":5,"method":"FellowOakDicom.Imaging.Codec.DicomTranscoder.Transcode","assembly":"fo-dicom.core, Version=5.0.3.0

Environment Fellow Oak DICOM version: 5.0.3 fo-dicom codes: 5.10.0 OS: Linux x64 Platform: .NET Framework 7.0.202

arunmk-ms commented 1 year ago

Crash dump also shows that the pod crash is due to DicomCodecException and below is the stack trace.

wait4 libc.so.6, libcoreclr.so format_message_8 (Dicom.Native-linux-x64.so)

FellowOakDicom.Imaging.NativeCodec.Jpeg.JpegCodec.ErrorExit(FellowOakDicom.Imaging.NativeCodec.j_common_ptr ByRef) -> Dicom.NativeCodecs.dll FellowOakDicom.Imaging.NativeCodec.Jpeg.JpegCodec.Decode(FellowOakDicom.Imaging.DicomPixelData, FellowOakDicom.Imaging.DicomPixelData, FellowOakDicom.Imaging.NativeCodec.DicomJpegParams, Int32 FellowOakDicom.Imaging.NativeCodec.DicomJpegNativeCodec.Decode(FellowOakDicom.Imaging.DicomPixelData, FellowOakDicom.Imaging.DicomPixelData, FellowOakDicom.Imaging.Codec.DicomCodecParams) FellowOakDicom.Imaging.Codec.DicomTranscoder.Decode(FellowOakDicom.DicomDataset, FellowOakDicom.DicomTransferSyntax, FellowOakDicom.Imaging.Codec.IDicomCodec, FellowOakDicom.Imaging.Codec.DicomCodecParams) FellowOakDicom.Imaging.Codec.DicomTranscoder.Transcode(FellowOakDicom.DicomDataset)

jaime-olivares commented 1 year ago

Already looking at this issue

jaime-olivares commented 1 year ago

This issue has been solved with version 5.10.2, which is already published in nuget