View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001776 | FreeCAD | Bug | public | 2014-10-04 18:34 | 2015-01-25 11:49 |
Reporter | more11 | Assigned To | wmayer | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Dell XPS | OS | Windows 7 | OS Version | 64 bit |
Product Version | 0.14 | ||||
Summary | 0001776: Illegal character when opening project | ||||
Description | Fatal Error at file C:/Users/more10.HOLISTICODE/Horn/2227 midbashorn/midbashorn.FCStd, line 171, char 49 Invalid Document.xml: invalid character 0x19 in attribute value 'name' Fatal Error at file GuiDocument.xml, line 8029, char 27 Reading failed from embedded file: GuiDocument.xml (363937 bytes, 10240 bytes compressed) | ||||
Steps To Reproduce | Open file | ||||
Additional Information | Download file from https://dl.dropboxusercontent.com/u/106944188/FreeCAD/invalid%20character/midbashorn.FCStd OS: Windows 7 Word size: 64-bit Version: 0.14.3700 (Git) Branch: releases/FreeCAD-0-14 Hash: 32f5aae0a64333ec8d5d160dbc46e690510c8fe1 Python version: 2.7.6 Qt version: 4.8.5 Coin version: 4.0.0a SoQt version: 1.6.0a OCC version: 6.6.0 | ||||
Tags | No tags attached. | ||||
FreeCAD Information | |||||
|
Both lines referred to in the error message contain a non-ascii character. |
|
Well these non ascii characters where entered through FreeCAD. I have not edited the file in any other program. |
|
|
|
|
|
I am attaching screenshots of the offending lines. The line in the middle contains the error in both shots. If FreeCAD has generated these, there is most definitely is a bug. |
|
Can you figure out what utf-8 characters these represents? |
|
the name is 2f 09 38 19 0x19 is a ascii character |
|
It is really strange that an object name contains non-ascii characters... This should normally never happen, and the name of an object is normally not editable directly by the user. Can you describe what you did to obtain that? Do you use FreeCAD in another language? |
|
English Windows. Swedish keyboard, åäö. Swedish locale. |
|
I did change the name of some objects, but since the error appears when reading back the project file, I have no idea when these characters where introduced. |
|
The name can only be set when adding an object. AFAIK there is no way to alter it afterwards. |
|
My guess is that at creation time, the name of the App::MeasureDistance object is taken from the translation (which must, in swedish, contain non-ascii chars). Normally that name must go through a cleaning function that removes all non-ascii chars from the name, I suppose this object is missing the call to that function. I'll have a look at that |
|
Hm no.. the creation of a new object is in Gui/ViewProviderMeasureDistance.cpp at line 275... It doesn't even translate the name. Really I don't know how this happened! more11 can you reproduce this in a new file? |
|
Can you add an assert when the name is assigned? Then you will catch this the next time someone creates a bad name. |
|
Could also be a memory bug. |
|
asserts are useless. If you don't run FreeCAD with a debuger the program will stop and the document will be lost. we should use conditional breakpoints. |
|
The document will be lost anyways. Catch the error and prompt the user with a stack trace or whatever. |
|
My opinion is that we should close this, because there is no way to reproduce the problem. \Neither via the GUI nor via python scripting, I'm able to create an object with non-ascii characters in the object name. So I don't see what/where something should be fixed. I'm afraid I can't do anything about it... |
|
Since FreeCAD doesn't crash but raises an exception I downgrade the severity to 'major'. When looking at the code what might be the reason then this line looks cruel: pcObject->pcNameInDocument = &(d->objectMap.find(ObjectName)->first); The DocumentObject doesn't have a std::string with its name but a pointer to the std::map of the document. So, the problem of the above line is that if in any case we have two objects with the same internal name two things happen: * the std::map loses one DocumentObject and its 'pcNameInDocument' may point to an invalid memory block. This might explain the strange name of the above example. * the std::vector doesn't lose the first object so that there is an inconsistency Here is a Python example that shows the problem: App.ActiveDocument.openTransaction("Box") b1=App.ActiveDocument.addObject("Part::Box","Box") App.ActiveDocument.commitTransaction() b1.Name App.ActiveDocument.undo() b1.Name b2=App.ActiveDocument.addObject("Part::Box","Box") b2.Name App.ActiveDocument.redo() b2.Name b1.Name The culprit is the method Document::_addObject because it doesn't check whether in the meantime a new object has been added with the same name. However, currently I can't see how this scenario can be achieved with pure GUI user interactions. |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-10-04 18:34 | more11 | New Issue | |
2014-10-04 20:41 | quick61 | Note Added: 0005181 | |
2014-10-04 21:39 | more11 | Note Added: 0005182 | |
2014-10-04 22:21 | quick61 | File Added: DocXML.png | |
2014-10-04 22:22 | quick61 | File Added: GuiDocXML.png | |
2014-10-04 22:24 | quick61 | Note Added: 0005183 | |
2014-10-04 23:43 | more11 | Note Added: 0005184 | |
2014-10-05 11:24 | shoogen | Note Added: 0005185 | |
2014-10-05 16:13 | yorik | Note Added: 0005186 | |
2014-10-05 16:14 | yorik | Assigned To | => yorik |
2014-10-05 16:14 | yorik | Status | new => feedback |
2014-10-05 18:55 | more11 | Note Added: 0005187 | |
2014-10-05 18:55 | more11 | Status | feedback => assigned |
2014-10-05 18:56 | more11 | Note Added: 0005188 | |
2014-10-05 19:26 | shoogen | Note Added: 0005189 | |
2014-10-05 19:48 | yorik | Note Added: 0005190 | |
2014-10-05 19:51 | yorik | Note Added: 0005191 | |
2014-10-05 19:53 | yorik | Note Edited: 0005191 | |
2014-10-05 19:53 | yorik | Status | assigned => feedback |
2014-10-05 22:50 | more11 | Note Added: 0005192 | |
2014-10-05 22:50 | more11 | Status | feedback => assigned |
2014-10-05 22:51 | more11 | Note Added: 0005193 | |
2014-10-06 18:03 | shoogen | Note Added: 0005196 | |
2014-10-06 18:09 | more11 | Note Added: 0005197 | |
2015-01-19 17:16 | yorik | Note Added: 0005675 | |
2015-01-19 17:16 | yorik | Assigned To | yorik => |
2015-01-19 17:16 | yorik | Status | assigned => new |
2015-01-24 18:45 | wmayer | Note Added: 0005715 | |
2015-01-24 18:45 | wmayer | Severity | block => major |
2015-01-24 18:45 | wmayer | Note Edited: 0005715 | |
2015-01-25 11:49 | wmayer | Changeset attached | => FreeCAD Master master 2cff92a7 |
2015-01-25 11:49 | wmayer | Assigned To | => wmayer |
2015-01-25 11:49 | wmayer | Status | new => closed |
2015-01-25 11:49 | wmayer | Resolution | open => fixed |