View Issue Details

IDProjectCategoryView StatusLast Update
0001241DraftBugpublic2013-12-20 21:22
Reporterulrich1a Assigned Toyorik  
Status closedResolutionfixed 
Product Versiontrunk 
Fixed in Version0.14 
Summary0001241: FreeCAD Windows 32 bit crashes at adding Draft Dimension with Fontsize preset in preferences
DescriptionAdding a Draft Dimension works and the fontsize can be changes for each dimension.
But if the fontsize is preset in the Draft-preferences, FreeCAD crashes allways at adding a Draft dimension.
Additional InformationTested with FreeCAD 0.13 stable and FreeCAD Version: 0.14.2497 (Git) on Windows 7 32 bit. It workes for me on Debian 32 bit.
TagsNo tags attached.
FreeCAD Information


parent of 0001242 closedyorik FreeCAD Draft Dimensions due not observe Dimension Precision on FreeCAD Windows 



2013-09-13 15:11

administrator   ~0003570

Hm unfortunately I cannot debug this as I have no windows install.. Indeed on linux there is no crash.

Can you test something for me? In the python console, enter the following lines:

import Draft

And see if it crashes... This would give me a clue to where the problem lies...


2013-09-13 17:28

reporter   ~0003572

I did now a test on my seldrom used Windows XP at home with FreeCAD 0.13 stable.There is no crash with the font setting. The font size setting in the preferences has no effect. To see a number on a dimension, you have to change the font size for each dimesion. It is always 0.00 for a new dimension.
So it may be related to Windows 7.
I will test next week on Windows 7 again. There I have both FreeCAD 0.13 stable and FreeCAD trunk. Are the preferences incompatible between both versions?


2013-09-13 17:39

administrator   ~0003573

The font size used by the dimension is the one from the task bar (switch to "tasks") which normally takes what is in the preferences, once you restart freecad (there is no way to detect a preferences change at the moment). Changing it also changes the preferences if "save current color across sessions" is ticked (I know, should clean that up some day).

All this is not too obvious and should be cleaned up, but more important is to determine in which conditions a crash occurs...


2013-09-17 00:02

reporter   ~0003589

I had my font size preset and was able to add dimensions in Draft Workbench with no crash.
URL for video showing this:

OS: Windows XP
Platform: 32-bit
Version: 0.14.2370 (Git)
Branch: master
Hash: a836759ebd91404954a778ff8885e152611576e1
Python version: 2.6.2
Qt version: 4.5.2
Coin version: 3.1.0
SoQt version: 1.4.1
OCC version: 6.5.1


2013-09-17 12:47

reporter   ~0003593

The problem seems to be related to Windows 7. The same binaries worked well under wine but not under Windows 7. I got a crash at adding a Draft Dimension, after I confirmed the Draft Preferences with ok.
It seems to be related to the font handling in Windows 7.
I installed osifont in Windows and copied it also to another path, where I could see the file in the windows explorer.
I made the following setting in the Draft Preferences:
standard font: "osifont"
Default Shape Font file: "path to copied osifontfile".
I dont know, if the above settings are correct. At least FreeCAD dont crashes anymore. The correct font handling under windows 7 may have to be investigated, by someone with more knowledge about windows 7.

OS: Windows 7
Platform: 32-bit
Version: 0.14.2512 (Git)
Branch: master
Hash: e157152c962fe1fe5340dbe825f31f1e21f9a09a
Python version: 2.6.2
Qt version: 4.5.2
Coin version: 3.1.0
SoQt version: 1.4.1
OCC version: 6.5.1


2013-09-18 06:26

reporter   ~0003594

I did a little bit further investigation. The crash can be avoided be just putting nothing in the standard font setting. Or the better way change the standard font setting from "Arial" to "arial".
Otherwise FreeCAD crashes in Windows 7 with confirmed Draft Preferences after adding a Draft Dimension with
Err: Illegal storage access...Err:


2013-09-18 11:32

administrator   ~0003595

Ah good to know. Indeed on linux putting an invalid font name doesn't cause a crash. Unfortunately fonts management is so complex that there is little chance we can check that from freecad.

Can you try if it crashes when putting "sans" as a font name? That could be a better default value...


2013-09-18 13:13

reporter   ~0003596

I tested "sans" on Windows 7. It does not crash. So "sans" should be also ok.


2013-09-18 13:34

reporter   ~0003597

Something that comes in my mind: I can not be shure, that "sans" is provided by Windows 7 itself, because I have a lot of other software installed. So it works on my system, but it may not work at others.
If you do not mind to install virtual box, than you can download a ready to run virtual-box-image of windows 7 for testing purposes. It allows up to 90 days of testing.
Here is the link:


