OS: Linux Mint 18.3 Sylvia
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.13959 (Git) AppImage
Build type: None
Branch: master
Hash: 2f18182b6dff87f8857787c854e39ca4d441f993
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedKingdom (en_GB)
I have a model, attached, which shows a pop up error box when I load it saying "Cannot get value from invalid enumeration". Nothing seems to be flagged as an error, how can I find out what is wrong?
Cannot get value from invalid enumeration
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 78
- Joined: Fri May 11, 2018 9:28 am
Cannot get value from invalid enumeration
- Attachments
-
- HoleTest4.fcstd
- (35.61 KiB) Downloaded 26 times
Re: Cannot get value from invalid enumeration
That error has been popping up erverywhere. I tracked it back to a commit but don't know what it is for
any insights? Is there something Path is doing that causes this message?wmayer wrote:ping
- sliptonic
- Veteran
- Posts: 3460
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Cannot get value from invalid enumeration
I'm seeing this too and very predictably. It occurs whenever I add a job, even if there are no operations in the job. Save and reload causes the error.
I'm not sure how to debug this one.
I'm not sure how to debug this one.
Re: Cannot get value from invalid enumeration
Please check if it still happens with the latest master.
The problem with the old implementation of PropertyEnumeration::getValueAsString was that in case of an invalid enumeration value (e.g. the index is out of range) a null pointer is returned which in most cases the calling instance doesn't check and assign it to a std::string. However, assigning a null pointer to a std::string is invalid and raises a segfault.
To avoid to change all places where getValueAsString is used without further checks and to avoid future problems the method now raises an exception.
Now there was (at least) one place where the exception wasn't handled and caused the document load to not finish properly. This should be fixed now with: git commit 9faa7fc5
The problem with the old implementation of PropertyEnumeration::getValueAsString was that in case of an invalid enumeration value (e.g. the index is out of range) a null pointer is returned which in most cases the calling instance doesn't check and assign it to a std::string. However, assigning a null pointer to a std::string is invalid and raises a segfault.
To avoid to change all places where getValueAsString is used without further checks and to avoid future problems the method now raises an exception.
Now there was (at least) one place where the exception wasn't handled and caused the document load to not finish properly. This should be fixed now with: git commit 9faa7fc5
- sliptonic
- Veteran
- Posts: 3460
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Cannot get value from invalid enumeration
I think that's got it.
I still see "Enumeration index -1 is out of range, ignore it" in the report view but not the error.
I still see "Enumeration index -1 is out of range, ignore it" in the report view but not the error.