[Gdcm-hackers] [ gdcm-Bugs-3067845 ] segfault in gdcmFileMetaInformation.cxx while writing RTPlan
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: SourceForge.net <no...@so...> - 2011-12-30 09:44:57
|
Bugs item #3067845, was opened at 2010-09-16 12:21 Message generated for change (Comment added) made by malat You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=739587&aid=3067845&group_id=137895 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: General (default) >Group: 2.0.19 >Status: Pending Resolution: None >Priority: 1 Private: No Submitted By: andy buckle (blondandy) Assigned to: Mathieu Malaterre (malat) Summary: segfault in gdcmFileMetaInformation.cxx while writing RTPlan Initial Comment: gdcm 2.0.16. My code is loading a dicom file, turning everything into GNU Octave variables, turning everything back into GDCM objects, and then saving. Below is (1) part of a backtrace (the problem is bv being a null pointer, but I can't see why it is). (2) a snippet of my code, before it does the writing. I print the SOPClassUID to see if I made the File and Writer objects properly. This prints OK. Note: This is RTPlan, so no image. I did it this way because this is supposed to be general purpose (image or not) code. Mathieu - I hope you are recovering rapidly. Thanks, Andy (1) #0 0x00007fffee35d485 in gdcm::FileMetaInformation::FillFromDataSet (this=0x7fffffffca60, ds=...) at /home/andy/gdcm/gdcm-2-0/Source/DataStructureAndEncodingDefinition/gdcmFileMetaInformation.cxx:178 sopclass = @0x139bb10 mssopclass = {TagField = {ElementTag = {tag = 131074, tags = {2, 2}, bytes = "\002\000\002"}}, ValueLengthField = {ValueLength = 30}, VRField = {VRField = UI}, ValueField = {Pointer = 0x15f5fa0}} bv = 0x0 dicomdir = false xde = {TagField = {ElementTag = {tag = 65538, tags = {2, 1}, bytes = "\002\000\001"}}, ValueLengthField = {ValueLength = 2}, VRField = { VRField = OB}, ValueField = {Pointer = 0x15f94b0}} dummy = @0x7ffff6bfaa59 filemetagrouplength = {Internal = {4294952800}} glen = 32767 #1 0x00007fffee38ff9f in gdcm::Writer::Write (this=0x7fffffffcdc0) at /home/andy/gdcm/gdcm-2-0/Source/DataStructureAndEncodingDefinition/gdcmWriter.cxx:73 duplicate = {<gdcm::DataSet> = {DES = std::set with 5 elements = {[0] = {TagField = {ElementTag = {tag = 65538, tags = {2, 1}, bytes = "\002\000\001"}}, ValueLengthField = {ValueLength = 2}, VRField = {VRField = OB}, ValueField = {Pointer = 0x15f94b0}}, [1] = {TagField = {ElementTag = {tag = 131074, tags = {2, 2}, bytes = "\002\000\002"}}, ValueLengthField = {ValueLength = 30}, VRField = { VRField = UI}, ValueField = {Pointer = 0x15f5fa0}}, [2] = {TagField = {ElementTag = {tag = 196610, tags = {2, 3}, bytes = "\002\000\003"}}, ValueLengthField = {ValueLength = 46}, VRField = {VRField = UI}, ValueField = {Pointer = 0x15fb4f0}}, [3] = {TagField = {ElementTag = {tag = 1048578, tags = {2, 16}, bytes = "\002\000\020"}}, ValueLengthField = {ValueLength = 18}, VRField = {VRField = UI}, ValueField = {Pointer = 0x139b310}}, [4] = {TagField = {ElementTag = {tag = 1179650, tags = {2, 18}, bytes = "\002\000\022"}}, ValueLengthField = {ValueLength = 20}, VRField = {VRField = UI}, ValueField = {Pointer = 0x15fae90}}}, static DEEnd = {TagField = {ElementTag = {tag = 4294967295, tags = {65535, 65535}, bytes = "\377\377\377\377"}}, ValueLengthField = { ValueLength = 0}, VRField = {VRField = INVALID}, ValueField = {Pointer = 0x0}}}, DataSetTS = {TSField = TS_END}, MetaInformationTS = Unknown, DataSetMS = MS_END, P = {Internal = 0x1376640 ""}, static GDCM_FILE_META_INFORMATION_VERSION = 0x7fffee39eadf "", static GDCM_IMPLEMENTATION_CLASS_UID = 0x7fffee39eb00 "1.2.826.0.1.3680043.2.1143.107.104.103.115.2.0.16", static GDCM_IMPLEMENTATION_VERSION_NAME = 0x7fffee39eb32 "GDCM 2.0.16", static GDCM_SOURCE_APPLICATION_ENTITY_TITLE = 0x7fffee39eb3e "GDCM", static ImplementationClassUID = "1.2.826.0.1.3680043.2.1143.107.104.103.115.2.0.16", static ImplementationVersionName = "GDCM 2.0.16", static SourceApplicationEntityTitle = "GDCM"} os = @0x110ad80 Header = @0x1111f60 DS = @0x1111fa8 ts = @0x1111f50 #2 0x00007fffed90c26f in Fdicomwrite (args=<value optimized out>, nargout=<value optimized out>) at dicomwrite.cpp:119 .... (2) #if 1 /* debug */ gdcm::File fc=w.GetFile(); gdcm::DataSet dsc=fc.GetDataSet(); const gdcm::DataElement & sopclass = dsc.GetDataElement( gdcm::Tag(0x0008, 0x0016) ); // SOPClassUID const gdcm::ByteValue *bv = sopclass.GetByteValue(); char * bufc=(char *) malloc((bv->GetLength()+1)*sizeof(char)); memcpy(bufc, bv->GetPointer(), bv->GetLength()); bufc[bv->GetLength()]='\0'; octave_stdout << bufc << '\n' ; free(bufc); #endif if( !trial ) { // if not writing image, use superclass if (writing_image ? !w.ImageWriter::Write() : !w.Writer::Write()){ error(QUOTED(OCT_FN_NAME)": unable to save"); return retval; } } ---------------------------------------------------------------------- >Comment By: Mathieu Malaterre (malat) Date: 2011-12-30 01:44 Message: Andy, could you give the latest git/release a try ? Pierre recently made a commit about something very similar. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=739587&aid=3067845&group_id=137895 |