10000 System.StackOverflowException DicomFile.Save (large DICOMDIR) · Issue #1977 · fo-dicom/fo-dicom · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

System.StackOverflowException DicomFile.Save (large DICOMDIR) #1977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
benzhi opened this issue May 21, 2025 · 0 comments
Open

System.StackOverflowException DicomFile.Save (large DICOMDIR) #1977

benzhi opened this issue May 21, 2025 · 0 comments
Labels

Comments

@benzhi
Copy link
benzhi commented May 21, 2025

Describe the bug
When calling Save on a large DicomDir, counting hundred of thousands of images, a StackOverflowException is thrown.

To Reproduce
Scan a medium containing TBs of DICOM images, add all file references and corresponding Patient, Study and Series details to an instance of DicomDirectory, then call DicomDirectory.Save(string fileName, DicomWriteOptions options = null);

Expected behavior
Normal storage of the DICOMDIR file

Screenshots or test DICOM files
Call stack:

>	fo-dicom.core.dll!FellowOakDicom.IO.ByteConverter.ToByteBuffer<uint>(uint[] values) Line 48	C#
 	fo-dicom.core.dll!FellowOakDicom.DicomDataset.DoAdd<uint>(FellowOakDicom.DicomVR vr, FellowOakDicom.DicomTag tag, System.Collections.Generic.IList<uint> values, bool allowUpdate) Line 1507	C#
 	fo-dicom.core.dll!FellowOakDicom.DicomDataset.DoAdd<uint>(FellowOakDicom.DicomTag tag, System.Collections.Generic.IList<uint> values, bool allowUpdate) Line 1231	C#
 	fo-dicom.core.dll!FellowOakDicom.DicomDataset.AddOrUpdate<uint>(FellowOakDicom.DicomTag tag, uint[] values) Line 981	C#
 	fo-dicom.core.dll!FellowOakDicom.Media.DicomDirectory.SetOffsets(FellowOakDicom.Media.DicomDirectoryRecord record) Line 448	C#
 	fo-dicom.core.dll!FellowOakDicom.Media.DicomDirectory.SetOffsets(FellowOakDicom.Media.DicomDirectoryRecord record) Line 449	C#
 	[The 1 frame(s) above this were repeated 9619 times]	
 	fo-dicom.core.dll!FellowOakDicom.Media.DicomDirectory.SetOffsets(FellowOakDicom.Media.DicomDirectoryRecord record) Line 449	C#
 	fo-dicom.core.dll!FellowOakDicom.Media.DicomDirectory.OnSave() Line 397	C#
 	fo-dicom.core.dll!FellowOakDicom.DicomFile.Save(string fileName, FellowOakDicom.IO.Writer.DicomWriteOptions options) Line 136	C#

Environment
Fellow Oak DICOM version: 5.2.1
OS: Windows 10 x64
Platform: .NET 8.0

@benzhi benzhi added the new label May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant
0