Involute Gear... crashes FreeCAD 0.16 pre on Mac OS X

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
blacey
Posts: 370
Joined: Tue Dec 08, 2015 11:28 pm

Involute Gear... crashes FreeCAD 0.16 pre on Mac OS X

Postby blacey » Tue Dec 08, 2015 11:36 pm

I am very new to FreeCAD and am currently exploring it because I need a bit more precision in my 3D parts than what 123D Design offers... A key impetus for exploring FreeCAD is to create custom gears however when I launch the "involute gear..." widget under 0.16, it suddenly crashes without a crash log, simply a message in syslog that says:

Code: Select all

12/8/15 3:31:23.057 PM com.apple.xpc.launchd[1]: (com.apple.xpc.launchd.oneshot.0x1000000f.FreeCAD[1467]) Service exited with abnormal code: 1
I am running FreeCAD version:

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6010 (Git)
Build type: Unknown
Branch: master
Hash: fd191b802ecd5cef3439683b015189dac9ffce88
Python version: 2.7.10
Qt version: 4.8.7
Coin version: 3.1.3

From
brusk wrote:Ok, I've uploaded a build here: https://github.com/tiktuk/FreeCAD/relea ... _pre_r6010 :) . I just downgraded to the latest compatible Matplotlib version (1.4.3).
Thanks a ton to @brusk for making a recent 0.16 pre build available.

I regressed this under 0.15 and it works fine.

Thoughts?
User avatar
DeepSOIC
Posts: 7600
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Involute Gear... crashes FreeCAD 0.16 pre on Mac OS X

Postby DeepSOIC » Wed Dec 09, 2015 10:42 am

Hi!
No idea, just a random thought. Try dropping in a Part Cube, before creating the gear...
blacey
Posts: 370
Joined: Tue Dec 08, 2015 11:28 pm

Re: Involute Gear... crashes FreeCAD 0.16 pre on Mac OS X

Postby blacey » Wed Dec 09, 2015 4:08 pm

DeepSOIC wrote:Hi!
No idea, just a random thought. Try dropping in a Part Cube, before creating the gear...
Just tried the suggested work-around but to no avail.

On Mac OS X, the system will catch the crash log for a crashing process however FreeBSD is crashing in such a catastrophic fashion that the log isn't available. Is there any additional FreeBSD logging that I can check or enable to try to provide additional information?
blacey
Posts: 370
Joined: Tue Dec 08, 2015 11:28 pm

Re: Involute Gear... crashes FreeCAD 0.16 pre on Mac OS X

Postby blacey » Wed Dec 09, 2015 6:04 pm

Searching the web, I found resources on running Unit Tests and logging. I ran "All Tests" with --write-log and the following was reported in FreeCAD.log and stdout accordingly:

Code: Select all

Log: Active view is Unnamed : 1[*] (at 0x7feca3b2b860)
Log: Active document is DraftTest (at 0x7fecc1b7ca00)
Log: Checking Draft Arc...
Log: Sel : Clear selection
Log: Sel : Add Selection "DraftTest.Arc.(null)(0.000000,0.000000,0.000000)"
Log: Sel : Clear selection
Log: No active document
Log: Active view is Unnamed : 1[*] (at 0x7fecc23fa240)
Log: Active document is DraftTest (at 0x7fecc1373000)
Log: Checking Draft BSpline...
Log: Sel : Clear selection
Log: Sel : Add Selection "DraftTest.BSpline.(null)(0.000000,0.000000,0.000000)"
Err: *** Abort *** an exception was raised, but no catch was found.Err:
Err: 	... The exception is:Err: SIGSEGV 'segmentation violation' detected. Address 0Err:

Code: Select all

... destroy sphere
Coin warning in cc_glglue_instance(): Error when setting up the GL context. This can happen if there is no current context, or if the context has been set up incorrectly.
Coin warning in cc_glglue_instance(): Error when setting up the GL context. This can happen if there is no current context, or if the context has been set up incorrectly.
Coin warning in cc_glglue_instance(): Error when setting up the GL context. This can happen if there is no current context, or if the context has been set up incorrectly.
Coin warning in cc_glglue_instance(): Error when setting up the GL context. This can happen if there is no current context, or if the context has been set up incorrectly.
Coin warning in cc_glglue_instance(): Error when setting up the GL context. This can happen if there is no current context, or if the context has been set up incorrectly.
Coin warning in cc_glglue_instance(): Error when setting up the GL context. This can happen if there is no current context, or if the context has been set up incorrectly.
Coin warning in cc_glglue_instance(): Error when setting up the GL context. This can happen if there is no current context, or if the context has been set up incorrectly.
Coin warning in cc_glglue_instance(): Error when setting up the GL context. This can happen if there is no current context, or if the context has been set up incorrectly.
*** Abort *** an exception was raised, but no catch was found.
	... The exception is:SIGSEGV 'segmentation violation' detected. Address 0
This is the unit test that fails, specifically on the Draft.makeBSpline() call...

Code: Select all

def testBSpline(self):
        FreeCAD.Console.PrintLog ('Checking Draft BSpline...\n')
        Draft.makeBSpline([FreeCAD.Vector(0,0,0),FreeCAD.Vector(2,0,0),FreeCAD.Vector(2,2,0)])
        self.failUnless(FreeCAD.ActiveDocument.getObject("BSpline"),"Draft BSpline failed")
