NCC Tool Crash

Issue #300 resolved
Brian created an issue

Hi All,

I have an issue where FlatCAM 8.96 (both 32 and 64bit) crashes, the program just closes with no other notifications… when ‘Generate Geometry’ button pressed from within Non-Copper Clearing (NCC Tool tab)

When the app crashes, two windows event logs are created (attached) Event ID: 1000 and 1001

I can send you my Gerber if required.

Many Thanks

Comments (30)

  1. Marius Stanciu

    Hi Brian,

    The problem is reproducible? You need to write here a full report of what you were doing, settings and the steps to reproduce the issue.
    Adding the Gerber file will help but the most important is to write the steps to reproduce the issue.

  2. Brian reporter

    Wow quick reply, Thanks.

    Reproducible, yep about 100 times, two computers just trying to get the NCC

    The Process

    • Open FlatCAM
    • File > Open > Open Gerber
    • Select File 'MainBoard.GTL'
    • From the Project tab click Gerber > MainBoard.GTL
    • click Selected tab
    • Plot Options: 1 0 1
    • Name: MainBoard.GTL
    • Apertures: 0
    • Tool Dia: 0.17
    • Passes: 1

    • Pass overlap: 0.09
    • Milling Type: Climb
    • Combine Passes: 0
    • Follow: 0
    • Click the NCC Tool button
    • The NCC Tool Tab Opens
    • Obj Type: Gerber
    • Object: MainBoard.GTL
    • Tools Table: 0.17
    • Tool order: No
    • Tool dia 1.0
    • Overlap Rate: 0.09
    • Margin 0.05
    • Method Straight Lines
    • Connect: 1
    • Contour: 1
    • Rest M: 0
    • Offset: 0
    • Reference: Itself
    • Click the Generate Geometry button... Program crash

    I have exported the FlatConfig file and have my GTL but cannot workout see how to upload them?

    Thanks

  3. Marius Stanciu

    Can you please go to:

    Edit → Preferences → Tools → NCC Tool Options → Parameters → Tool dia:
    and instead of having only one tool: 0.17 add another one so in the field you will have: 0.17, 0.1
    Then, when you are in the NCC Tool just delete the supplementary tool (0.1) and proceed as you normally would.

    Would it still crash?

  4. Marius Stanciu

    This is the result if I am doing it (but using a tool of 0.1mm diameter and the Seed method).

  5. Brian reporter

    Hi Marius,

    Thanks for your time.

    if I add a 0.1 tool (0.17, 0.1) it still crashes

    • 0.17 tool only selected(both tools still in the table)
    • 0.1 tool only selected (both tools still in the table)
    • 0.1 tool deleted, 0.17 selected
    • 0.17 tool deleted, 0.1 tool selected

    I have also tried combinations of ‘Method’ as suggested, but all crash the program when the Generate Geometry button is clicked

    It also crashes at the same point on my laptop with the above variations!

    Many Thanks, Brian.

  6. Marius Stanciu

    Hi Brian,

    The extra tool that I was talking about has to be added in Preferences and the Preferences should be saved. Then you need to load again the Gerber file and do the steps.

  7. Brian reporter

    Hi Marius,

    yes “Edit → Preferences → Tools → NCC Tool Options → Parameters → Tool dia:” changed from “0.17” to “0.17, 0.1”

    I am sure I closed and relaunched the program after making the changes… anyway is a crash and try again not the same thing?

    …have now rebooted, and still the same.

    I have also just installed downloaded FlatCAM again (FlatCAM_beta_8.96_x64_installer.exe) and installed onto a 3rd computer, imported my config, added “0.17, 0.1” to “…NCC Tool Options → Parameters → Tool dia:””, rebooted and exactly the same happens.

    • 0.17 tool only selected(both tools still in the table)and Method: Seed-based
    • 0.1 tool only selected (both tools still in the table)and Method: Seed-based
    • 0.1 tool deleted (entry No2 in the Tools Table), 0.17 selected and Method: Seed-based
    • 0.17 tool deleted (entry No1 in the Tools Table), 0.1 tool selected and Method: Seed-based

    All three computers are different hardware all with Windows 10 x64 fully updated

    Thanks

  8. Brian reporter

    Same crash.

    • Open FlatCAM
    • Exported current config
    • closed FlatCAM
    • Open FlatCAM
    • Imported config
    • closed FlatCAM
    • Open FlatCAM
    • Open File 'MainBoard.GTL'
    • Click the NCC Tool button
    • Selected Tools Table: 0.10 (left 0.20 there)
    • Click the Generate Geometry button... Program crash

    I have also done the same with AntiVrius software disabled, but same result

    Thanks

  9. Marius Stanciu

    Brian,
    Are you familiar with running FlatCAM from sources?

    It may help to see what is the exact error that makes FlatCAM close but for that you need to install the Python toolchain and run FlatCAM from command line.
    Thanks,
    Marius

  10. Brian reporter

    Hi Marius,

    Following this https://bitbucket.org/jpcgt/flatcam/wiki/Windows%20Install

    Downloaded “Winpython32-3.7.4.0.exe”, extracted and run “WinPython Powershell Prompt.exe”

    python -m pip install --upgrade pip Works OK

    pip install svg.path Works OK

    But these do not work, see below.

    PS C:\Temp\Winpython32-3.7.4.0\scripts> pip install Rtree-0.8.2-cp27-cp27m-win32.whl

    WARNING: Requirement 'Rtree-0.8.2-cp27-cp27m-win32.whl' looks like a filename, but the file does not exist

    ERROR: Rtree-0.8.2-cp27-cp27m-win32.whl is not a supported wheel on this platform.

    PS C:\Temp\Winpython32-3.7.4.0\scripts> pip install Shapely-1.5.16-cp27-cp27m-win32.whl

    WARNING: Requirement 'Shapely-1.5.16-cp27-cp27m-win32.whl' looks like a filename, but the file does not exist

    ERROR: Shapely-1.5.16-cp27-cp27m-win32.whl is not a supported wheel on this platform.

    Thanks, Brian.

  11. Marius Stanciu

    Hi,

    You need to go here: [https://www.lfd.uci.edu/~gohlke/pythonlibs/](https://www.lfd.uci.edu/~gohlke/pythonlibs/)

    and download all the necessary .whl files for Pyton 3.7 and for 32bit since you chose to download the 32bit version of WinPython.
    The necessary .whl files are in the requirements.txt file found in the FlatCAM 8.96 ZIP source files bundle downloaded from here: https://bitbucket.org/jpcgt/flatcam/downloads/FlatCAM_beta_8.96_sources.zip
    BTW, I will have to make some mods in that file too but it will work for our purpose since you are not going to do the pip install requirements.txt but download the files from the Gohlke’s site.

    Then you need to CD to the folder where you downloaded all the wheel files and install them with:
    pip install wheel_name

    It’s enough just to write the start of the name then autocomplete with TAB key.

    For PyQt5 you will need to run:

    pip install pyqt5==5.12.0

    because you will not find it on the Gohlke’s site.

  12. Brian reporter

    Thanks for the info

    Rtree = Done

    Shapely = Done

    pip install pyqt5==5.12.0 I get this below but says it was installed correctly!

    PS C:\Temp\Winpython32-3.7.4.0\_Download> pip install pyqt5==5.12.0

    Collecting pyqt5==5.12.0

    Downloading https://files.pythonhosted.org/packages/49/1d/6eabcd8bb11598818c2cc98caae37af6ab48067c92bd7893fa48c676f1c5/PyQt5-5.12-5.12.1_a-cp35.cp36.cp37.cp38-none-win32.whl (41.2MB)

    |██████████| 41.2MB 6.8MB/s

    Requirement already satisfied: PyQt5_sip<4.20,>=4.19.14 in c:\temp\winpython32-3.7.4.0\python-3.7.4\lib\site-packages (from pyqt5==5.12.0) (4.19.18)

    ERROR: spyder 3.3.5 has requirement pyqtwebengine<5.13; python_version >= "3", but you'll have pyqtwebengine 5.13.0 which is incompatible.

    ERROR: pyqtwebengine 5.13.0 has requirement PyQt5>=5.13, but you'll have pyqt5 5.12 which is incompatible.

    Installing collected packages: pyqt5

    Found existing installation: PyQt5 5.13.0

    Uninstalling PyQt5-5.13.0:

    Successfully uninstalled PyQt5-5.13.0

    Successfully installed pyqt5-5.12

    now, if I change dir and run FlatCAM I get this

    PS C:\Temp\FlatCAM_beta_8.96_sources> python .\FlatCAM.py

    Traceback (most recent call last):

    File ".\FlatCAM.py", line 6, in <module>

    from FlatCAMApp import App

    File "C:\Temp\FlatCAM_beta_8.96_sources\FlatCAMApp.py", line 33, in <module>

    from ObjectCollection import *

    File "C:\Temp\FlatCAM_beta_8.96_sources\ObjectCollection.py", line 14, in <module>

    from FlatCAMObj import *

    File "C:\Temp\FlatCAM_beta_8.96_sources\FlatCAMObj.py", line 15, in <module>

    from camlib import *

    File "C:\Temp\FlatCAM_beta_8.96_sources\camlib.py", line 42, in <module>

    import rasterio

    File "C:\Temp\Winpython32-3.7.4.0\python-3.7.4\lib\site-packages\rasterio\__init__.py", line 29, in <module>

    from rasterio._base import gdal_version

    ImportError: DLL load failed: The specified module could not be found.

    Thanks for you help.

  13. Brian reporter

    GDAL = Done

    PS C:\Temp\FlatCAM_beta_8.96_sources> python .\FlatCAM.py

    Traceback (most recent call last):

    File ".\FlatCAM.py", line 6, in <module>

    from FlatCAMApp import App

    File "C:\Temp\FlatCAM_beta_8.96_sources\FlatCAMApp.py", line 33, in <module>

    from ObjectCollection import *

    File "C:\Temp\FlatCAM_beta_8.96_sources\ObjectCollection.py", line 14, in <module>

    from FlatCAMObj import *

    File "C:\Temp\FlatCAM_beta_8.96_sources\FlatCAMObj.py", line 15, in <module>

    from camlib import *

    File "C:\Temp\FlatCAM_beta_8.96_sources\camlib.py", line 44, in <module>

    import ezdxf

    ModuleNotFoundError: No module named 'ezdxf'

  14. Marius Stanciu

    Please have a look in the requirements.txt file and install all the packages there. Including the EZDXF. If you can’t find them in Gohlke’s site then install them from Pypi online repository by doing:

    pip install module_name

    e.g:
    pip install ezdxf

  15. Brian reporter

    Ok all done…

    PS C:\Temp\FlatCAM_beta_8.96_sources> python .\FlatCAM.py Opens FlatCAM program (32bit)

    If I open the file and follow the process as before…

    ...

    [WARNING] Joining 1282 polygons.

    [DEBUG] Union by buffer...

    [WARNING] Union(buffer) done.

    [DEBUG][Dummy-4] 3.545789 seconds executing initialize().

    [DEBUG] FlatCAMObj.FlatCAMGerber.convert_units()

    [DEBUG] camlib.Geometry.convert_units()

    [DEBUG] camlib.Gerber.scale()

    [DEBUG][Dummy-4] 0.183488 seconds converting units.

    [DEBUG] camlib.Gerber.bounds()

    [DEBUG][Dummy-4] Moving new object back to main thread.

    [DEBUG][MainThread] on_object_created()

    [DEBUG][MainThread] on_object_created --> OC.append()

    [DEBUG][MainThread] FlatCAMGerber.set_ui()

    [DEBUG][MainThread] set_ui --> FlatCAMObj.to_form()

    [DEBUG][MainThread] build_ui--> FlatCAMObj.build_ui()

    [DEBUG][MainThread] set_inactive--> OC.get_by_name()

    [DEBUG][MainThread] register_recent()

    [DEBUG][Dummy-5] worker_task --> FlatCAMGerber.plot()

    [DEBUG][MainThread] gerber

    [DEBUG][Dummy-5] plot --> FlatCAMObj.plot()

    [DEBUG][MainThread] L:/123/456/MainBoard.GTL

    [DEBUG][Dummy-5] 1.335278 seconds adding object and plotting.

    [DEBUG][MainThread] build_ui--> FlatCAMObj.build_ui()

    WARNING: Traceback (most recent call last):

    File "C:\Temp\FlatCAM_beta_8.96_sources\flatcamTools\ToolNonCopperClear.py", line 831, in on_ncc_click

    self.bound_obj_name = self.object_combo.currentText()

    AttributeError: 'NonCopperClear' object has no attribute 'object_combo'

    Hope this helps!

  16. Marius Stanciu

    Hi Brian,

    Ok, I’ve seen the issue. The 'object_combo' object was declared as obj_combo and therefore it crashed the app. Fortunately it was already solved in my working version, that is the reason that it worked for me, but I don’t know how this escaped in a build.
    Although not the original purpose, you also helped me find another bug which was more hidden, meaning the one that appeared when only one tool was added in the NCC Tool preferences.
    In any case, I hope you learned something 🙂
    Thank you for all your help,
    Marius

  17. Brian reporter

    Glad I helped!!

    and the response from you was outstanding, Thank you 😉

    when will an update be available?

  18. Brian reporter

    Hi Marius,

    I am now having trouble generating the G-Code!

    I left it running all night and was still thinking about it this morning (the ‘8 ball’ icon going around in the bottom right of the window)

    There is nothing in the Winpython window?

    Many Thanks, Brian

  19. Marius Stanciu

    Hi,
    I think that it’s a thread race/inversion. I am trying to add a new feature but it seems that it is malfunctioning or not cooperating.
    Lately everything is not cooperating 🙂

  20. Brian reporter

    Hi,

    flatcam-Beta-8becb4b50624 = race condition

    8.96 Installer = Same race condition

    Thanks for the info. is there an earlier ‘sources’ version that I can use that doesn't have this issue?

    Many Thanks

  21. Marius Stanciu

    The reported issue was fixed (it was a typo in the name of a combobox) and it will be available in the next build, 8.97.

  22. Log in to comment