View Issue Details

IDProjectCategoryView StatusLast Update
0026518CommunityOCCT:Application Frameworkpublic2015-09-30 18:39
ReporterVico Liang Assigned Tobugmaster  
PrioritynormalSeveritycrash 
Status closedResolutionno change required 
Product Version6.9.0 
Target Version7.0.0 
Summary0026518: XML document save in method XmlTObjDrivers_ObjectDriver::Paste access null pointer.
Descriptionvoid XmlTObjDrivers_ObjectDriver::Paste
                         (const Handle(TDF_Attribute)& Source,
                          XmlObjMgt_Persistent& Target,
                          XmlObjMgt_SRelocationTable& /*RelocTable*/) const
{
  Handle(TObj_TObject) aTObj =
    Handle(TObj_TObject)::DownCast( Source );
  Handle(TObj_Object) anIObject = aTObj->Get();
  //BUG: anIObject is null.
  XmlObjMgt::SetExtendedString (Target, anIObject->DynamicType()->Name());
}

// Exception Frame as below:
TKXmlTObj.dll!XmlTObjDrivers_ObjectDriver::Paste(const Handle_TDF_Attribute & Source, XmlObjMgt_Persistent & Target, TColStd_IndexedMapOfTransient & __formal) Line 93 C++
     TKXmlL.dll!XmlMDF::WriteSubTree(const TDF_Label & theLabel, LDOM_Element & theElement, TColStd_IndexedMapOfTransient & theRelocTable, const Handle_XmlMDF_ADriverTable & theDrivers) Line 102 C++
     TKXmlL.dll!XmlMDF::WriteSubTree(const TDF_Label & theLabel, LDOM_Element & theElement, TColStd_IndexedMapOfTransient & theRelocTable, const Handle_XmlMDF_ADriverTable & theDrivers) Line 118 C++
     TKXmlL.dll!XmlMDF::WriteSubTree(const TDF_Label & theLabel, LDOM_Element & theElement, TColStd_IndexedMapOfTransient & theRelocTable, const Handle_XmlMDF_ADriverTable & theDrivers) Line 118 C++
     TKXmlL.dll!XmlMDF::WriteSubTree(const TDF_Label & theLabel, LDOM_Element & theElement, TColStd_IndexedMapOfTransient & theRelocTable, const Handle_XmlMDF_ADriverTable & theDrivers) Line 118 C++
     TKXmlL.dll!XmlMDF::WriteSubTree(const TDF_Label & theLabel, LDOM_Element & theElement, TColStd_IndexedMapOfTransient & theRelocTable, const Handle_XmlMDF_ADriverTable & theDrivers) Line 118 C++
     TKXmlL.dll!XmlMDF::WriteSubTree(const TDF_Label & theLabel, LDOM_Element & theElement, TColStd_IndexedMapOfTransient & theRelocTable, const Handle_XmlMDF_ADriverTable & theDrivers) Line 118 C++
     TKXmlL.dll!XmlMDF::WriteSubTree(const TDF_Label & theLabel, LDOM_Element & theElement, TColStd_IndexedMapOfTransient & theRelocTable, const Handle_XmlMDF_ADriverTable & theDrivers) Line 118 C++
     TKXmlL.dll!XmlMDF::WriteSubTree(const TDF_Label & theLabel, LDOM_Element & theElement, TColStd_IndexedMapOfTransient & theRelocTable, const Handle_XmlMDF_ADriverTable & theDrivers) Line 118 C++
     TKXmlL.dll!XmlMDF::FromTo(const Handle_TDF_Data & theData, LDOM_Element & theElement, TColStd_IndexedMapOfTransient & theRelocTable, const Handle_XmlMDF_ADriverTable & theDrivers) Line 61 C++
     TKXmlL.dll!XmlLDrivers_DocumentStorageDriver::MakeDocument(const Handle_CDM_Document & theTDoc, LDOM_Element & theElement) Line 356 C++
     TKXmlL.dll!XmlLDrivers_DocumentStorageDriver::WriteToDomDocument(const Handle_CDM_Document & theDocument, LDOM_Element & theElement, const TCollection_ExtendedString & theFileName) Line 294 C++
     TKXmlL.dll!XmlLDrivers_DocumentStorageDriver::Write(const Handle_CDM_Document & theDocument, const TCollection_ExtendedString & theFileName) Line 117 C++
     TKCDF.dll!CDF_StoreList::Store(Handle_CDM_MetaData & aMetaData, TCollection_ExtendedString & aStatusAssociatedText) Line 108 C++
     TKCDF.dll!CDF_Store::Realize() Line 175 C++
     TKLCAF.dll!TDocStd_Application::SaveAs(const Handle_TDocStd_Document & D, const TCollection_ExtendedString & path) Line 255 C++
     TKTObj.dll!TObj_Application::SaveDocument(const Handle_TDocStd_Document & theSourceDoc, const char * theTargetFile) Line 87 C++
     TKTObj.dll!TObj_Model::SaveAs(const char * theFile) Line 305 C++
Steps To Reproduce1. Create a model of TObj.
2. Save the file to disk as xml.
3. Change the Object class name from A to B.
4. Load the model saved in step 2.
5. Save the model again, the crash will reproduced.
TagsNo tags attached.
Test case number

Relationships

duplicate of 0026517 closedbugmaster XML document save in method XmlTObjDrivers_ObjectDriver::Paste access null pointer. 

Activities

szy

2015-09-17 14:35

manager   ~0045795

Dear Vico,
The provided scenario is not clear. Specify, please more exactly step #3:
"3. Change the Object class name from A to B."
What did you change? Is it just saved xml file or source code?
Additional data are expected to clarify the issue.
Thanks
szy

Vico Liang

2015-09-17 15:09

developer   ~0045805

Dear szy,

Changing the object class name in saved xml file or source code should have the same issue. Changing the name is to make the xml file mismatch with source code.
This will cause the object in xml file haven't object to match it in TObj.
Regards,
Vico

szy

2015-09-30 18:36

manager   ~0046345

Indeed the provided scenario leads to access to null pointer.
Nevertheless the expected exception may be caught and processed by DocumentStorageDriver (see XmlLDrivers_DocumentStorageDriver, step "2a. Write document contents"). Just don't forget to set signals catching (see OSD::SetSignal()).

Issue History

Date Modified Username Field Change
2015-08-05 07:02 Vico Liang New Issue
2015-08-05 07:02 Vico Liang Assigned To => szy
2015-08-05 07:52 Vico Liang Relationship added duplicate of 0026517
2015-09-17 14:35 szy Note Added: 0045795
2015-09-17 14:35 szy Assigned To szy => Vico Liang
2015-09-17 14:35 szy Status new => feedback
2015-09-17 15:09 Vico Liang Note Added: 0045805
2015-09-17 15:10 Vico Liang Assigned To Vico Liang => szy
2015-09-17 15:10 Vico Liang Status feedback => acknowledged
2015-09-29 05:39 Vico Liang Status acknowledged => assigned
2015-09-30 18:36 szy Note Added: 0046345
2015-09-30 18:36 szy Status assigned => closed
2015-09-30 18:36 szy Resolution open => no change required
2015-09-30 18:39 szy Assigned To szy => bugmaster