Bug 212026 - cad/kicad-devel: segfaults on exit if eeschema or library editor used
Summary: cad/kicad-devel: segfaults on exit if eeschema or library editor used
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Michael Reifenberger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-21 12:02 UTC by Wayne Sierke
Modified: 2019-01-26 04:56 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (mr)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wayne Sierke 2016-08-21 12:02:06 UTC
kicad exits with a segfault+coredump if either the Eeschema or Schematic library editor apps has been launched from the kicad Project manager.

It doesn't matter if those apps are closed before exiting kicad, nor whether any editing/activity has taken place before closing. Launching the Schematic library editor then closing it without selecting an active library is sufficient to induce the segfault.

The segfault does not occur when (only) any of Pcbnew, PCB footprint editor, GerbView and Pcb calculator is/are launched from within kicad.

~ % pkg info -o kicad-devel
kicad-devel-r6904              cad/kicad-devel
~ % /usr/local/bin/kicad
Segmentation fault (core dumped)
~ % echo $?
139
Comment 1 Wayne Sierke 2016-08-24 06:48:56 UTC
Launching eeschema standalone shows that it is eeschema generating the segfault. In standalone mode I only see the segfault if some activity is done in the editor (including simply opening a schematic) before closing. Launching into a blank sheet then exiting without saving does not result in the segfault:

Without any editing:

~ % /usr/local/bin/eeschema 
~ % echo With editing - exit without save: ; /usr/local/bin/eeschema
With editing - exit without save:
Segmentation fault (core dumped)
~ % echo $?
139


Various experimentation showed that almost any interaction other than editing the schematic does not result in the segfault on exit. This included setting the "Issue Date" in "Page Settings" (no segfault on exit without save).

Launching the Library Browser, however, did trigger the segfault on exiting eeschema (without any editing in eeschema or any browsing in the browser). The Gdk errors are issued as soon as the browser is launched:

~ % /usr/local/bin/eeschema

(eeschema:2113): Gdk-CRITICAL **: IA__gdk_window_process_updates: assertion 'GDK_IS_WINDOW (window)' failed

(eeschema:2113): Gdk-CRITICAL **: IA__gdk_window_process_updates: assertion 'GDK_IS_WINDOW (window)' failed
Segmentation fault (core dumped)


A ktrace of a session where eeschema is launched then immediately exited ends with:

  2202 eeschema CALL  madvise(0x81a9e0000,0x1000,MADV_FREE)
  2202 eeschema RET   madvise 0
  2202 eeschema CALL  getpid
  2202 eeschema RET   getpid 2202/0x89a
  2202 eeschema CALL  exit(0)
  2202 eeschema RET   _umtx_op -1 errno 4 Interrupted system call
  2202 eeschema GIO   fd 13 wrote 64 bytes
       0x0000 0f00 0000 0000 0000 ffff 1500 0100 0000 0100 0000 0000 0000 0000 0000 0000 0000 1000 0000 0000 0000 fcff 1500 2f00 0000 0000 0000 0000  |............................................/.........|
       0x0036 0000 0000 0000 0000 0000                                                                                                                |..........|

  2202 eeschema RET   kevent -1 errno 4 Interrupted system call
  2202 eeschema RET   poll -1 errno 4 Interrupted system call
  2202 eeschema RET   poll -1 errno 4 Interrupted system call



A ktrace of a session where an edit is made before "exit without save" ends with:

  2156 eeschema CALL  madvise(0x81a9de000,0x3000,MADV_FREE)
  2156 eeschema RET   madvise 0
  2156 eeschema RET   _umtx_op -1 errno 60 Operation timed out
  2156 eeschema CALL  _umtx_op(0x800879080,UMTX_OP_WAIT_UINT_PRIVATE,0,0x18,0x7fffdf5f8e38)
  2156 eeschema PSIG  SIGSEGV SIG_DFL code=SEGV_ACCERR
  2156 eeschema RET   poll -1 errno 4 Interrupted system call
  2156 eeschema GIO   fd 13 wrote 96 bytes
       0x0000 0f00 0000 0000 0000 ffff 1500 0100 0000 0100 0000 0000 0000 0000 0000 0000 0000 1000 0000 0000 0000 fcff 1500 2f00 0000 0000 0000 0000  |............................................/.........|
       0x0036 0000 0000 0000 0000 0000 1200 0000 0000 0000 fcff 1500 2f00 0000 0000 0000 0000 0000 0000 0000 0000 0000                                |....................../...................|

  2156 eeschema RET   _umtx_op -1 errno 4 Interrupted system call
  2156 eeschema RET   poll -1 errno 4 Interrupted system call
  2156 eeschema RET   kevent -1 errno 4 Interrupted system call
  2156 eeschema NAMI  "eeschema.core"
Comment 2 commit-hook freebsd_committer 2016-09-13 11:27:15 UTC
A commit references this bug:

Author: mr
Date: Tue Sep 13 11:26:27 UTC 2016
New revision: 421993
URL: https://svnweb.freebsd.org/changeset/ports/421993

Log:
  kicad switched to GIT (still hosted on launchpad) for development.
  Try to cope with it since bzr doesn't work any longer:
  - For distfile building, checkout first, than get last commit date...
  - Use the timestamp of the last commit as revision number.
  - Update to r20160910202359 (commit 7ad2f37391e3e0debb7b96cd7164961d118f44c1)
  - Some functions now seem to need/emit SSE instructions which seems not to be enabled on i386 by default so add -msse switch

  PR:		212026, 212130

Changes:
  head/cad/kicad-devel/Makefile
  head/cad/kicad-devel/Makefile.bzr_rev
  head/cad/kicad-devel/Makefile.git_rev
  head/cad/kicad-devel/distinfo
  head/cad/kicad-devel/pkg-plist
Comment 3 Michael Reifenberger freebsd_committer 2016-09-13 13:10:55 UTC
Hi,
could you please re-test after the update?

Thanks!
---
mike
Comment 4 Wayne Sierke 2016-09-18 13:38:49 UTC
(In reply to Michael Reifenberger from comment #3)
Hi Michael,

Thanks for the update. Unfortunately eeschema still segfaults for me on exit if an edit is performed.
Comment 5 Walter Schwarzenfeld freebsd_triage 2018-01-13 23:04:17 UTC
Is this still relevant?
Comment 6 Wayne Sierke 2018-01-14 02:43:40 UTC
Apologies for not responding to this sooner.

It still segfaults for me.

FreeBSD 10.4-RELEASE-p3 GENERIC  amd64
kicad-devel-r20171031091403_4  cad/kicad-devel
Comment 7 Walter Schwarzenfeld freebsd_triage 2018-01-14 02:50:11 UTC
Thanks for reply.
Comment 8 Michael Reifenberger freebsd_committer 2018-01-21 17:04:26 UTC
Hi,
I have no dumps on FreeBSD 11-stable.
Unfortunately kicad-devel doesn't compile on 10.x currently and I can't
put much efforts into it.
Any chance you could upgrade.

Thanks in advance.

Greetings
---
Michael Reifenberger
Comment 9 Walter Schwarzenfeld freebsd_triage 2019-01-24 06:09:41 UTC
Is this still releveant?
Comment 10 Wayne Sierke 2019-01-26 04:56:32 UTC
(In reply to w.schwarzenfeld from comment #9)

Just tried with:

kicad-devel-r20180821185413_4

and:

10.4-RELEASE-p12


Tested the described scenarios and apps exited normally.