[Fixed] Bug: Sketcher makes FreeCAD crash as soon as a tool is selected

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Bug: Sketcher makes FreeCAD crash as soon as a tool is selected

Post by jmaustpc »

binitri wrote: Tue Nov 21, 2017 10:46 pm Same issue on ubuntu from upgrade of november 20.
I deleted your duplicate post, if I missed something please post again.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Bug: Sketcher makes FreeCAD crash as soon as a tool is selected

Post by looo »

I can confirm the problem ubuntu17.04/16.04 12624. Testing the latest commits it seems to be related to this commit: https://github.com/FreeCAD/FreeCAD/comm ... a114ce9213
wmayer
Founder
Posts: 20302
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Bug: Sketcher makes FreeCAD crash as soon as a tool is selected

Post by wmayer »

Is the crash random or does it happen all the time?
sebste
Posts: 25
Joined: Tue Sep 01, 2015 9:23 am

Re: Bug: Sketcher makes FreeCAD crash as soon as a tool is selected

Post by sebste »

Happens every time you click one of the tools in sketcher.
wmayer
Founder
Posts: 20302
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Bug: Sketcher makes FreeCAD crash as soon as a tool is selected

Post by wmayer »

I get no crash at all, neither on Windows nor on Ubuntu 14.04 nor on Ubuntu 16.04.
But if someone could test if replacing the line

Code: Select all

static char cursor_crosshair_color[11];
with

Code: Select all

static char cursor_crosshair_color[12];
fixes it.

If not then it should be also checked if replacing

Code: Select all

unsigned long color = 0xFFFFFFFF; // white
with

Code: Select all

unsigned int color = 0xFFFFFFFF; // white
fixes it.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Bug: Sketcher makes FreeCAD crash as soon as a tool is selected

Post by looo »

wmayer wrote:

Code: Select all

static char cursor_crosshair_color[12];
solves the problem.
wmayer
Founder
Posts: 20302
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Bug: Sketcher makes FreeCAD crash as soon as a tool is selected

Post by wmayer »

OK, the problem then is that the buffer is too short to add the null-termination character at the end.
wmayer
Founder
Posts: 20302
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Bug: Sketcher makes FreeCAD crash as soon as a tool is selected

Post by wmayer »

According to looo (thanks for testing!) this should fix the crash: git commit 399dca7
Post Reply