← Back to team overview

kicad-developers team mailing list archive

Re: Eeschema test segfault


Hi all,

I found a way to avoid doing the wxCursor static init, which seems to
have pleased the pointer fairies. I have checked it builds on Windows
and Linux.

It should now be possible to write unit tests for eeschema in the same
way that tests are written for pcbnew and libcommon.

I have committed to both master and 5.1 so fixes that come with their
own test cases can be easily applied to both branches.



On Sun, Mar 31, 2019 at 11:50 PM John Beard <john.j.beard@xxxxxxxxx> wrote:
> Hi,
> I'm trying to get the eeschema tests building and working, but I have
> an issue with a segfault on init (the existing test itself will not
> work either as it has hardcoded data paths, but it doesn't get that
> far, so baby steps!).
> It looks like the init of wxCursor in simulate.cpp line #144 is
> exploding at static init time. I assume there's something to do with
> setting up WX, but the crash is before even main is called (I think).
> If anyone has an idea of how to start up eeschema's kiface in a test
> context, I'd be grateful to hear it!
> Main crash frames:
> ....
> #17 0x00007ffff5757ebc in  () at /usr/lib/libwx_gtk3u_core-3.0.so.0
> #18 0x00007ffff5769afe in wxCursor::wxCursor(char const*, int, int,
> int, int, char const*, wxColour const*, wxColour const*) () at
> /usr/lib/libwx_gtk3u_core-3.0.so.0
> #19 0x00007ffff771ee91 in __static_initialization_and_destruction_0(int, int)
>     (__initialize_p=1, __priority=65535) at
> /home/john/src/kicad/eeschema/sim/simulate.cpp:144
> #20 0x00007ffff771ef36 in _GLOBAL__sub_I_simulate.cpp(void) ()
>     at /home/john/src/kicad/eeschema/sim/simulate.cpp:145
> #21 0x00007ffff7fe354a in call_init.part () at /lib64/ld-linux-x86-64.so.2
> #22 0x00007ffff7fe364a in _dl_init () at /lib64/ld-linux-x86-64.so.2
> #23 0x00007ffff7fd503a in _dl_start_user () at /lib64/ld-linux-x86-64.so.2
> ...
> Cheers,
> John