← Back to team overview

kicad-developers team mailing list archive

Re: Call for help.

 

On 6/15/2013 1:49 PM, jp charras wrote:
Le 15/06/2013 16:28, Wayne Stambaugh a écrit :
On 6/15/2013 4:07 AM, jp charras wrote:
Le 14/06/2013 21:08, Wayne Stambaugh a écrit :
I may have found a issue with an exception causing Pcbnew to crash on
release builds on Windows.  I would appreciate if a some of you Windows
users would run a simple test and let me know if you encounter any
problems.  Open Pcbnew and load any board.  Open the netlist dialog and
enter an invalid netlist file name in the "Netlist File:" text control.
  Click the"Read Current Netlist" button and answer yes to the prompt.
You should get a dialog box with an IO_ERROR complaining that the
invalid file name could not be opened.  I don't have any problems on
debug builds but I'm getting MSVCR library runtime errors on release
builds.  I build wxWidgets as a DLL not a static library so please let
me know how you build wxWidgets along with your report.  I want to make
sure it's not me or something on my system before I file a bug report.

Thanks for the help.

Wayne

Wayne,
have a look to the main CMakeLists.txt and the lines which define the
linker options:
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-s -static-libgcc
-static-libstdc++")

The options -static-libgcc and -static-libstdc++ are fine (and good) for
static link with wxWidgets, but creates issues when throwing errors
between dll.

May I ask you to relink Kicad after removing these options?


JP,

Thanks for the information.  I'll add this to my list of things to try.
  I'm not sure when I'll get all of this done with this being Father's
Day weekend but as soon as I have all of the testing done, I'll write up
a detailed description of the results so that we can determine a clear
path forward.

Thanks,

Wayne

More exactly, the -static-libgcc option crashes pcbnew when opening a
non existent netlist, if wxWidgets is not statically linked.


I just finished confirming this myself. I removed the -static-libgcc and -static=libstdc++ GCC options for MinGW builds and it fixed the problem. It did not matter that a release build of KiCad was linked against the debug version of wxWidgets. I'm guessing that we should either compile and link with DLLs or static libraries but not both at least in the case where exceptions are involved. I'm not sure what the best solution is to figure out how to set the build options or if we should even still be using static linking. My personal preference is to always use DLLs. It's been quit some time since I could not reliably build DLLs natively on MinGW. Thanks for the help.

Wayne




Follow ups

References