Crash on angular dimensions tool

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Crash on angular dimensions tool

Post by ulrich1a »

yorik wrote:@ulrich it seems your version of pivy doesn't take utf8 strings, although it claims to be coin4.
Can you try this in the python console?
It gives

Code: Select all

>>> from pivy import coin
>>> print coin.COIN_VERSION
4.0.0a
Ulrich
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: Crash on angular dimensions tool

Post by rockn »

Some informations :
The error of ulrich1a is the same as mine at the begining (see post #8).
Now I have added some .encodeUtf8 in Draft.py.

I have added a lot of print in Draft.py, I can't find where the message is generated.

I have installed freecad of the stable ppa and I've got the same error as post #8 and ulrich1a report.
I've got some strange bug with Dimension.

Code: Select all

jo@jo-desktop-trusty:~$ freecad
FreeCAD 0.14, Libs: 0.14R3692 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2011
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Draft workbench activated
Indiquez le centre :
Indiquez le rayon :
Indiquez le premier point :
Coin info in cc_string_utf8_get_char(): UTF-8 decoding of string "76.48 �m" failed.

To disable UTF-8 support and fall back to preCoin 4.0 behavior, set the
environment variable COIN_DISABLE_UTF8=1 and re-run the application.

freecad: SoAsciiText.cpp:870: void SoAsciiTextP::setUpGlyphs(SoState*, SoAsciiText*): Assertion `length' failed.
Abandon (core dumped)
It was a little dimension strictly < 0.1 mm.
Set the variable environment like it is saying cause a crash too.

Is there a link ? Is it a coin problem ?
Formations - Assistance - Développement : https://freecad-france.com
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Crash on angular dimensions tool

Post by shoogen »

rockn wrote:

Code: Select all

Coin info in cc_string_utf8_get_char(): UTF-8 decoding of string "76.48 �m" failed.
It was a little dimension strictly < 0.1 mm.
latin1 µ (\xb5) differs form utf8 µ (\xc2\xb5) and a singular \xb5 is not valid utf8.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Crash on angular dimensions tool

Post by yorik »

Yes the PPA lacks the fix we began to discuss here. I was waiting until we fix everything to commit, but I will already commit what is fixed so far...

Now normally everything should be converted correctly to utf8 and the µ (\xc2\xb5) error above should disappear.
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Crash on angular dimensions tool

Post by ulrich1a »

The angular dimension is now working for me. But it seems, it needs a little bit of optimization. :)

Ulrich

OS: Debian GNU/Linux testing (jessie)
Word size: 64-bit
Version: 0.14.3700 (Git)
Branch: master
Hash: db84a39bc05ac3c566482b83848351ec047255e3
Python version: 2.7.7
Qt version: 4.8.6
Coin version: 4.0.0a
SoQt version: 1.6.0a
OCC version: 6.7.1
Attachments
angular_dimension.png
angular_dimension.png (9.85 KiB) Viewed 4499 times
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Crash on angular dimensions tool

Post by yorik »

ok that's another matter... first I'd like to have it working for everybody...
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: Crash on angular dimensions tool

Post by rockn »

Oh yeah, well done Yorik the angular dimension is working for me too !
I'm still having this with little dimension line.

Code: Select all

Indiquez le premier point :
Traceback (most recent call last):
  File "/home/jo/Logiciels/FreeCAD/free-cad-code/build/Mod/Draft/Draft.py", line 3217, in updateData
    self.string = DraftGui.displayExternal(l,obj.ViewObject.Decimals,'Length',su).encode("utf8")
<type 'exceptions.UnicodeDecodeError'>: 'ascii' codec can't decode byte 0xb5 in position 6: ordinal not in range(128)
Traceback (most recent call last):
  File "/home/jo/Logiciels/FreeCAD/free-cad-code/build/Mod/Draft/Draft.py", line 3217, in updateData
    self.string = DraftGui.displayExternal(l,obj.ViewObject.Decimals,'Length',su).encode("utf8")
<type 'exceptions.UnicodeDecodeError'>: 'ascii' codec can't decode byte 0xb5 in position 6: ordinal not in range(128)
Traceback (most recent call last):
  File "/home/jo/Logiciels/FreeCAD/free-cad-code/build/Mod/Draft/Draft.py", line 3217, in updateData
    self.string = DraftGui.displayExternal(l,obj.ViewObject.Decimals,'Length',su).encode("utf8")
<type 'exceptions.UnicodeDecodeError'>: 'ascii' codec can't decode byte 0xb5 in position 6: ordinal not in range(128)
Traceback (most recent call last):
  File "/home/jo/Logiciels/FreeCAD/free-cad-code/build/Mod/Draft/Draft.py", line 3217, in updateData
    self.string = DraftGui.displayExternal(l,obj.ViewObject.Decimals,'Length',su).encode("utf8")
<type 'exceptions.UnicodeDecodeError'>: 'ascii' codec can't decode byte 0xb5 in position 6: ordinal not in range(128)
Traceback (most recent call last):
  File "/home/jo/Logiciels/FreeCAD/free-cad-code/build/Mod/Draft/Draft.py", line 3217, in updateData
    self.string = DraftGui.displayExternal(l,obj.ViewObject.Decimals,'Length',su).encode("utf8")
<type 'exceptions.UnicodeDecodeError'>: 'ascii' codec can't decode byte 0xb5 in position 6: ordinal not in range(128)
Formations - Assistance - Développement : https://freecad-france.com
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Crash on angular dimensions tool

Post by yorik »

Ok then I suppose we need to do this:

Code: Select all

self.string = DraftGui.displayExternal(l,obj.ViewObject.Decimals,'Length',su).decode("latin1").encode("utf8")
I'm committing that right now ( git commit cbcbba2 ), please test if all works ok now?
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: Crash on angular dimensions tool

Post by rockn »

Yeah it's ok ! :D
Formations - Assistance - Développement : https://freecad-france.com
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Crash on angular dimensions tool

Post by yorik »

Great! Thanks for testing! I'll commit this to the release014 branch too.
Post Reply