Bug 245742

Summary: pkg-static: bus error when running make package
Product: Base System Reporter: Andy Mender <andymenderunix>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Only Me    
Priority: ---    
Version: 12.0-STABLE   
Hardware: amd64   
OS: Any   

Description Andy Mender 2020-04-19 13:40:00 UTC
I am working on an update to math/py-numpy and I encountered a strange error when running "make package":
root@hp-proliant:/usr/ports/math/py-numpy # make package
===>  Building package for py37-numpy-1.18.2
Child process pid=87206 terminated abnormally: Bus error
*** Error code 1

make[1]: stopped in /usr/ports/math/py-numpy
*** Error code 1

make: stopped in /usr/ports/math/py-numpy

I extracted some extra info from the core dump file via lldb:
lldb -f /usr/local/sbin/pkg-static -c pkg-static.core -bobt
warning: ignoring unknown option: -bobt
(lldb) target create "/usr/local/sbin/pkg-static" --core "pkg-static.core"
Core file '/usr/ports/math/py-numpy/pkg-static.core' (x86_64) was loaded.
(lldb) bt
* thread #1, name = 'pkg-static', stop reason = signal SIGBUS
  * frame #0: 0x000000000052e3ca pkg-static`sha256_update + 58
    frame #1: 0x00000000004e724e pkg-static`pkg_checksum_hash_sha256_file + 142
    frame #2: 0x00000000004e67d1 pkg-static`pkg_checksum_fileat + 97
    frame #3: 0x00000000004e6fe5 pkg-static`pkg_checksum_generate_fileat + 181
    frame #4: 0x00000000005392d5 pkg-static`meta_file + 517
    frame #5: 0x000000000053660c pkg-static`plist_parse_line + 332
    frame #6: 0x0000000000538478 pkg-static`ports_parse_plist + 184
    frame #7: 0x0000000000535f72 pkg-static`load_metadata + 642
    frame #8: 0x0000000000535c40 pkg-static`pkg_create + 112
    frame #9: 0x00000000003aee1c pkg-static`exec_create + 1004
    frame #10: 0x00000000003b3ab8 pkg-static`main + 2840
    frame #11: 0x00000000003a910f pkg-static`_start(ap=<unavailable>, cleanup=<unavailable>) at crt1.c:76:7

My pkg version: 1.14.2

An earlier version of the math/py-numpy port (the one currently in the Ports Collection) builds and installs properly. The only odd thing I noticed is that it doesn't have a pkg-plist file, but after generating it I get the same error.

This bug is reminiscent of bug #225412, but it has never been solved.