gebrview crashes when opening an empty file

Bug #1846381 reported by ocb-hd-ccb
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Unknown

Bug Description

When I plot my PCB I like to check the resulting gerber files. When I try to open a file that would be empty like "B_SilkS" or one of the "NPTH" the program hangs and I have to force quit.

I am opening the files directly with gerbview and not through kicad.

```
Application: KiCad
Version: (5.99.0-158-g78859b29e), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1
Platform: Mac OS X (Darwin 18.7.0 x86_64), 64 bit, Little endian, wxMac
Build Info:
    wxWidgets: 3.0.4 (wchar_t,STL containers,compatible with 2.8)
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.54.0
    Compiler: Clang 9.0.0 with C++ ABI 1002

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON
    KICAD_STDLIB_DEBUG=OFF
    KICAD_STDLIB_LIGHT_DEBUG=OFF
    KICAD_SANITIZE=OFF
```

Tags: gerbview
Revision history for this message
ocb-hd-ccb (ocb-hd-ccb) wrote :

This is the contents of my B_SilkS which causes crash

```
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,(5.99.0-158-g78859b29e)*
G04 #@! TF.CreationDate,2019-10-01T13:01:51-04:00*
G04 #@! TF.ProjectId,lightning-protection-pcb-panel,6c696768-746e-4696-9e67-2d70726f7465,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Legend,Bot*
G04 #@! TF.FilePolarity,Positive*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW (5.99.0-158-g78859b29e)) date 2019-10-01 13:01:51*
%MOMM*%
%LPD*%
G04 APERTURE LIST*
G04 APERTURE END LIST*
M02*
```

This is the NPTH.drl that causes crash/hang

```
M48
; DRILL file {KiCad (5.99.0-158-g78859b29e)} date Tuesday, October 01, 2019 at 01:01:57 PM
; FORMAT={-:-/ absolute / inch / decimal}
; #@! TF.CreationDate,2019-10-01T13:01:57-04:00
; #@! TF.GenerationSoftware,Kicad,Pcbnew,(5.99.0-158-g78859b29e)
; #@! TF.FileFunction,NonPlated,1,2,NPTH
FMAT,2
INCH
%
G90
G05
T0
M30
```

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

I cannot reproduce the crash

Revision history for this message
Seth Hillbrand (sethh) wrote :

@ocb-hd-ccb Can you attach the crash report from Console.app?

Changed in kicad:
status: New → Incomplete
Revision history for this message
ocb-hd-ccb (ocb-hd-ccb) wrote :

This is an example file. I cannot open this with gerbview...

I don't have a crash report show up in console.app it just is unresponsive. I don't actually know very much about console.app but when I enter 'gerbview' into the search window nothing is populated.

```
Application: KiCad
Version: (5.99.0-279-gaf837ed76), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.1 SecureTransport (LibreSSL/2.8.3) zlib/1.2.11 nghttp2/1.39.2
Platform: Mac OS X (Darwin 19.0.0 x86_64), 64 bit, Little endian, wxMac
Build Info:
    Build date: Oct 29 2019 15:23:31
    wxWidgets: 3.0.4 (wchar_t,STL containers,compatible with 2.8)
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.54.0
    Compiler: Clang 9.0.0 with C++ ABI 1002

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON
    KICAD_STDLIB_DEBUG=OFF
    KICAD_STDLIB_LIGHT_DEBUG=OFF
    KICAD_SANITIZE=OFF
```

Revision history for this message
Seth Hillbrand (sethh) wrote :

Can't get this to crash in linux.

When you say unresponsive, do the menus work? Do you get a spinning beach ball? Can you quit the application without force quitting?

If you have to force quit, can you click "Report" and then copy/paste the report text information to this bug report?

Application: GerbView
Version: (5.99.0-283-g65bf66938-dirty), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.0 OpenSSL/1.1.1d zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
Platform: Linux 4.19.0-6-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    Build date: Oct 30 2019 09:22:28
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.67.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.64.0
    Compiler: GCC 8.3.0 with C++ ABI 1013

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON
    KICAD_STDLIB_DEBUG=OFF
    KICAD_STDLIB_LIGHT_DEBUG=OFF
    KICAD_SANITIZE=OFF

Revision history for this message
ocb-hd-ccb (ocb-hd-ccb) wrote :

Yes, it is just a beach ball. It is completely unresponsive. No menus no nothing.

I have to force quit but there isn't a 'report' button after I force quit. Is there somewhere else?

Revision history for this message
Seth Hillbrand (sethh) wrote :

That's odd.

Can you follow this procedure to sample the process and copy the data returned?

https://support.apple.com/guide/activity-monitor/run-system-diagnostics-actmntr2225/mac

Revision history for this message
ocb-hd-ccb (ocb-hd-ccb) wrote :

Hope this helps.

Revision history for this message
ocb-hd-ccb (ocb-hd-ccb) wrote :

So, I may have additional information about this...

It doesn't appear to crash/freeze on open of the file. It is when I move the window after opening. I have a large monitor and when I open it is pretty small in the upper left corner. It appears to open and not hang until I move that window and/or attempt to resize the window.

Doing the same action with a gbr that isn't blank works perfectly.

Revision history for this message
Jeff Young (jeyjey) wrote :

I can't reproduce this with the file from #4 (or any other Gerber).

Same OS, same wxWidgets. Build flags slightly different, but I don't think there's any scripting hookup for GerbView, and OCE isn't involved is it?

Application: GerbView
Version: (5.99.0-345-g55432d968-dirty), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.57.0 OpenSSL/1.0.2n zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4)
Platform: Mac OS X (Darwin 18.7.0 x86_64), 64 bit, Little endian, wxMac
Build Info:
    Build date: Nov 7 2019 21:20:53
    wxWidgets: 3.0.4 (wchar_t,STL containers,compatible with 2.8)
    Boost: 1.66.0
    Curl: 7.57.0
    Compiler: Clang 11.0.0 with C++ ABI 1002

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=OFF
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=OFF
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON
    KICAD_STDLIB_DEBUG=OFF
    KICAD_STDLIB_LIGHT_DEBUG=OFF
    KICAD_SANITIZE=OFF

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

KiCad bug tracker has moved to Gitlab. This report is now available here: https://gitlab.com/kicad/code/kicad/-/issues/2564

Changed in kicad:
status: Incomplete → Expired
Changed in kicad:
importance: Undecided → Unknown
status: Expired → 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.