Possible unexpected crash on Windows

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Possible unexpected crash on Windows

Post by triplus »

I can't test this on Windows, but during FreeCAD start on Windows, it looks like a standard Python exception could result in a FreeCAD crash. An example:

Code: Select all

C:\Users\user_name\AppData\Roaming\FreeCAD\Mod\Demo\InitGui.py
Containing code:

Code: Select all

import os
import FreeCAD as App

os.listdir(App.getUserAppDataDir() + "Demo")
On Linux i don't experience the crash. Two reports, that are likely related, if the above example can be confirmed by others:

https://forum.freecadweb.org/viewtopic. ... 30#p295022
https://forum.freecadweb.org/viewtopic.php?f=4&t=35084
Syres
Veteran
Posts: 2901
Joined: Thu Aug 09, 2018 11:14 am

Re: Possible unexpected crash on Windows

Post by Syres »

Error raised but no crash on either of these builds:

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16093 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 690774c0effe4fd7b8d2b5e2fb2b8c8d145e21ce
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)

produces error :

Code: Select all

During initialization the error [WinError 3] The system cannot find the path specified: 'C:\\Users\\JPS\\AppData\\Roaming\\FreeCAD\\Demo' occurred in C:\Users\JPS\AppData\Roaming\FreeCAD\Mod\Demo\InitGui.py
Please look into the log file for further information
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16093 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 690774c0effe4fd7b8d2b5e2fb2b8c8d145e21ce
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedKingdom (en_GB)

produces error :

Code: Select all

During initialization the error [Error 3] The system cannot find the path specified: u'C:\\Users\\JPS\\AppData\\Roaming\\FreeCAD\\Demo\\*.*' occurred in C:\Users\JPS\AppData\Roaming\FreeCAD\Mod\Demo\InitGui.py
Please look into the log file for further information

Hope the feedback is of use.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Possible unexpected crash on Windows

Post by triplus »

Hi @Syres

Thanks for testing. Could you by any chance test with FreeCAD 0.17:

https://github.com/FreeCAD/FreeCAD/releases/tag/0.17

Just to confirm the suspicion, this issue was once present on Windows, but should be fixed in FreeCAD 0.18.
renatorivo
Veteran
Posts: 2611
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Re: Possible unexpected crash on Windows

Post by renatorivo »

OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16093 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 690774c0effe4fd7b8d2b5e2fb2b8c8d145e21ce
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Italian/Italy (it_IT)

produces error :

Code: Select all

During initialization the error bad magic number in 'path_locator': b'\x03\xf3\r\n' occurred in C:\Users\User\AppData\Roaming\FreeCAD\Mod\AirPlaneDesign\InitGui.py
Please look into the log file for further information
During initialization the error invalid syntax (<string>, line 69) occurred in C:\Users\User\AppData\Roaming\FreeCAD\Mod\animation\InitGui.py
Please look into the log file for further information
During initialization the error inconsistent use of tabs and spaces in indentation (<string>, line 52) occurred in C:\Users\User\AppData\Roaming\FreeCAD\Mod\cura_engine\InitGui.py
Please look into the log file for further information
During initialization the error No module named 'proxies' occurred in C:\Users\User\AppData\Roaming\FreeCAD\Mod\drawing_dimensioning\InitGui.py
Please look into the log file for further information
During initialization the error Missing parentheses in call to 'print'. Did you mean print("create toolbars-------------------------")? (<string>, line 874) occurred in C:\Users\User\AppData\Roaming\FreeCAD\Mod\nurbs\InitGui.py
Please look into the log file for further information
Syres
Veteran
Posts: 2901
Joined: Thu Aug 09, 2018 11:14 am

Re: Possible unexpected crash on Windows

Post by Syres »

@Triplus, both 0.17 and 0.16 produce exactly the same output as the 0.18 Py2Qt4 build with no crash.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Possible unexpected crash on Windows

Post by triplus »

Hi @renatorivo

Such output looks related to Py3 issues some FreeCAD modules might currently have. Best to test with the latest version of each module. If the issue persist, opening an issue report and make the developer aware of the issue makes sense.

@Syres

Therefore likely this was/is not a general issue. Thanks for confirming.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Possible unexpected crash on Windows

Post by DeepSOIC »

No crash here. I tried:

Code: Select all

import os
import FreeCAD as App

os.listdir(App.getUserAppDataDir() + "Demo")
...which errored that path not found, and:

Code: Select all

import os
import FreeCAD as App

os.listdir(App.getUserAppDataDir() + "Mod\Demo")
...which gave no error
In both cases, FreeCAD launched normally.

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16028 (Git)
Build type: Release
Branch: master
Hash: 9079de7516eca945587e18f6076ec74eb7bd043c
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Russian/Russia (ru_RU)

add-ons:
Curves
DeepConsole #my small add-on for debugging
Demo
FCGear
Lattice2
Manipulator
Part-o-Magic
TabBar
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Possible unexpected crash on Windows

Post by triplus »

DeepSOIC wrote: Fri Mar 29, 2019 4:10 pm No crash here.
Thanks for confirming.

P.S. This doesn't look like a general issue anymore too me and hence it can be dismissed.
BuCoS
Posts: 2
Joined: Tue Jun 01, 2021 7:51 pm

Re: Possible unexpected crash on Windows

Post by BuCoS »

Start from 0.19.2.7b5e18a-WIN-x64 installer (and any time thereafter) crashes after showing initial UI for 2sec on Windows 7.

Start of 0.18.4 on same machine/user works without a hitch:
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.4 (GitTag)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)

Referring to possibly related case https://forum.freecadweb.org/viewtopic. ... 30#p295022, I tried to remove the Demo scheme, but being the UI only idiot I am, I don't know how to start it (double-clicking just flashes a DOS window). Documentation issue: InitGui.py is not in "C:\Users\user_name\AppData\Roaming\FreeCAD\Mod\IconThemes\", but in "C:\Program Files\FreeCAD 0.19\Mod\AddonManager\",

Sorry for the hand holding I need, where do I find the logs that you need?

Thank you!
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: Possible unexpected crash on Windows

Post by chrisb »

BuCoS wrote: Tue Jun 01, 2021 8:20 pm Sorry for the hand holding I need, where do I find the logs that you need?
They are in C:\Users\user_name\AppData\Roaming\FreeCAD. You have to invoke FreeCAD with the additional commandline parameter "-l" (small letter L).
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply