file already open message, once

Bug #1777599 reported by PCB Wiz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Low
Wayne Stambaugh

Bug Description

I'm surprised no one seems to have reported this.

In Win10, on 5 rc for the last few months releases, pcbnew always reports
'Warning file.. is already open'
but only once, do a simple exact repeat retry of load, and it then does the loads (with save message, if changed).

Does this on both

File.New.Load (reload of previous file)
&
File.open recent, select this file.

In this case, you can repeat open recent, and 50% of the time it reports 'Warning' and 50% of the time it loads ok. A very predictable alternating toggle switch ?

Windows 10 Version 10.0.17134 Build 17134

Application: pcbnew
Version: (5.0.0-rc2-160-g7b7355772), 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 8 (build 9200), 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
    OpenCASCADE Community Edition: 6.8.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_USE_OCC=OFF
    KICAD_SPICE=ON

Tags: pcbnew windows
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

This is odd. On linux this doesn't happen. I'm not sure about macos.

Changed in kicad:
status: New → Triaged
importance: Undecided → Low
milestone: none → 5.0.1
Revision history for this message
Seth Hillbrand (sethh) wrote :

I cannot reproduce this on linux or MacOS.

tags: added: wind
tags: added: windows
removed: wind
tags: added: pcbnew
Revision history for this message
Seth Hillbrand (sethh) wrote :

Hi Windows devs, anyone have some thoughts on how to address this?

Changed in kicad:
assignee: nobody → Wayne Stambaugh (stambaughw)
status: Triaged → In Progress
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I just fixed this on windows but I find it hard to believe that the issue doesn't happen on linux and macos. The problem was easy enough to fix but the problem should exist on every platform given the way the code was written.

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

Just tried again, both methods listed and no error for Linux.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1777599] Re: file already open message, once

I just test it and for some reason the file locking is completely broken
on linux an the same file is reopened every time instead of getting a
warning that the file is already open. I'm looking into into it now. I
might as well fix both issues while I'm at it.

On 09/21/2018 07:25 PM, Seth Hillbrand wrote:
> Just tried again, both methods listed and no error for Linux.
>

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

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

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

I just pushed the fix for this sans the Linux (and presumably macos) fix. wxSingleInstanceChecker is broken for unix. For some reason it creates two different lock files which I believe confuses the lock check code. I'm not going to spend any more time messing around with the code but this will create a behavioral difference between windows and posix platforms.

Revision history for this message
Franck78 (fbourdonnec) wrote :

the example from wxWidget uses IsAnotherRunning() not if( !lockFile )

    const wxString name = wxString::Format("MyApp-%s", wxGetUserId().c_str());
    m_checker = new wxSingleInstanceChecker(name);
    if ( m_checker->IsAnotherRunning() )
    {
        wxLogError(_("Another program instance is already running, aborting."));

        return false;
    }

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.