In fact, if I try to create a BSpline curve using the GUI, FreeCAD will crash as well.

While this is clearly a bug, it seems like a Red Herring for the original problem so I am curious, which unit tests apply to the involute curve part instantiation?
User avatar
sgrogan
Posts: 5798
Joined: Wed Oct 22, 2014 5:02 pm

Re: Involute Gear... crashes FreeCAD 0.16 pre on Mac OS X

Postby sgrogan » Wed Dec 09, 2015 6:18 pm

blacey wrote:so I am curious, which unit tests apply to the involute curve part instantiation
I don't think we have a unit test for this.
Also see here:viewtopic.php?f=9&p=107833#p107533
Can you also try with the build from github?
These problems may be specific to this build.
User avatar
DeepSOIC
Posts: 7600
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Involute Gear... crashes FreeCAD 0.16 pre on Mac OS X

Postby DeepSOIC » Wed Dec 09, 2015 6:42 pm

BTW, involute isn't directly supported in FreeCAD. Involutes in involute gear are approximated by two beziers (interestingly, not by a single B-spline. I wonder, why are they not joined into a bspline?).
involute-probing.png
numbers in 3d view show selection order
involute-probing.png (118.39 KiB) Viewed 1563 times
blacey
Posts: 370
Joined: Tue Dec 08, 2015 11:28 pm

Re: Involute Gear... crashes FreeCAD 0.16 pre on Mac OS X

Postby blacey » Wed Dec 09, 2015 9:33 pm

sgrogan wrote:
blacey wrote:so I am curious, which unit tests apply to the involute curve part instantiation
Can you also try with the build from github?
These problems may be specific to this build.
Yes, the github build is the version that I used in reporting the issue above so it is quite possible that the issue is specific to this build. Will probably opt to install FreeCAD into an Ubuntu VM to regress the issue and ideally make progress until the Mac OS X builds are shaken out a bit more... The other option is to build the gears I need in OpenSCAD and pull them into FreeCAD but I prefer to invest in a single CAD solution now, that being FreeCAD. ;)

Who is the official Mac OS X build keeper? Peterl or brusk?
User avatar
sgrogan
Posts: 5798
Joined: Wed Oct 22, 2014 5:02 pm

Re: Involute Gear... crashes FreeCAD 0.16 pre on Mac OS X

Postby sgrogan » Wed Dec 09, 2015 9:41 pm

Sorry to not be clear. :oops: I meant this githubhttps://github.com/FreeCAD/FreeCAD/rele ... g/0.16-pre
Peterl94 has been doing the builds, but he is very busy and brusk has expressed an interest in providing snapshot builds more frequently. The one you are using is his first.
Thank-you for using and testing it. This will help speed Mac support improvements.
blacey
Posts: 370
Joined: Tue Dec 08, 2015 11:28 pm

Re: Involute Gear... crashes FreeCAD 0.16 pre on Mac OS X

Postby blacey » Wed Dec 09, 2015 10:59 pm

I'm new to FreeCAD so I didn't realize there were two github locations. I downloaded and tested peterl94's github build and it works so that confirms that the issue is specific to brusk's build process or change sets between r4945 and r6010.

Code: Select all

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.4945 (Git)
Build type: Release
Branch: master
Hash: 6cd9220079a1efb1a2f33842fa614521a31bf0d5
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
All self tests pass on Mac OS X 10.11.2 (release by Apple yesterday) including the BSpline unit test that failed in @brusk's r6010 build.

Code: Select all

Log: Checking Draft BSpline...
Log: Sel : Clear selection
Log: Sel : Add Selection "DraftTest.BSpline.(null)(0.000000,0.000000,0.000000)"
Log: Sel : Clear selection
Log: No active document
Is the plan that brusk will fold his builds into peterl's TravisCI system? Just trying to understand the MacOS pre-release build trajectory because it seems that many of the resources and tutorials rely upon the latest and greatest 0.16-pre builds. Now to try a build some gears... ;)
User avatar
sgrogan
Posts: 5798
Joined: Wed Oct 22, 2014 5:02 pm

Re: Involute Gear... crashes FreeCAD 0.16 pre on Mac OS X

Postby sgrogan » Wed Dec 09, 2015 11:21 pm

Again, sorry for the confusion.
Right now the FreeCAD page is the place for "official" dev-snapshots. That's why the mac build is older than the win build. brusk's process is not proven yet.
At present brusk is trying to perfect his build process to provide manually compiled snap-shots that when proven reliable will be posted on the "official" site. In parallel peterl94 has begun to experiment with Travis-CI's deploy functionality to automate the process. As mentioned before peterl94 is very busy, so this might take quite some time.
For proven functionality, by all means, install ubuntu on a VM and use the PPA. But please continue to use and test the mac builds. Most of us don't have access to OS X so your contribution is invaluable.
@brusk
Please don't be discouraged by this. We will get there.
"FreeCAD is multiplatfom (Windows, Mac and Linux), and reads and writes many open file formats such as STEP, IGES, STL, SVG, DXF, OBJ, IFC, DAE and many others" :D