Re: git: 9cabef3d146e - main - ldd: use direct exec mode unconditionally
Date: Fri, 21 Oct 2022 13:10:59 UTC
On 21 Oct 2022, at 15:07, Konstantin Belousov wrote: > On Fri, Oct 21, 2022 at 02:54:59PM +0200, Kristof Provost wrote: >> On 21 Oct 2022, at 14:50, Konstantin Belousov wrote: >>> On Fri, Oct 21, 2022 at 02:18:04PM +0200, Kristof Provost wrote: >>>> On 6 Oct 2022, at 17:50, Konstantin Belousov wrote: >>>>> The branch main has been updated by kib: >>>>> >>>>> URL: >>>>> https://cgit.FreeBSD.org/src/commit/?id=9cabef3d146e9a844813b6bc8952d6cf2e9d45e5 >>>>> >>>>> commit 9cabef3d146e9a844813b6bc8952d6cf2e9d45e5 >>>>> Author: Konstantin Belousov <kib@FreeBSD.org> >>>>> AuthorDate: 2022-09-21 13:55:44 +0000 >>>>> Commit: Konstantin Belousov <kib@FreeBSD.org> >>>>> CommitDate: 2022-10-06 15:50:26 +0000 >>>>> >>>>> ldd: use direct exec mode unconditionally >>>>> >>>>> Trying to exec malformed or unusual binary, for instance, a >>>>> non-FreeBSD >>>>> ABI, or using a non-standard interpreter, might give >>>>> unexpected >>>>> outcome. >>>>> >>>>> Reported by: The UK's National Cyber Security Centre (NCSC) >>>>> Reviewed by: emaste, markj, philip >>>>> Discussed with: jhb >>>>> Sponsored by: The FreeBSD Foundation >>>>> admbug: 991 >>>>> PR: 127276, 175339, 231926 >>>>> MFC after: 1 week >>>>> Differential revision: https://reviews.freebsd.org/D36650 >>>>> >>>> This appears to break things for armv7 (running on aarch64). >>>> >>>> This manifests while building pfsense (for 3100 / armv7), which we >>>> do on an >>>> aarch64 vm (to avoid having to deal with qemu, and because it’s >>>> faster). >>>> >>>> During that build a couple ports fail to build, including >>>> databases/sqlite3. >>>> It fails running `/usr/bin/ldd -a >>>> "/wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sqlite3" >>>> "/wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/lib/libsqlite3.so”`, >>>> which produces: >>>> >>>> ld-elf.so.1: >>>> /wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sqlite3: >>>> mmap of entire address space failed: Cannot allocate memory >>>> /wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sqlite3: >>>> exit status 1 >>>> >>>> That fails doing the `mapbase = mmap(base_addr, mapsize, PROT_NONE, >>>> base_flags, -1, 0);` call in rtld-elf’s map_object():217. That >>>> call >>>> does >>>> `mmap(0x10000, 0x1dc000, PROT_NONE, 0x6010, -1, 0) => 0xffffffff`. >>>> >>>> With this patch reverted we can build successfully. >>> >>> Can you manually invoke ldd on the binary under ktrace -i, and show >>> me >>> the >>> kdump output? >>> >> I might be doing something wrong: >> >> # ktrace -i /usr/obj/usr/src/arm.armv7/usr.bin/ldd/ldd -a >> "/wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sqlite3" >> ld-elf.so.1: >> /wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sqlite3: >> mmap of entire address space failed: Cannot allocate memory >> /wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sqlite3: >> exit status 1 >> # kdump -f ktrace.out >> 16 @ UNKNOWN(265) >> kdump: data too short >> # >> >> Perhaps because this is running in a jail? > You need to run host-native kdump, because your kernel is arm64, I > guess. > That seemed to do the trick: ec2-user@freebsd:~/netgate/factory-ports $ sudo ktrace -i jexec 6 /usr/obj/usr/src/arm.armv7/usr.bin/ldd/ldd -a "/wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sqlite3" ld-elf.so.1: /wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sqlite3: mmap of entire address space failed: Cannot allocate memory /wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sqlite3: exit status 1 ec2-user@freebsd:~/netgate/factory-ports $ sudo kdump -f ktrace.out 95968 ktrace RET ktrace 0 95968 ktrace CALL execve(0x277259261d90,0x2772592623e0,0x277259262410) 95968 ktrace NAMI "/sbin/jexec" 95968 ktrace RET execve -1 errno 2 No such file or directory 95968 ktrace CALL execve(0x277259261d90,0x2772592623e0,0x277259262410) 95968 ktrace NAMI "/bin/jexec" 95968 ktrace RET execve -1 errno 2 No such file or directory 95968 ktrace CALL execve(0x277259261d90,0x2772592623e0,0x277259262410) 95968 ktrace NAMI "/usr/sbin/jexec" 95968 ktrace NAMI "/libexec/ld-elf.so.1" 95968 jexec RET execve JUSTRETURN 95968 jexec CALL mmap(0,0x21000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,0xffffffff,0) 95968 jexec RET mmap 114583259725824/0x68367e7e4000 95968 jexec CALL mprotect(0xaf626b66f000,0x1000,0x1<PROT_READ>) 95968 jexec RET mprotect 0 95968 jexec CALL issetugid 95968 jexec RET issetugid 0 95968 jexec CALL sigfastblock(0x1,0xaf626b680d10) 95968 jexec RET sigfastblock 0 95968 jexec CALL open(0xaf626b63935c,0x100000<O_RDONLY|O_CLOEXEC>) 95968 jexec NAMI "/etc/libmap.conf" 95968 jexec RET open 3 95968 jexec CALL fstat(0x3,0x68367cab3db0) 95968 jexec STRU struct stat {dev=80, ino=23770, mode=0100644, nlink=1, uid=0, gid=0, rdev=1261135, atime=1666321328.194725000, mtime=1652350957, ctime=1652350957, birthtime=1652350957, size=47, blksize=32768, blocks=8, flags=0x800 } 95968 jexec RET fstat 0 95968 jexec CALL read(0x3,0x68367e7e8008,0x2f) 95968 jexec GIO fd 3 read 47 bytes "# $FreeBSD$ includedir /usr/local/etc/libmap.d " 95968 jexec RET read 47/0x2f 95968 jexec CALL close(0x3) 95968 jexec RET close 0 95968 jexec CALL open(0x68367cab3143,0x120004<O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC>) 95968 jexec NAMI "/usr/local/etc/libmap.d" 95968 jexec RET open -1 errno 2 No such file or directory 95968 jexec CALL open(0xaf626b6397e8,0x100000<O_RDONLY|O_CLOEXEC>) 95968 jexec NAMI "/var/run/ld-elf.so.hints" 95968 jexec RET open 3 95968 jexec CALL read(0x3,0xaf626b680ba0,0x80) 95968 jexec GIO fd 3 read 128 bytes 0x0000 4568 6e74 0100 0000 8000 0000 6b00 0000 0000 0000 6a00 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |Ehnt........k.......j...........................| 0x0030 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |................................................| 0x0060 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |................................| 95968 jexec RET read 128/0x80 95968 jexec CALL fstat(0x3,0x68367cab2e78) 95968 jexec STRU struct stat {dev=80, ino=2835, mode=0100444, nlink=1, uid=0, gid=0, rdev=8036, atime=1666321328.195437000, mtime=1666276131.094594000, ctime=1666276131.094619000, birthtime=1666276131.094527000, size=235, blksize=32768, blocks=8, flags=0x0 } 95968 jexec RET fstat 0 95968 jexec CALL pread(0x3,0x68367e7e9008,0x6b,0x80) 95968 jexec GIO fd 3 read 107 bytes "/lib:/usr/lib:/usr/lib/compat:/usr/local/lib:/usr/local/lib/compat/pkg:/usr/local/lib/perl5/5.32/mach/CORE\0" 95968 jexec RET pread 107/0x6b 95968 jexec CALL close(0x3) 95968 jexec RET close 0 95968 jexec CALL open(0x68367e7ea008,0x300000<O_RDONLY|O_CLOEXEC|O_VERIFY>) 95968 jexec NAMI "/lib/libjail.so.1" 95968 jexec RET open 3 95968 jexec CALL fstat(0x3,0x68367cab3040) 95968 jexec STRU struct stat {dev=80, ino=15672, mode=0100444, nlink=1, uid=0, gid=0, rdev=100704, atime=1666357801.797350000, mtime=1666194814.223023000, ctime=1666194815.428701000, birthtime=1666194814.222123000, size=20064, blksize=32768, blocks=40, flags=0x800 } 95968 jexec RET fstat 0 95968 jexec CALL mmap(0,0x1000,0x1<PROT_READ>,0x40002<MAP_PRIVATE|MAP_PREFAULT_READ>,0x3,0) 95968 jexec RET mmap 114583270346752/0x68367f205000 95968 jexec CALL mmap(0,0x35000,0<PROT_NONE>,0x2000<MAP_GUARD>,0xffffffff,0) 95968 jexec RET mmap 114583285628928/0x683680098000 95968 jexec CALL mmap(0x683680098000,0x2000,0x1<PROT_READ>,0x60012<MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ>,0x3,0) 95968 jexec RET mmap 114583285628928/0x683680098000 95968 jexec CALL mmap(0x6836800a9000,0x4000,0x5<PROT_READ|PROT_EXEC>,0x60012<MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ>,0x3,0x1000) 95968 jexec RET mmap 114583285698560/0x6836800a9000 95968 jexec CALL mmap(0x6836800bc000,0x1000,0x3<PROT_READ|PROT_WRITE>,0x40012<MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ>,0x3,0x4000) 95968 jexec RET mmap 114583285776384/0x6836800bc000 95968 jexec CALL mmap(0x6836800cc000,0x1000,0x3<PROT_READ|PROT_WRITE>,0x40012<MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ>,0x3,0x4000) 95968 jexec RET mmap 114583285841920/0x6836800cc000 95968 jexec CALL munmap(0x68367f205000,0x1000) 95968 jexec RET munmap 0 95968 jexec CALL close(0x3) 95968 jexec RET close 0 95968 jexec CALL open(0x68367e7ea008,0x300000<O_RDONLY|O_CLOEXEC|O_VERIFY>) 95968 jexec NAMI "/lib/libutil.so.9" 95968 jexec RET open 3 95968 jexec CALL fstat(0x3,0x68367cab3040) 95968 jexec STRU struct stat {dev=80, ino=16639, mode=0100444, nlink=1, uid=0, gid=0, rdev=97392, atime=1666357810.182025000, mtime=1666194867.046448000, ctime=1666194874.735000000, birthtime=1666194867.045312000, size=76280, blksize=32768, blocks=152, flags=0x800 } 95968 jexec RET fstat 0 95968 jexec CALL mmap(0,0x1000,0x1<PROT_READ>,0x40002<MAP_PRIVATE|MAP_PREFAULT_READ>,0x3,0) 95968 jexec RET mmap 114583304720384/0x6836812cd000 95968 jexec CALL mmap(0,0x44000,0<PROT_NONE>,0x2000<MAP_GUARD>,0xffffffff,0) 95968 jexec RET mmap 114583269560320/0x68367f145000 95968 jexec CALL mmap(0x68367f145000,0x8000,0x1<PROT_READ>,0x60012<MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ>,0x3,0) 95968 jexec RET mmap 114583269560320/0x68367f145000 95968 jexec CALL mmap(0x68367f15c000,0xb000,0x5<PROT_READ|PROT_EXEC>,0x60012<MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ>,0x3,0x7000) 95968 jexec RET mmap 114583269654528/0x68367f15c000 95968 jexec CALL mmap(0x68367f176000,0x1000,0x3<PROT_READ|PROT_WRITE>,0x40012<MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ>,0x3,0x11000) 95968 jexec RET mmap 114583269761024/0x68367f176000 95968 jexec CALL mmap(0x68367f186000,0x2000,0x3<PROT_READ|PROT_WRITE>,0x40012<MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ>,0x3,0x11000) 95968 jexec RET mmap 114583269826560/0x68367f186000 95968 jexec CALL mmap(0x68367f188000,0x1000,0x3<PROT_READ|PROT_WRITE>,0x1012<MAP_PRIVATE|MAP_FIXED|MAP_ANON>,0xffffffff,0) 95968 jexec RET mmap 114583269834752/0x68367f188000 95968 jexec CALL munmap(0x6836812cd000,0x1000) 95968 jexec RET munmap 0 95968 jexec CALL close(0x3) 95968 jexec RET close 0 95968 jexec CALL open(0x68367e7ea008,0x300000<O_RDONLY|O_CLOEXEC|O_VERIFY>) 95968 jexec NAMI "/lib/libc.so.7" 95968 jexec RET open 3 95968 jexec CALL fstat(0x3,0x68367cab3040) 95968 jexec STRU struct stat {dev=80, ino=25222, mode=0100444, nlink=1, uid=0, gid=0, rdev=224592, atime=1666357810.187891000, mtime=1666194516.790211000, ctime=1666194546.511993000, birthtime=1666194516.782103000, size=1846240, blksize=32768, blocks=3712, flags=0x20000 } 95968 jexec RET fstat 0 95968 jexec CALL mmap(0,0x1000,0x1<PROT_READ>,0x40002<MAP_PRIVATE|MAP_PREFAULT_READ>,0x3,0) 95968 jexec RET mmap 114583294234624/0x6836808cd000 95968 jexec CALL mmap(0,0x421000,0<PROT_NONE>,0x2000<MAP_GUARD>,0xffffffff,0) 95968 jexec RET mmap 114583296851968/0x683680b4c000 95968 jexec CALL mmap(0x683680b4c000,0x7f000,0x1<PROT_READ>,0x60012<MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ>,0x3,0) 95968 jexec RET mmap 114583296851968/0x683680b4c000 95968 jexec CALL mmap(0x683680bda000,0x136000,0x5<PROT_READ|PROT_EXEC>,0x60012<MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ>,0x3,0x7e000) 95968 jexec RET mmap 114583297433600/0x683680bda000 95968 jexec CALL mmap(0x683680d1f000,0xa000,0x3<PROT_READ|PROT_WRITE>,0x40012<MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ>,0x3,0x1b3000) 95968 jexec RET mmap 114583298764800/0x683680d1f000 95968 jexec CALL mmap(0x683680d38000,0x6000,0x3<PROT_READ|PROT_WRITE>,0x40012<MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ>,0x3,0x1bc000) 95968 jexec RET mmap 114583298867200/0x683680d38000 95968 jexec CALL mmap(0x683680d3e000,0x22f000,0x3<PROT_READ|PROT_WRITE>,0x1012<MAP_PRIVATE|MAP_FIXED|MAP_ANON>,0xffffffff,0) 95968 jexec RET mmap 114583298891776/0x683680d3e000 95968 jexec CALL munmap(0x6836808cd000,0x1000) 95968 jexec RET munmap 0 95968 jexec CALL close(0x3) 95968 jexec RET close 0 95968 jexec CALL mprotect(0x683680d1f000,0x9000,0x1<PROT_READ>) 95968 jexec RET mprotect 0 95968 jexec CALL munmap(0x68367e7fe000,0x7000) 95968 jexec RET munmap 0 95968 jexec CALL mmap(0,0x28000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,0xffffffff,0) 95968 jexec RET mmap 114583301312512/0x683680f8d000 95968 jexec CALL readlink(0x683680b93792,0x68367cab35ac,0x400) 95968 jexec NAMI "/etc/malloc.conf" 95968 jexec RET readlink -1 errno 2 No such file or directory 95968 jexec CALL issetugid 95968 jexec RET issetugid 0 95968 jexec CALL mmap(0,0x200000,0x3<PROT_READ|PROT_WRITE>,0x15001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21)>,0xffffffff,0) 95968 jexec RET mmap 114583305977856/0x683681400000 95968 jexec CALL mmap(0,0x200000,0x3<PROT_READ|PROT_WRITE>,0xc001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12)>,0xffffffff,0) 95968 jexec RET mmap 114583324471296/0x6836825a3000 95968 jexec CALL mmap(0,0x400000,0x3<PROT_READ|PROT_WRITE>,0x15001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21)>,0xffffffff,0) 95968 jexec RET mmap 114583329046528/0x683682a00000 95968 jexec CALL jail_get(0x68367cab4b18,0x4,0) 95968 jexec RET jail_get 6 95968 jexec CALL jail_attach(0x6) 95968 jexec RET jail_attach 0 95968 jexec CALL chdir(0x6835fc830cd7) 95968 jexec NAMI "/" 95968 jexec RET chdir 0 95968 jexec CALL execve(0x68367cab4f30,0x68367cab4c48,0x68367cab4c68) 95968 jexec NAMI "/usr/obj/usr/src/arm.armv7/usr.bin/ldd/ldd" 95968 jexec NAMI "/libexec/ld-elf32.so.1" 95968 jexec NAMI "/libexec/ld-elf.so.1" 95968 ldd RET execve JUSTRETURN 95968 ldd CALL mmap(0,0x21000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,0xffffffff,0,0,0) 95968 ldd RET mmap 1074327552/0x4008f000 95968 ldd CALL mprotect(0x4007d000,0x1000,0x1<PROT_READ>) 95968 ldd RET mprotect 0 95968 ldd CALL issetugid 95968 ldd RET issetugid 0 95968 ldd CALL sigfastblock(0x1,0x4008df70) 95968 ldd RET sigfastblock 0 95968 ldd CALL open(0x400440f1,0x100000<O_RDONLY|O_CLOEXEC>) 95968 ldd NAMI "/etc/libmap.conf" 95968 ldd RET open 3 95968 ldd CALL fstat(0x3,0xffffcf80) 95968 ldd STRU struct stat {dev=9256437506442916831, ino=108965, mode=0100644, nlink=1, uid=0, gid=0, rdev=18446744073709551615, atime=1666220606.850266000, mtime=1666220606.851371000, ctime=1666220606.851395000, birthtime=1666220606.850266000, size=47, blksize=4096, blocks=1, flags=0x800 } 95968 ldd RET fstat 0 95968 ldd CALL read(0x3,0x40094004,0x2f) 95968 ldd GIO fd 3 read 47 bytes "# $FreeBSD$ includedir /usr/local/etc/libmap.d " 95968 ldd RET read 47/0x2f 95968 ldd CALL close(0x3) 95968 ldd RET close 0 95968 ldd CALL open(0xffffc346,0x120004<O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC>) 95968 ldd NAMI "/usr/local/etc/libmap.d" 95968 ldd RET open -1 errno 2 No such file or directory 95968 ldd CALL open(0x40044593,0x100000<O_RDONLY|O_CLOEXEC>) 95968 ldd NAMI "/var/run/ld-elf.so.hints" 95968 ldd RET open 3 95968 ldd CALL read(0x3,0x4008de74,0x80) 95968 ldd GIO fd 3 read 128 bytes 0x0000 4568 6e74 0100 0000 8000 0000 7c00 0000 0000 0000 7b00 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |Ehnt........|.......{...........................| 0x0030 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |................................................| 0x0060 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 |................................| 95968 ldd RET read 128/0x80 95968 ldd CALL fstat(0x3,0xffffc0e0) 95968 ldd STRU struct stat {dev=9256437506442916831, ino=270241, mode=0100444, nlink=1, uid=0, gid=0, rdev=18446744073709551615, atime=1666340848.547077000, mtime=1666340848.547254000, ctime=1666340848.547318000, birthtime=1666340848.547077000, size=252, blksize=4096, blocks=2, flags=0x800 } 95968 ldd RET fstat 0 95968 ldd CALL pread(0x3,0x40090004,0x7c,0,0x80,0) 95968 ldd GIO fd 3 read 124 bytes "/lib:/usr/lib:/usr/lib/compat:/usr/local/lib:/usr/local/lib/compat/pkg:/usr/lib/engines:/usr/local/lib/perl5/5.32/mach/CORE\0" 95968 ldd RET pread 124/0x7c 95968 ldd CALL close(0x3) 95968 ldd RET close 0 95968 ldd CALL open(0x40095004,0x300000<O_RDONLY|O_CLOEXEC|O_VERIFY>) 95968 ldd NAMI "/lib/libelf.so.2" 95968 ldd RET open 3 95968 ldd CALL fstat(0x3,0xffffc240) 95968 ldd STRU struct stat {dev=9256437506442916831, ino=109043, mode=0100444, nlink=1, uid=0, gid=0, rdev=18446744073709551615, atime=1666260705.819655000, mtime=1666260705.821324000, ctime=1666260705.822369000, birthtime=1666260705.819655000, size=88428, blksize=88576, blocks=113, flags=0x800 } 95968 ldd RET fstat 0 95968 ldd CALL mmap(0,0x1000,0x1<PROT_READ>,0x40002<MAP_PRIVATE|MAP_PREFAULT_READ>,0x3,0x40066008,0,0) 95968 ldd RET mmap 1074028544/0x40046000 95968 ldd CALL mmap(0,0x45000,0<PROT_NONE>,0x2000<MAP_GUARD>,0xffffffff,0x40043ede,0,0) 95968 ldd RET mmap 1074462720/0x400b0000 95968 ldd CALL mmap(0x400b0000,0x3000,0x1<PROT_READ>,0x60012<MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ>,0x3,0x40043ede,0,0) 95968 ldd RET mmap 1074462720/0x400b0000 95968 ldd CALL mmap(0x400c2000,0x13000,0x5<PROT_READ|PROT_EXEC>,0x60012<MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ>,0x3,0x40043ede,0x2000,0) 95968 ldd RET mmap 1074536448/0x400c2000 95968 ldd CALL mmap(0x400e4000,0x1000,0x3<PROT_READ|PROT_WRITE>,0x40012<MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ>,0x3,0x40043ede,0x14000,0) 95968 ldd RET mmap 1074675712/0x400e4000 95968 ldd CALL mmap(0x400f4000,0x1000,0x3<PROT_READ|PROT_WRITE>,0x40012<MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ>,0x3,0x40043ede,0x14000,0) 95968 ldd RET mmap 1074741248/0x400f4000 95968 ldd CALL munmap(0x40046000,0x1000) 95968 ldd RET munmap 0 95968 ldd CALL close(0x3) 95968 ldd RET close 0 95968 ldd CALL open(0x40095004,0x300000<O_RDONLY|O_CLOEXEC|O_VERIFY>) 95968 ldd NAMI "/lib/libgcc_s.so.1" 95968 ldd RET open 3 95968 ldd CALL fstat(0x3,0xffffc240) 95968 ldd STRU struct stat {dev=9256437506442916831, ino=109245, mode=0100444, nlink=1, uid=0, gid=0, rdev=18446744073709551615, atime=1666260708.470966000, mtime=1666260708.472429000, ctime=1666260708.473190000, birthtime=1666260708.470966000, size=44108, blksize=44544, blocks=55, flags=0x800 } 95968 ldd RET fstat 0 95968 ldd CALL mmap(0,0x1000,0x1<PROT_READ>,0x40002<MAP_PRIVATE|MAP_PREFAULT_READ>,0x3,0x40066008,0,0) 95968 ldd RET mmap 1074028544/0x40046000 95968 ldd CALL mmap(0,0x3b000,0<PROT_NONE>,0x2000<MAP_GUARD>,0xffffffff,0x40043ede,0,0) 95968 ldd RET mmap 1074745344/0x400f5000 95968 ldd CALL mmap(0x400f5000,0x3000,0x1<PROT_READ>,0x60012<MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ>,0x3,0x40043ede,0,0) 95968 ldd RET mmap 1074745344/0x400f5000 95968 ldd CALL mmap(0x40107000,0x9000,0x5<PROT_READ|PROT_EXEC>,0x60012<MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ>,0x3,0x40043ede,0x2000,0) 95968 ldd RET mmap 1074819072/0x40107000 95968 ldd CALL mmap(0x4011f000,0x1000,0x3<PROT_READ|PROT_WRITE>,0x40012<MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ>,0x3,0x40043ede,0xa000,0) 95968 ldd RET mmap 1074917376/0x4011f000 95968 ldd CALL mmap(0x4012f000,0x1000,0x3<PROT_READ|PROT_WRITE>,0x40012<MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ>,0x3,0x40043ede,0xa000,0) 95968 ldd RET mmap 1074982912/0x4012f000 95968 ldd CALL munmap(0x40046000,0x1000) 95968 ldd RET munmap 0 95968 ldd CALL close(0x3) 95968 ldd RET close 0 95968 ldd CALL open(0x40095004,0x300000<O_RDONLY|O_CLOEXEC|O_VERIFY>) 95968 ldd NAMI "/lib/libc.so.7" 95968 ldd RET open 3 95968 ldd CALL fstat(0x3,0xffffc240) 95968 ldd STRU struct stat {dev=9256437506442916831, ino=109132, mode=0100444, nlink=1, uid=0, gid=0, rdev=18446744073709551615, atime=1666260705.011622000, mtime=1666260705.037916000, ctime=1666260705.043398000, birthtime=1666260705.011622000, size=1708716, blksize=131072, blocks=2142, flags=0x20000 } 95968 ldd RET fstat 0 95968 ldd CALL mmap(0,0x1000,0x1<PROT_READ>,0x40002<MAP_PRIVATE|MAP_PREFAULT_READ>,0x3,0x40066008,0,0) 95968 ldd RET mmap 1074028544/0x40046000 95968 ldd CALL mmap(0,0x1f6000,0<PROT_NONE>,0x2000<MAP_GUARD>,0xffffffff,0xffffc188,0,0) 95968 ldd RET mmap 1074987008/0x40130000 95968 ldd CALL mmap(0x40130000,0x48000,0x1<PROT_READ>,0x60012<MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ>,0x3,0xffffc188,0,0) 95968 ldd RET mmap 1074987008/0x40130000 95968 ldd CALL mmap(0x40187000,0x153000,0x5<PROT_READ|PROT_EXEC>,0x60012<MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ>,0x3,0xffffc188,0x47000,0) 95968 ldd RET mmap 1075343360/0x40187000 95968 ldd CALL mmap(0x402e9000,0x5000,0x3<PROT_READ|PROT_WRITE>,0x40012<MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ>,0x3,0xffffc188,0x199000,0) 95968 ldd RET mmap 1076793344/0x402e9000 95968 ldd CALL mmap(0x402fd000,0x4000,0x3<PROT_READ|PROT_WRITE>,0x40012<MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ>,0x3,0xffffc188,0x19d000,0) 95968 ldd RET mmap 1076875264/0x402fd000 95968 ldd CALL mmap(0x40301000,0x25000,0x3<PROT_READ|PROT_WRITE>,0x1012<MAP_PRIVATE|MAP_FIXED|MAP_ANON>,0xffffffff,0xffffc188,0,0) 95968 ldd RET mmap 1076891648/0x40301000 95968 ldd CALL munmap(0x40046000,0x1000) 95968 ldd RET munmap 0 95968 ldd CALL close(0x3) 95968 ldd RET close 0 95968 ldd CALL mprotect(0x402e9000,0x4000,0x1<PROT_READ>) 95968 ldd RET mprotect 0 95968 ldd CALL sysarch(<invalid=0x2>,0x4009f010) 95968 ldd RET sysarch 0 95968 ldd CALL __sysctl(0xffffcc2c,0x2,0x40303698,0xffffcc28,0,0) 95968 ldd SCTL "hw.10" 95968 ldd RET __sysctl -1 errno 2 No such file or directory 95968 ldd CALL readlink(0x4016edaf,0xffffc7f7,0x400) 95968 ldd NAMI "/etc/malloc.conf" 95968 ldd RET readlink -1 errno 2 No such file or directory 95968 ldd CALL issetugid 95968 ldd RET issetugid 0 95968 ldd CALL mmap(0,0x200000,0x3<PROT_READ|PROT_WRITE>,0x15001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21)>,0xffffffff,0xb,0,0) 95968 ldd RET mmap 1077936128/0x40400000 95968 ldd CALL clock_gettime(0x4,0xffffbac0) 95968 ldd RET clock_gettime 0 95968 ldd CALL clock_gettime(0x4,0xffffbac0) 95968 ldd RET clock_gettime 0 95968 ldd CALL clock_gettime(0x4,0xffffbae0) 95968 ldd RET clock_gettime 0 95968 ldd CALL mmap(0,0x5000,0x3<PROT_READ|PROT_WRITE>,0xc001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12)>,0xffffffff,0x404028a8,0,0) 95968 ldd RET mmap 1074028544/0x40046000 95968 ldd CALL mmap(0,0x1000,0x3<PROT_READ|PROT_WRITE>,0xc001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12)>,0xffffffff,0x404028a8,0,0) 95968 ldd RET mmap 1074049024/0x4004b000 95968 ldd CALL openat(AT_FDCWD,0xffffdd6e,0x200000<O_RDONLY|O_VERIFY>) 95968 ldd NAMI "/wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sqlite3" 95968 ldd RET openat 3 95968 ldd CALL fstat(0x3,0xffffd950) 95968 ldd STRU struct stat {dev=18446744071679573794, ino=3021, mode=0100755, nlink=1, uid=0, gid=0, rdev=18446744073709551615, atime=1666341424.915588000, mtime=1666341424.915588000, ctime=1666341424.915588000, birthtime=1666341424.911595000, size=1752272, blksize=4096, blocks=3424, flags=0x0 } 95968 ldd RET fstat 0 95968 ldd CALL mmap(0,0x1abcd0,0x1<PROT_READ>,0x2<MAP_PRIVATE>,0x3,0xffffd904,0,0) 95968 ldd RET mmap 1080033280/0x40600000 95968 ldd CALL mmap(0,0x3000,0x3<PROT_READ|PROT_WRITE>,0xc001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12)>,0xffffffff,0x404028a8,0,0) 95968 ldd RET mmap 1074053120/0x4004c000 95968 ldd CALL mmap(0,0x7000,0x3<PROT_READ|PROT_WRITE>,0xc001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12)>,0xffffffff,0x404028a8,0,0) 95968 ldd RET mmap 1074192384/0x4006e000 95968 ldd CALL mmap(0,0x3000,0x3<PROT_READ|PROT_WRITE>,0xc001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12)>,0xffffffff,0x404028a8,0,0) 95968 ldd RET mmap 1074065408/0x4004f000 95968 ldd CALL munmap(0x40600000,0x1abcd0) 95968 ldd RET munmap 0 95968 ldd CALL close(0x3) 95968 ldd RET close 0 95968 ldd CALL mmap(0,0x5000,0x3<PROT_READ|PROT_WRITE>,0xc001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12)>,0xffffffff,0x404028a8,0,0) 95968 ldd RET mmap 1074221056/0x40075000 95968 ldd CALL mmap(0,0x1000,0x3<PROT_READ|PROT_WRITE>,0xc001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12)>,0xffffffff,0x404028a8,0,0) 95968 ldd RET mmap 1074077696/0x40052000 95968 ldd CALL mmap(0,0x3000,0x3<PROT_READ|PROT_WRITE>,0xc001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12)>,0xffffffff,0x404028a8,0,0) 95968 ldd RET mmap 1074241536/0x4007a000 95968 ldd CALL mmap(0,0x3000,0x3<PROT_READ|PROT_WRITE>,0xc001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12)>,0xffffffff,0x404028a8,0,0) 95968 ldd RET mmap 1074257920/0x4007e000 95968 ldd CALL mmap(0,0x3000,0x3<PROT_READ|PROT_WRITE>,0xc001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12)>,0xffffffff,0x404028a8,0,0) 95968 ldd RET mmap 1074270208/0x40081000 95968 ldd CALL mmap(0,0x7000,0x3<PROT_READ|PROT_WRITE>,0xc001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12)>,0xffffffff,0x404028a8,0,0) 95968 ldd RET mmap 1074282496/0x40084000 95968 ldd CALL mmap(0,0x1000,0x3<PROT_READ|PROT_WRITE>,0xc001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12)>,0xffffffff,0x404028a8,0,0) 95968 ldd RET mmap 1074081792/0x40053000 95968 ldd CALL mmap(0,0x1000,0x3<PROT_READ|PROT_WRITE>,0xc001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12)>,0xffffffff,0x404028a8,0,0) 95968 ldd RET mmap 1074085888/0x40054000 95968 ldd CALL mmap(0,0x5000,0x3<PROT_READ|PROT_WRITE>,0xc001002<MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12)>,0xffffffff,0x404028a8,0,0) 95968 ldd RET mmap 1077043200/0x40326000 95968 ldd CALL fork 95968 ldd RET fork 95969/0x176e1 95969 ldd RET fork 0 95968 ldd CALL wait4(0xffffffff,0xffffdaac,0,0) 95969 ldd CALL execve(0x10ca4,0xffffda28,0x40084000) 95969 ldd NAMI "/libexec/ld-elf.so.1" 95969 ld-elf.so.1 RET execve JUSTRETURN 95969 ld-elf.so.1 CALL mmap(0,0x21000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,0xffffffff,0,0,0) 95969 ld-elf.so.1 RET mmap 1074126848/0x4005e000 95969 ld-elf.so.1 CALL mprotect(0x4e000,0x1000,0x1<PROT_READ>) 95969 ld-elf.so.1 RET mprotect 0 95969 ld-elf.so.1 CALL issetugid 95969 ld-elf.so.1 RET issetugid 0 95969 ld-elf.so.1 CALL open(0xffffdbdc,0x300000<O_RDONLY|O_CLOEXEC|O_VERIFY>) 95969 ld-elf.so.1 NAMI "/wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sqlite3" 95969 ld-elf.so.1 RET open 3 95969 ld-elf.so.1 CALL fstat(0x3,0xffffd360) 95969 ld-elf.so.1 STRU struct stat {dev=18446744071679573794, ino=3021, mode=0100755, nlink=1, uid=0, gid=0, rdev=18446744073709551615, atime=1666341424.915588000, mtime=1666341424.915588000, ctime=1666341424.915588000, birthtime=1666341424.911595000, size=1752272, blksize=4096, blocks=3424, flags=0x0 } 95969 ld-elf.so.1 RET fstat 0 95969 ld-elf.so.1 CALL geteuid 95969 ld-elf.so.1 RET geteuid 0 95969 ld-elf.so.1 CALL sigfastblock(0x1,0x5ef70) 95969 ld-elf.so.1 RET sigfastblock 0 95969 ld-elf.so.1 CALL mmap(0,0x1000,0x1<PROT_READ>,0x40002<MAP_PRIVATE|MAP_PREFAULT_READ>,0x3,0x32e40,0,0) 95969 ld-elf.so.1 RET mmap 1074262016/0x4007f000 95969 ld-elf.so.1 CALL mmap(0x10000,0x1dc000,0<PROT_NONE>,0x6010<MAP_FIXED|MAP_GUARD|MAP_EXCL>,0xffffffff,0,0,0) 95969 ld-elf.so.1 RET mmap -1 errno 12 Cannot allocate memory 95969 ld-elf.so.1 CALL munmap(0x4007f000,0x1000) 95969 ld-elf.so.1 RET munmap 0 95969 ld-elf.so.1 CALL close(0x3) 95969 ld-elf.so.1 RET close 0 95969 ld-elf.so.1 CALL write(0x2,0x144a3,0xd) 95969 ld-elf.so.1 GIO fd 2 wrote 13 bytes "ld-elf.so.1: " 95969 ld-elf.so.1 RET write 13/0xd 95969 ld-elf.so.1 CALL write(0x2,0x5ef84,0x8a) 95969 ld-elf.so.1 GIO fd 2 wrote 138 bytes "/wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sqlite3: mmap of entire address space failed: Cannot allocate memory" 95969 ld-elf.so.1 RET write 138/0x8a 95969 ld-elf.so.1 CALL write(0x2,0xffffceef,0x1) 95969 ld-elf.so.1 GIO fd 2 wrote 1 byte " " 95969 ld-elf.so.1 RET write 1 95969 ld-elf.so.1 CALL exit(0x1) 95968 ldd RET wait4 95969/0x176e1 95968 ldd CALL write(0x2,0xffffd4e0,0x5d) 95968 ldd GIO fd 2 wrote 93 bytes "/wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sqlite3: exit status 1 " 95968 ldd RET write 93/0x5d 95968 ldd CALL exit(0x1) Best regards, Kristof