2013-09-21 12:18

administrator   ~0003606

I tested this on Win7 64-bit but had no crash. I set an arbitrary text as standard font file which then was set to the FontName property.

Two questions:
@ulrich1a: Does it crash for you when you set a non-existing font to FontName of the Dimension object in the property editor?

@Yorik: Qt offers a class which lists the font families:
from PyQt4 import QtGui

Could this be used together with a combo box?


2013-09-21 13:46

administrator   ~0003608

Oh yes, great! Maybe that way we can check if a font exists before applying it... We could also unify how the ShapeString tool works. Since it is not based on coin but on the freetype lib, it needs specifically a .ttf file as input. With this we could unify it all.
Maybe create a specific FontProperty?
I'll play a bit with this to see how best it can be used...

About the "sans" font, it doesn't exist, but normally all systems know what to do with it, it's like a default.


2013-09-21 18:57

reporter   ~0003617

It may be, that I described the crash conditions not clear.

Before starting FreeCAD delete the user.cfg and system.cfg in "c:/users/.../roaming/" just to be shure to have a situation like a fresh install.
I am not sitting at the windows machine. So the correct path have to be figured out.
Start FreeCAD and add a Draft Dimension in the Draft Workbench. This works for me.
Then open the Preferences/Draft. The "Standard Schriftart" should be "Arial" in the tab visual settings. Do nothing else than confirming the preferences with the OK-button.
Add another Draft dimension. I was getting a crash in 2 seconds.

@wmayer: I will test next week.


2013-09-21 19:02

reporter   ~0003618

I forgot to say, the crash happens only with the version of 0.14.2497 (Git) or later. I got the crash with 0.13 stable, because I copied the actual /Mod/Draft folder from 0.14.2497 into the stable version. In later testing a reinstalled 0.13 stable gave no crash.


2013-09-23 06:34

administrator   ~0003629

When FreeCAD crashes it should create a file called crash.dmp in the directory where the user.cfg is (%APPDATA%\FreeCAD). Can you attach this file, please?


2013-09-23 07:01

administrator   ~0003631

OK, I built FreeCAD 32-bit on Windows 7 and I got the crash too now. With the 64-bit version I did not get a crash.

One thing is strange:
For the first Dimension object it shows the correct icon (the <=>). After visiting the preferences dialog the new dimension object changes its icon to the default (the green rectangle with black border). And the stack trace is not too useful but it shows it crashes deep inside Coin:
     [Frames below may be incorrect and/or missing, no symbols loaded for glu32.dll]
> FreeCADGui.dll!5f7d493e()


2013-09-23 08:29

reporter   ~0003634

I tested with a nonsense fontname: It does not crash.
The crash happens also, when in the first Dimension added, the font is changed to "Arial".


2013-09-23 10:37

administrator   ~0003635

I can confirm this. BTW, the crash happens immediately after writing the last character. This means on "Aria" everything is still fine but when writing the "l" it crashes.


2013-09-23 11:32

administrator   ~0003636

There is definitely a problem with that font on that windows version... The fact that "aria" doesn't crash indicates that coin handles correctly not-found fonts.. Can you try with "Times New Roman"? Just to see if it crashes with all fonts or only Arial


2013-09-23 11:53

administrator   ~0003637

Attached are two Inventor file which makes the application crashing. However, with version 0.13 this file can be loaded without problems. As you can see the reduced file doesn't have any FreeCAD-specific Inventor nodes but it crashes with 0.14 and not with 0.13. How can this be?

> Can you try with "Times New Roman"?
This crashes for me, too.

Stack trace:
     [Frames below may be incorrect and/or missing, no symbols loaded for glu32.dll]
> coin2d.dll!cc_flwft_get_vector_glyph(void * font=0x10e10a40, unsigned int glyphindex=21, float complexity=0.50000000) Line 1084 + 0x12 bytes C
     coin2d.dll!cc_flw_get_vector_glyph(int font=0, unsigned int glyph=50) Line 908 + 0x1b bytes C
     coin2d.dll!cc_glyph3d_ref(unsigned int character=50, const cc_font_specification * spec=0x0c6941b8) Line 212 + 0xd bytes C
     coin2d.dll!SoAsciiTextP::setUpGlyphs(SoState * state=0x0c68a1d0, SoAsciiText * textnode=0x0c50b348) Line 841 + 0x10 bytes C++
     coin2d.dll!SoAsciiText::computeBBox(SoAction * action=0x014f98dc, SbBox3f & box={...}, SbVec3f & center={...}) Line 585 C++
     coin2d.dll!SoShape::getBBox(SoAction * action=0x014f98dc, SbBox3f & box={...}, SbVec3f & center={...}) Line 1572 + 0x1e bytes C++

