Assert when opening Pcbnew file from command line with relative path

Bug #1767582 reported by Niki Guldbrand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Critical
Jeff Young

Bug Description

When I open a pcb file in pcbnew, and giving it a relative path on the command line i get the following assert:

/builddir/build/BUILD/kicad-r12804-5e5e80d3/pcbnew/files.cpp(420): assert "wxFileName( fullFileName ).IsAbsolute()" failed in OpenProjectFiles(): bug in single_top.cpp or project manager.

Then followed by this assert:

/builddir/build/BUILD/kicad-r12804-5e5e80d3/common/project.cpp(79): assert "m_project_name.IsAbsolute()" failed in SetProjectFullName().

Version information:

Application: pcbnew
Version: 5.0.0-rc2-dev-unknown-r12804-5e5e80d3, debug build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.55.1 OpenSSL/1.1.0h zlib/1.2.11 libidn2/2.0.4 libpsl/0.18.0 (+libidn2/2.0.3) libssh2/1.8.0 nghttp2/1.31.1
Platform: Linux 4.15.17-300.fc27.x86_64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.64.0
    Curl: 7.55.1
    Compiler: GCC 7.3.1 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=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_SPICE=OFF

Jeff Young (jeyjey)
summary: - Pcbnew (Standalone) asserts when opening a pcbfile
+ Assert when opening Pcbnew file from command line with relative path
Revision history for this message
Nick Østergaard (nickoe) wrote :

I still get these asserts with relative paths. Continuing loads the board file just fine.

Application: pcbnew
Version: (6.0.0-rc1-dev-240-g72fcf4643-dirty), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.61.0 OpenSSL/1.1.0h zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.4) nghttp2/1.32.0
Platform: Linux 4.17.11-arch1 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.67.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.61.0
    Compiler: GCC 8.1.1 with C++ ABI 1012

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

Jeff Young (jeyjey)
Changed in kicad:
assignee: nobody → Jeff Young (jeyjey)
status: New → In Progress
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

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

Changed in kicad:
status: In Progress → Fix Committed
Revision history for this message
Jeff Young (jeyjey) wrote :

Hmmm... seems these are here for a reason:

https://bugs.launchpad.net/kicad/+bug/1789047/comments/5

Probably better to leave them as asserts.

Changed in kicad:
status: Fix Committed → Triaged
importance: Undecided → Critical
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

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

Changed in kicad:
status: Triaged → Fix Committed
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Jeff, I don't consider removing the assertions a valid fix for this issue. Somewhere in the code path, relative files are not being converted to absolute files before calling PROJECT::SetProjectFullName() and SCH_EDIT_FRAME::OpenProjectFiles(). Judging by the bug report, somewhere in the schematic file source someone forgot or assumed that relative files are valid internally. They are not and we should not depend on them to be valid.

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

@Wayne, you're a little late. See my comment #3. ;)

(FWIW, the bug is an off-by-one error in PGM_SINGLE_TOP::OnPgmInit().)

Changed in kicad:
status: Fix Committed → In Progress
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

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

Changed in kicad:
status: In Progress → Fix Committed
Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1767582] Re: Assert when opening Pcbnew file from command line with relative path

@Jeff, sorry about that. It looks like Launchpad is a bit slow today.

On 09/15/2018 05:10 PM, Jeff Young wrote:
> @Wayne, you're a little late. See my comment #3. ;)
>
> (FWIW, the bug is an off-by-one error in PGM_SINGLE_TOP::OnPgmInit().)
>
> ** Changed in: kicad
> Status: Fix Committed => In Progress
>

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

@Wayne, no worries. Better a few false positives than no reviews. :)

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.