GerbView: Crashes while opening ZIP archives

Bug #1755623 reported by Evan Shultz
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Critical
jean-pierre charras

Bug Description

This is a follow-on to https://bugs.launchpad.net/kicad/+bug/1617607. You should start with my first post there on 2018-03-08.

I will repeat the same steps here, capturing screenshots and uploading the archives for verification.

For all test cases, I started out using the Modern Accelerated graphics.

Opening the Gerbers from MAXIM, DS3170DK01A0 at https://www.maximintegrated.com/en/design/tools/cad-layout/gerber/DS3170DK01A0.ZIP, renamed with GBR extension: After getting a dialog mentioning a lot of unknown symbols, and then a long delay where the PC freezes, I get an unhandled exception class error. Then GerbView crashes and the window disappears. I'll post a screenshot.

Importing the same Gerber files at once, not inside a ZIP archive, takes an inordinate amount of time loading before I gave up (more than 5 minutes).

Opening them each individually, I see issues with the following:
DRILL crashes
SDRMB reports unexpected symbols
SDRMT crashes with an unhandled exception I will post in the next comment

Using the Modern Fallback graphics still crashes when opening the ZIP archive. As does the Legacy graphics.

I then tried the 672 pin layout from https://www.altera.com/support/support-resources/download/board-layout-test/gerber.html. This imports but with a whole bunch of errors. Instead of copying everything there you can import for yourself and see.

Here is my KiCad info:
Application: kicad
Version: (5.0.0-rc2-dev-114-g8fcbb64a4), release build
Libraries:
    wxWidgets 3.0.3
    libcurl/7.54.1 OpenSSL/1.0.2l zlib/1.2.11 libssh2/1.8.0 nghttp2/1.23.1 librtmp/2.3
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.60.0
    Curl: 7.54.1
    Compiler: GCC 7.1.0 with C++ ABI 1011

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_SPICE=ON

Revision history for this message
Evan Shultz (evan-shultz) wrote :

Here is the crash I got with the MAXIM Gerbers.

Revision history for this message
Evan Shultz (evan-shultz) wrote :

Here is the archive from MAXIM with Gerber file names changed to GBR.

Revision history for this message
Evan Shultz (evan-shultz) wrote :

And finally the Altera archive, again with extension changes to GBR.

Revision history for this message
Jon Evans (craftyjon) wrote :

Hi Evan,

For the Altera archive, it has a Gerber file with extension .DRL, which GerbView currently assumes is an Excellon drill file when you use the "open ZIP archive" function. I have opened a task to try to make this smarter after the 5.0 release: https://bugs.launchpad.net/kicad/+bug/1754673

For the MAXIM archive, I have reproduced a crash when opening certain of the Gerber files contained, so there is a real issue here! I'll report back what I find.

Thanks!

Changed in kicad:
importance: Undecided → Critical
status: New → Confirmed
assignee: nobody → Jon Evans (craftyjon)
milestone: none → 5.0.0-rc2
Revision history for this message
Jon Evans (craftyjon) wrote :

@JP you might want to take a look too, you might find this faster (let me know if you want me to take it though). SDRMB.gbr from post #2 seems to spend a huge amount of time in the aperture macro parser before eventually crashing.

Revision history for this message
jean-pierre charras (jp-charras) wrote :

I'll have a look into it.

I saw 2 issues:
- A too small buffer to store a full long line when readin a Gerber file.
(SDRMT.gbr has a line ofmore than 43000 chars...)
- A issue in aperture macro.

Jon Evans (craftyjon)
Changed in kicad:
assignee: Jon Evans (craftyjon) → jean-pierre charras (jp-charras)
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision fa41026f367b46b48e15fcf3a6d72f8b14b7ae64
https://git.launchpad.net/kicad/patch/?id=fa41026f367b46b48e15fcf3a6d72f8b14b7ae64

Changed in kicad:
status: Confirmed → Fix Committed
Revision history for this message
Evan Shultz (evan-shultz) wrote :

Here's another crash. Same KiCad version as above, without the patch submitted. Files attached are the zipped collection of Gerbers from http://www.ti.com/lit/zip/tidced3. I didn't try each one to see what happens.

Revision history for this message
Evan Shultz (evan-shultz) wrote :

And I get a hang trying to load the zipped Gerbers from http://www.ti.com/lit/zip/snor009.

Revision history for this message
jean-pierre charras (jp-charras) wrote :

This bug is flagged as fixed.

Please, use a kicad version that include the fix.
I do not have issues with snor009a.zip

Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.