Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 08 Feb 2019 16:33:39 +0000
From:      bugzilla-noreply@freebsd.org
To:        pkg@FreeBSD.org
Subject:   [Bug 235604] ports-mgmt/pkg: bus error / segmentation fault (core dumped)
Message-ID:  <bug-235604-32340@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D235604

            Bug ID: 235604
           Summary: ports-mgmt/pkg: bus error / segmentation fault (core
                    dumped)
           Product: Ports & Packages
           Version: Latest
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: pkg@FreeBSD.org
          Reporter: olli@FreeBSD.org
          Assignee: pkg@FreeBSD.org
             Flags: maintainer-feedback?(pkg@FreeBSD.org)

There is one of my machines on which ports-mgmt/pkg randomly dumps core.
Simple commands like "pkg info" or "pkg which" seem to work without problem=
s,
but when installing ports it often crashes (but not always) with either SIG=
BUS
or SIGSEGV. This seems to happen after actual installation of the package, =
but
before recording the dependencies in the database (if there are no
dependencies, it does not appear to crash). This has led to the situation t=
hat
the dependency tree of the pkg database on that machine is now broken (there
doesn't seem to be an easy way to fix that, short of removing all ports and
start from scratch, which I will do, once the coredump problem is fixed).

I am pretty certain that it is not a hardware problem. The pkg binary is the
*only* program that exhibits the problem. I can run buildworld, buildkernel=
 or
other CPU / IO hogs for weeks without any issue. There's one special thing
about the machine, however: It is a 64bit VM hosted on KVM. I'm not sure if
that matters, though. I do have complete access to the VM, but not to the h=
ost
system.

The problem existed when the machine had FreeBSD 10. I hoped it would be fi=
xed
when upgrading, so I first went to stable/11, then to stable/12 (also updat=
ing
pkg along the way, of course), but it did not change. I'm now at stable/12
r342861 (2019-01-08) with the latest pkg-1.10.5_5.

I can reliably reproduce a SIGBUS with "pkg audit":

$ /usr/local/sbin/pkg audit
0 problem(s) in the installed packages found.
Child process pid=3D45723 terminated abnormally: Bus error

$ lldb -f /usr/local/sbin/pkg -c pkg.core -bobt
(lldb) target create "/usr/local/sbin/pkg" --core "pkg.core"
Core file '/home/olli/pkg.core' (x86_64) was loaded.
(lldb) bt
* thread #1, name =3D 'pkg', stop reason =3D signal SIGBUS
  * frame #0: 0x0000000800334fe0
libpkg.so.4`___lldb_unnamed_symbol608$$libpkg.so.4 + 112
    frame #1: 0x0000000800340200
libpkg.so.4`___lldb_unnamed_symbol660$$libpkg.so.4 + 320
    frame #2: 0x00000008002f06b4 libpkg.so.4`pkg_shutdown + 36
    frame #3: 0x0000000800b524e5
libc.so.7`__cxa_finalize(dso=3D0x0000000000000000) at atexit.c:239
    frame #4: 0x0000000800ae20e1 libc.so.7`exit(status=3D0) at exit.c:74
    frame #5: 0x0000000000214122 pkg`___lldb_unnamed_symbol1$$pkg + 290

So it appears that this bus error occurs in the exit code, after the actual
work of pkg was done.  I am currently not in a position to debug it any fur=
ther
myself.  I have uploaded the core file, binary and libraries here:
http://inof.de/FreeBSD/pr/20190208/

Let me know if you need more information. I could probably also give login
access to that machine to a FreeBSD developer if needed.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-235604-32340>