pkg install 1.10.5 segfaults

Greetings.

pkg install fails with a core dump for me. This is pkg 1.10.5, on
11.1-RELEASE-p9. (presumably I have some local cache corruption, or something similar, but segfaulting is not perhaps how pkg should deal with that)

This appears to be related to the issues in [1-5] (the first
three are from 2017 or 2018), but not exactly the same as any.

Running pkg -d install nss_ldap, I get

Code:
    [...snip...]
    DBG(1)[18232]> Binary> loading /var/cache/pkg/nss_ldap-1.265_12-d66117adb0.txz
    DBG(1)[18232]> Binary> loading /var/cache/pkg/openldap-client-2.4.46-98cfbc28cf.txz
    Checking integrity...DBG(1)[18232]> cannot load files from openldap-client and (null) to check conflicts
    zsh: segmentation fault (core dumped)  pkg -d install nss_ldap

And running truss pkg -d install nss_ldap, I get

Code:
    fstatat(4,"local.sqlite-journal",0x7fffffffda20,0x0) ERR#2 'No such file or directory'
    fstat(5,{ mode=-rw-r--r-- ,inode=882832,size=3682304,blksize=32768 }) = 0 (0x0)
    pread(0x5,0x7fffffffdad0,0x10,0x18)              = 16 (0x10)
    fstat(5,{ mode=-rw-r--r-- ,inode=882832,size=3682304,blksize=32768 }) = 0 (0x0)
    fstatat(4,"local.sqlite-wal",0x7fffffffda20,0x0) ERR#2 'No such file or directory'
    fstat(5,{ mode=-rw-r--r-- ,inode=882832,size=3682304,blksize=32768 }) = 0 (0x0)
    fcntl(5,F_SETLK,0x7fffffffda50)                  = 0 (0x0)
    fcntl(5,F_SETLK,0x7fffffffda58)                  = 0 (0x0)
    fcntl(5,F_SETLK,0x7fffffffda58)                  = 0 (0x0)
    fcntl(5,F_SETLK,0x7fffffffda58)                  = 0 (0x0)
    fstatat(4,"local.sqlite-journal",0x7fffffffda20,0x0) ERR#2 'No such file or directory'
    fstat(5,{ mode=-rw-r--r-- ,inode=882832,size=3682304,blksize=32768 }) = 0 (0x0)
    pread(0x5,0x7fffffffdad0,0x10,0x18)              = 16 (0x10)
    fstat(5,{ mode=-rw-r--r-- ,inode=882832,size=3682304,blksize=32768 }) = 0 (0x0)
    fstatat(4,"local.sqlite-wal",0x7fffffffda20,0x0) ERR#2 'No such file or directory'
    fstat(5,{ mode=-rw-r--r-- ,inode=882832,size=3682304,blksize=32768 }) = 0 (0x0)
    pread(0x5,0x803364c58,0x1000,0x5b000)            = 4096 (0x1000)
    pread(0x5,0x803363b48,0x1000,0x15000)            = 4096 (0x1000)
    pread(0x5,0x803362a38,0x1000,0x33e000)           = 4096 (0x1000)
    fcntl(5,F_SETLK,0x7fffffffde20)                  = 0 (0x0)
    getpid()                                         = 18596 (0x48a4)
    DBG(1)[18596]> cannot load files from openldap-client and (null) to check conflicts
    write(2,"DBG(1)[18596]> cannot load files"...,84) = 84 (0x54)
    SIGNAL 11 (SIGSEGV)
    process killed, signal = 11 (core dumped)

There's nothing helpful in the core dump:
Code:
    # lldb /usr/sbin/pkg      
    (lldb) target create "/usr/sbin/pkg"
    Current executable set to '/usr/sbin/pkg' (x86_64).
    (lldb) target create --core /root/pkg.core
    Core file '/root/pkg.core' (x86_64) was loaded.
    (lldb) th b
    * thread #1, name = 'pkg', stop reason = signal SIGSEGV
      * frame #0: 0x0000000800a3f393
        frame #1: 0x0000000803254a80
    (lldb)

(I tried to build ports-mgmt/pkg from
/usr/ports, but that installed 1.10.1, which then insisted
on installing 1.10.5)

The
Code:
(null)
in the pkg -d output seems broadly
consistent with the discussion in [3], but there isn't an obviously
related 'file not found' in the truss output.

Removing `/var/cacke/pkg/nss_ldap*` doesn't have any effect.

Looking at the pkg-1.10.5 source, it would appear that something is amiss
in
Code:
libpkg/pkg_jobs_conflicts.c:pkg_conflicts_need_conflict
,
but it's not obvious to me what it is, nor whether there's a file I can
either delete or dummy.

Does this stimulate an Aha! in anyone?

Best wishes,

Norman

(This is the first time I've posted here, so apologies for any formatting
glitches).




[1] https://github.com/freebsd/pkg/issues/1663
[2] https://github.com/freebsd/pkg/pull/1586
[3] https://forum.pfsense.org/index.php?topic=128154.0
[4] https://forums.freebsd.org/threads/pkg-core-dump.56957/
[5] https://forums.freebsd.org/threads/pkg-upgrade-v-segfaults-wrong-option.64768/#post-378491
 
By the way: I wasn't sure if this would be better noted here, or reported on bugs.freebsd.org, and would welcome advice.
 
I think I've seen this with http://www.ravenports.com .
We use pkg from github (the devel version) and although at least one "conflict" related segfault was fixed, I think I hit another one like you did a couple of weeks ago. I knew it was linux-specific (I was running pkg on a linux machine at the time) and was waiting for freebsd users to hit it to confirm.
 
Back
Top