Crash on angular dimensions tool

A forum dedicated to the Draft, Arch and BIM workbenches development.
ulrich1a
Posts: 1872
Joined: Sun Jul 07, 2013 12:08 pm

Re: Crash on angular dimensions tool

Postby ulrich1a » Thu Jul 10, 2014 9:32 pm

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
Posts: 1509
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: Crash on angular dimensions tool

Postby rockn » Thu Jul 10, 2014 11:12 pm

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 et tutoriels FreeCAD en Français, soutenez moi : https://www.tipeee.com/formations-freecad
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Crash on angular dimensions tool

Postby shoogen » Thu Jul 10, 2014 11:21 pm

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
Site Admin
Posts: 10857
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Crash on angular dimensions tool

Postby yorik » Fri Jul 11, 2014 3:01 pm

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
Posts: 1872
Joined: Sun Jul 07, 2013 12:08 pm

Re: Crash on angular dimensions tool

Postby ulrich1a » Fri Jul 11, 2014 5:42 pm

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 2341 times
User avatar
yorik
Site Admin
Posts: 10857
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Crash on angular dimensions tool

Postby yorik » Fri Jul 11, 2014 5:55 pm

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

Re: Crash on angular dimensions tool

Postby rockn » Fri Jul 11, 2014 7:28 pm

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 et tutoriels FreeCAD en Français, soutenez moi : https://www.tipeee.com/formations-freecad
User avatar
yorik
Site Admin
Posts: 10857
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Crash on angular dimensions tool

Postby yorik » Fri Jul 11, 2014 8:44 pm

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
Posts: 1509
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: Crash on angular dimensions tool

Postby rockn » Fri Jul 11, 2014 9:01 pm

Yeah it's ok ! :D
Formations et tutoriels FreeCAD en Français, soutenez moi : https://www.tipeee.com/formations-freecad
User avatar
yorik
Site Admin
Posts: 10857
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Crash on angular dimensions tool

Postby yorik » Fri Jul 11, 2014 9:08 pm

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