Writing a bug report, other platform testing ...

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
freedman
Posts: 337
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Writing a bug report, other platform testing ...

Postby freedman » Sun Sep 16, 2018 3:31 pm

The bug is essentially a problem with the Tree and Body control with the "Display properties" window open. Could we verify in other platforms?

Very simple to test:
Create a new file and a Body.
Right-click the Body in the tree and select Appearance, the "Display properties " opens, keep that window open.
Select Body in the tree and rename it.

That's where the problems starts on my Windows machine. When I hit Enter the Body text field does not close correctly, properties don't show, many different screen things don't work correctly.

I presume the programmers expect the Display properties window to be closed but there are no interlocks to guarantee.

Thanks

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14709 (Git)
Build type: Release
Branch: master
Hash: faad5ea27301cb7af393a25d317c406d3098bafe
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)
Last edited by freedman on Sun Sep 16, 2018 3:59 pm, edited 1 time in total.
Jee-Bee
Posts: 1214
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Writing a bug report, other platform testing ...

Postby Jee-Bee » Sun Sep 16, 2018 3:52 pm

At least post your version info!!
freedman
Posts: 337
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Writing a bug report, other platform testing ...

Postby freedman » Sun Sep 16, 2018 4:27 pm

Thanks Jee-Bee
GeneFC
Posts: 638
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Writing a bug report, other platform testing ...

Postby GeneFC » Sun Sep 16, 2018 4:28 pm

This happens in lots of situations. Did you watch Sliptonic's video on annoyances?

Not sure it is a bug in terms of function. May be a "bug" in terms of lack of notification to the user to close the active task before trying to do something else.

Gene
freedman
Posts: 337
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Writing a bug report, other platform testing ...

Postby freedman » Sun Sep 16, 2018 4:49 pm

Did you watch Sliptonic's video on annoyances?
I did watch it. I don't consider this just a nuisance issue, this essentially crashes the program because Bodies can't be named or renamed.
User avatar
NormandC
Posts: 16569
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Writing a bug report, other platform testing ...

Postby NormandC » Sun Sep 16, 2018 5:12 pm

It would be useful if you could create a screencast... Writing "many different screen things don't work correctly" is not helpful at all.

freedman wrote:
Sun Sep 16, 2018 3:31 pm
Create a new file and a Body.
Right-click the Body in the tree and select Appearance, the "Display properties " opens, keep that window open.
Select Body in the tree and rename it.
The first time I create a new document and follow these steps, with the Appearance window open, I can type a new name for the Body, but when I hit Enter, the text is kept but the field remains active, and the Report view reports
Unhandled std::exception caught in GUIApplication::notify.
The error message is: basic_string::_M_construct null not valid
Once I close the Appearance window, the new name is kept, and I don't lose any functionality.

But, trying to repeat those steps again in the same document, hitting Enter now discards the new name. After I close the Appearance window, I can no longer rename the Body, but its View and Data properties remain visible, and FreeCAD seems to otherwise behave normally.

OS: Ubuntu 18.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14727 (Git)
Build type: Release
Branch: master
Hash: c6df59969bfb3ae2027e2b47ddd559852f6e9a4e
Python version: 2.7.15rc1
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/Canada (fr_CA)
freedman
Posts: 337
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Writing a bug report, other platform testing ...

Postby freedman » Sun Sep 16, 2018 6:25 pm

But, trying to repeat those steps again in the same document, hitting Enter now discards the new name. After I close the Appearance window, I can no longer rename the Body, but its View and Data properties remain visible, and FreeCAD seems to otherwise behave normally.
If an additional Body is created it can't be renamed at all once the issue of mention occurs. Properties view may be working correctly.
It would be useful if you could create a screencast... Writing "many different screen things don't work correctly" is not helpful at all.
I never know how much response I will get so I get cryptic, I forgot this will be linked to any tracker report. I will try to be more specific. Not in a place where I can do a screencast.

Also, once the program gets in this error mode, renaming a Body is not allowed after closing all files (not the program) and opening a new file.
TheMarkster
Posts: 421
Joined: Thu Apr 05, 2018 1:53 am

Re: Writing a bug report, other platform testing ...

Postby TheMarkster » Wed Sep 19, 2018 3:13 am

https://github.com/FreeCAD/FreeCAD/pull/1681

Edit: The exception is being thrown when a string is attempted to be initialized with 0. This 0 is being returned by a method used to get the name of the property that was changed (in this case, the property being the label of the tree object). The workaround is to check the return value of the method against 0, and if it's 0, we log the error, and exit the dialog. I'm not sure if closing it was absolutely necessary, but I figured it couldn't hurt.

Code: Select all

    if (vp != Provider.end()) {
       //original code:  std::string prop_name = obj.getPropertyName(&prop);
        std::string prop_name;
        if (obj.getPropertyName(&prop)!=0){
            prop_name = obj.getPropertyName(&prop);
        } else {
            Base::Console().Error("DlgDisplayPropertiesImp::slotChangedObject(): Error: obj.getPropertyName() failed.\n");
            this->reject(); //close the window
            return;
        }
wmayer
Site Admin
Posts: 13090
Joined: Thu Feb 19, 2009 10:32 am

Re: Writing a bug report, other platform testing ...

Postby wmayer » Wed Sep 19, 2018 7:24 pm

The crash is caused by assigning a nullptr to a std::string which causes a segfault on Windows but apparently raises an exception on Linux. All what needs to be done to fix this issue is assigning the returned value to a const char* which can be checked before continuing. If it's null nothing further needs be done (especially closing the dialog is not needed).
freedman
Posts: 337
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Writing a bug report, other platform testing ...

Postby freedman » Sat Sep 22, 2018 6:11 pm

I can leave the Display properties window open and no problem renaming Bodies. Fixed.
Thank you.

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14786 (Git)
Build type: Release
Branch: master
Hash: 75acfe898f97d213647b0b93032287e48a31abfe
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)