DcmFileFormat saveFile crash

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
mesajflaviu
Posts: 16
Joined: Mon, 2016-12-05, 10:00

DcmFileFormat saveFile crash

#1 Post by mesajflaviu »

I am struggling to save dcm file from DcmDataset to file to disk.
How I try that:

Code: Select all

DcmFileFormat FileFormat;
FileFormat.saveFile(strFilePath, pDS->getOriginalXfer());
where pDS is the dataset. The dataset is retrieved from a PACS server an has 1.8 GB files as dcm multiframe. But at some point, I get the following error:

Code: Select all

Access violation writing location 0x00000000
and the debugger lead me here:

Code: Select all

//dcelem.cc, line 115
        memcpy(fValue, elem.fValue, size_t(getLengthField() + pad));
I am using 3.6.0 version of DCMTK. What could be the problem ? And how to solve it ?

Thank you in advance !

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: DcmFileFormat saveFile crash

#2 Post by Michael Onken »

Hi,

can you see what is pointing to NULL, the variable fValue?

Are you on a 32 bit system? Did you change the transfer syntax of the file in memory (e.g. decompressed it)? Has there been any error or warning output on the logger, anything special on DEBUG log level? Do dcmdump and dcmconv work on the file?

Best,
Michael

mesajflaviu
Posts: 16
Joined: Mon, 2016-12-05, 10:00

Re: DcmFileFormat saveFile crash

#3 Post by mesajflaviu »

can you see what is pointing to NULL, the variable fValue?
Yes, the fValues has NULL value.
Are you on a 32 bit system?
No, I am running on 64 bit system.
Did you change the transfer syntax of the file in memory
Not at all.
Has there been any error or warning output on the logger, anything special on DEBUG log level?
No, I didn't noticed.
Do dcmdump and dcmconv work on the file
How can I try that ? Because the files are on PACS server, and the error occur when I am trying to retrieve dcm files on local disk ...

Kindly thank you !

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: DcmFileFormat saveFile crash

#4 Post by Michael Onken »

Hi,

can you try receiving with storescp? In case you can try option --bit-preserving. If you can receive successfully, then try dcmdump <file> and dcmconv <file> <output_file_name>.

Best,
Michael

mesajflaviu
Posts: 16
Joined: Mon, 2016-12-05, 10:00

Re: DcmFileFormat saveFile crash

#5 Post by mesajflaviu »

Thank you for all your support. I have found the problem: the (old) reading code had tried to convert dataset into dcmfileformat, and then this dcmfileformat read the file ... and doing that, I have that crashing. Once as I read the file with the original dataset, everything seem to be alright.

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: DcmFileFormat saveFile crash

#6 Post by Michael Onken »

You're welcome, enjoy DCMTK

Post Reply

Who is online

Users browsing this forum: Google [Bot], Semrush [Bot] and 1 guest