<==== Snip ====>


2013-09-23 12:29

administrator   ~0003638

Last edited: 2013-09-23 12:30

It's definitely strange... Does the Annotation object also crash?
t.LabelText="Sample Text"

That one doesn't use pivy, results might be different...


2013-09-23 13:17

administrator   ~0003639

> Does the Annotation object also crash?
No, because Qt does the rendering into an image and we copy this into an image Inventor node.

> That one doesn't use pivy, results might be different...
The crash has nothing to do with pivy.


2013-09-23 14:16

reporter   ~0003643

I have the osifont installed. It is a valid font, which has in other applications like Wordpad the name "osifont".
In FreeCAD 0.13, changing the fontname in a dimension causes also the number changing its visual appearance. The osifonts numbers are visible in FreeCAD 0.13 dimensions.
In FreeCAD 0.14 using osifont causes no crash, but the appearence of the number does not change. The numbers in the draft view are looking always like a serife number.
I got also FreeCAD 0.13 crashing, when I had copied the /Mod/Draft from FreeCAD trunk folder into the FreeCAD 0.13 installation.


2013-10-11 11:50

administrator   ~0003731

> The numbers in the draft view are looking always like a serife number.
That is because it is using the default internal font, and not your osifont. Probably the name of the font is different from the ttf filename. But since Times New Roman also crashes, I suppose this has nothing to do with the font itself, but with the coin3D handling of it.

Anyway, I just changed the default in Draft to use the internal font instead of Arial, that should already prevent users from experiencing a crash first hand...


2013-11-04 13:33


0001241.iv (4,392 bytes)


2013-11-04 13:33


0001241_minimum.iv (441 bytes)


2013-12-20 21:22

administrator   ~0003957

Since this is no more producing crashes, I'll close it. Please reopen if new information is available.

Issue History

Date Modified Username Field Change
2013-09-13 10:47 ulrich1a New Issue
2013-09-13 15:11 yorik Note Added: 0003570
2013-09-13 15:11 yorik Status new => assigned
2013-09-13 15:11 yorik Assigned To => yorik
2013-09-13 17:28 ulrich1a Note Added: 0003572
2013-09-13 17:39 yorik Note Added: 0003573
2013-09-17 00:02 bejant Note Added: 0003589
2013-09-17 01:35 yorik Status assigned => feedback
2013-09-17 12:47 ulrich1a Note Added: 0003593
2013-09-18 06:26 ulrich1a Note Added: 0003594
2013-09-18 11:32 yorik Note Added: 0003595
2013-09-18 13:13 ulrich1a Note Added: 0003596
2013-09-18 13:34 ulrich1a Note Added: 0003597
2013-09-21 12:18 wmayer Note Added: 0003606
2013-09-21 13:46 yorik Note Added: 0003608
2013-09-21 18:57 ulrich1a Note Added: 0003617
2013-09-21 19:02 ulrich1a Note Added: 0003618
2013-09-23 06:34 wmayer Note Added: 0003629
2013-09-23 07:01 wmayer Note Added: 0003631
2013-09-23 08:29 ulrich1a Note Added: 0003634
2013-09-23 10:37 wmayer Note Added: 0003635
2013-09-23 11:19 wmayer File Added: 0001241.iv
2013-09-23 11:32 yorik Note Added: 0003636
2013-09-23 11:46 wmayer File Added: 0001241_minimum.iv
2013-09-23 11:53 wmayer Note Added: 0003637
2013-09-23 12:29 yorik Note Added: 0003638
2013-09-23 12:30 yorik Note Edited: 0003638
2013-09-23 13:17 wmayer Note Added: 0003639
2013-09-23 14:16 ulrich1a Note Added: 0003643
2013-10-11 11:50 yorik Note Added: 0003731
2013-11-04 13:33 yorik File Deleted: 0001241.iv
2013-11-04 13:33 yorik File Deleted: 0001241_minimum.iv
2013-11-04 13:33 yorik File Added: 0001241.iv
2013-11-04 13:33 yorik File Added: 0001241_minimum.iv
2013-11-10 19:21 yorik Relationship added parent of 0001242
2013-11-20 19:18 yorik Project FreeCAD => Draft
2013-12-20 21:22 yorik Note Added: 0003957
2013-12-20 21:22 yorik Status feedback => closed
2013-12-20 21:22 yorik Resolution open => fixed
2013-12-20 21:22 yorik Fixed in Version => 0.14