Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kicad generated drill file ==> bad_alloc #397

Closed
quartane opened this issue Jan 30, 2020 · 4 comments · Fixed by #449
Closed

Kicad generated drill file ==> bad_alloc #397

quartane opened this issue Jan 30, 2020 · 4 comments · Fixed by #449

Comments

@quartane
Copy link

Hellow everyone, minor bug here

I'm using

2.0.0
Git commit: v2.0.0-294-g513cdb4-dirty
Boost: 106700
Gerbv: 2.7.0

Using a drill file generated from KiCad, the drill file creation process crash with a bad_alloc.
the crash occur at the line

curBit.unit = string(currentDrill->drill_unit);
of the file drill.cpp

What happend?
For some reason, gerbv return me the default tool. The default tool of the gerbv has "drill_unit" = NULL
So the string function crash ;)

I used gerbv version

gerbv version 2.7.0
Copyright (C) 2001—2008 by Stefan Petersen
and the respective original authors listed in the source files.

What did you expect to happen:
I thinks that gerbv should give a non null unit tools by defaukt but I thinks too that the software should manage the exception better.

either by ==> throwing an identified error telling the user that his drill file containe any or default tool.

or by not crashing and not adding the default tool to the list of tools available (that's how I patched mine but I think the first way is cleaner)

In any Case, a big printf that warn the user that for any reason gerbv returned his default tool is welcome

I hope I've helped.

By the way thanks for the hard work given :) that's great. And have a good day

@eyal0
Copy link
Contributor

eyal0 commented Feb 3, 2020

Do you have a sample drill file and command line that I can try so that I can see the error, too?

@quartane
Copy link
Author

quartane commented Feb 3, 2020

I do,

here the command used to call pcb2gcode :
pcb2gcode --output-dir "./generatedGCODE/" --zchange 20 --metric --drill-speed 10000 --bridgesnum 4 --bridges 0.5 --cut-feed 250 --zdrill -1.6 --extra-passes 0 --cutter-diameter 3 --zcut -1.56 --fill-outline --zbridges 1 --mill-feed 300 --offset 0.3 --front "/home/jag/test/testCNC-F_Cu.gbr" --mill-speed 800 --cut-speed 12000 --drill-feed 1000 --outline "/home/jag/test/testCNC-Edge_Cuts.gbr" --optimise --zsafe 1 --cut-infeed 0.5 --zwork -0.26 --drill "/home/jag/test/testCNC-NPTH.drl" --nog64

Here's my "project" test
testCNC.zip

@eyal0
Copy link
Contributor

eyal0 commented Jun 26, 2020

Ah yeah, I see that, too! I'll take a look, sorry to keep you waiting!

@eyal0
Copy link
Contributor

eyal0 commented Jun 26, 2020

How did KiCad select no tool? Strange. I suppose that I can work around it.

eyal0 added a commit to eyal0/pcb2gcode that referenced this issue Jun 26, 2020
This can happen if there are no holes to drill.
This fixes pcb2gcode#397
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants