Date: Fri, 21 Oct 2022 15:10:59 +0200 From: Kristof Provost <kp@FreeBSD.org> To: Konstantin Belousov <kostikbel@gmail.com> Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 9cabef3d146e - main - ldd: use direct exec mode unconditionally Message-ID: <6AEBEA3C-24DD-44AA-8B59-8DCADF62CAFF@FreeBSD.org> In-Reply-To: <Y1KZjqEabsXjw0qc@kib.kiev.ua> References: <202210061550.296FoVrm088661@gitrepo.freebsd.org> <7F982005-246F-4607-A17B-08C81CE65E0B@FreeBSD.org> <Y1KVf9V4rhNmXe/R@kib.kiev.ua> <DD8C0FC6-A66D-4652-BE34-5591A9670181@FreeBSD.org> <Y1KZjqEabsXjw0qc@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
--=_MailMate_A8A0A7FF-92F0-4C4B-9ABF-013998CF623B_= Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable 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=3D9cabef3d146e9a844813b6bc8= 952d6cf2e9d45e5 >>>>> >>>>> 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=E2=80=99= 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/b= in/sqlite3" = >>>> "/wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/l= ib/libsqlite3.so=E2=80=9D`, >>>> which produces: >>>> >>>> ld-elf.so.1: = >>>> /wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bi= n/sqlite3: >>>> mmap of entire address space failed: Cannot allocate memory >>>> /wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/b= in/sqlite3: >>>> exit status 1 >>>> >>>> That fails doing the `mapbase =3D mmap(base_addr, mapsize, PROT_NONE= , >>>> base_flags, -1, 0);` call in rtld-elf=E2=80=99s map_object():217. Th= at = >>>> call >>>> does >>>> `mmap(0x10000, 0x1dc000, PROT_NONE, 0x6010, -1, 0) =3D> 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/sq= lite3" ld-elf.so.1: = /wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sql= ite3: = mmap of entire address space failed: Cannot allocate memory /wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sq= lite3: = 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>,0xf= fffffff,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=3D80, ino=3D23770, mode=3D0100644= , = nlink=3D1, uid=3D0, gid=3D0, rdev=3D1261135, atime=3D1666321328.194725000= , = mtime=3D1652350957, ctime=3D1652350957, birthtime=3D1652350957, size=3D47= , = blksize=3D32768, blocks=3D8, flags=3D0x800 } 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=3D80, ino=3D2835, mode=3D0100444,= = nlink=3D1, uid=3D0, gid=3D0, rdev=3D8036, atime=3D1666321328.195437000, = mtime=3D1666276131.094594000, ctime=3D1666276131.094619000, = birthtime=3D1666276131.094527000, size=3D235, blksize=3D32768, blocks=3D8= , = flags=3D0x0 } 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/comp= at/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=3D80, ino=3D15672, mode=3D0100444= , = nlink=3D1, uid=3D0, gid=3D0, rdev=3D100704, atime=3D1666357801.797350000,= = mtime=3D1666194814.223023000, ctime=3D1666194815.428701000, = birthtime=3D1666194814.222123000, size=3D20064, blksize=3D32768, blocks=3D= 40, = flags=3D0x800 } 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|M= AP_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|M= AP_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=3D80, ino=3D16639, mode=3D0100444= , = nlink=3D1, uid=3D0, gid=3D0, rdev=3D97392, atime=3D1666357810.182025000, = mtime=3D1666194867.046448000, ctime=3D1666194874.735000000, = birthtime=3D1666194867.045312000, size=3D76280, blksize=3D32768, blocks=3D= 152, = flags=3D0x800 } 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|M= AP_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|M= AP_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|M= AP_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=3D80, ino=3D25222, mode=3D0100444= , = nlink=3D1, uid=3D0, gid=3D0, rdev=3D224592, atime=3D1666357810.187891000,= = mtime=3D1666194516.790211000, ctime=3D1666194546.511993000, = birthtime=3D1666194516.782103000, size=3D1846240, blksize=3D32768, = blocks=3D3712, flags=3D0x20000 } 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>,0xf= fffffff,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>,0xf= fffffff,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=3D9256437506442916831, ino=3D1089= 65, = mode=3D0100644, nlink=3D1, uid=3D0, gid=3D0, rdev=3D18446744073709551615,= = atime=3D1666220606.850266000, mtime=3D1666220606.851371000, = ctime=3D1666220606.851395000, birthtime=3D1666220606.850266000, size=3D47= , = blksize=3D4096, blocks=3D1, flags=3D0x800 } 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=3D9256437506442916831, ino=3D2702= 41, = mode=3D0100444, nlink=3D1, uid=3D0, gid=3D0, rdev=3D18446744073709551615,= = atime=3D1666340848.547077000, mtime=3D1666340848.547254000, = ctime=3D1666340848.547318000, birthtime=3D1666340848.547077000, size=3D25= 2, = blksize=3D4096, blocks=3D2, flags=3D0x800 } 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/comp= at/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=3D9256437506442916831, ino=3D1090= 43, = mode=3D0100444, nlink=3D1, uid=3D0, gid=3D0, rdev=3D18446744073709551615,= = atime=3D1666260705.819655000, mtime=3D1666260705.821324000, = ctime=3D1666260705.822369000, birthtime=3D1666260705.819655000, size=3D88= 428, = blksize=3D88576, blocks=3D113, flags=3D0x800 } 95968 ldd RET fstat 0 95968 ldd CALL = mmap(0,0x1000,0x1<PROT_READ>,0x40002<MAP_PRIVATE|MAP_PREFAULT_READ>,0x3,0= x40066008,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_N= OCORE|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=3D9256437506442916831, ino=3D1092= 45, = mode=3D0100444, nlink=3D1, uid=3D0, gid=3D0, rdev=3D18446744073709551615,= = atime=3D1666260708.470966000, mtime=3D1666260708.472429000, = ctime=3D1666260708.473190000, birthtime=3D1666260708.470966000, size=3D44= 108, = blksize=3D44544, blocks=3D55, flags=3D0x800 } 95968 ldd RET fstat 0 95968 ldd CALL = mmap(0,0x1000,0x1<PROT_READ>,0x40002<MAP_PRIVATE|MAP_PREFAULT_READ>,0x3,0= x40066008,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_N= OCORE|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_F= IXED|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=3D9256437506442916831, ino=3D1091= 32, = mode=3D0100444, nlink=3D1, uid=3D0, gid=3D0, rdev=3D18446744073709551615,= = atime=3D1666260705.011622000, mtime=3D1666260705.037916000, = ctime=3D1666260705.043398000, birthtime=3D1666260705.011622000, = size=3D1708716, blksize=3D131072, blocks=3D2142, flags=3D0x20000 } 95968 ldd RET fstat 0 95968 ldd CALL = mmap(0,0x1000,0x1<PROT_READ>,0x40002<MAP_PRIVATE|MAP_PREFAULT_READ>,0x3,0= x40066008,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=3D0x2>,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|MA= P_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|MA= P_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/sq= lite3" 95968 ldd RET openat 3 95968 ldd CALL fstat(0x3,0xffffd950) 95968 ldd STRU struct stat {dev=3D18446744071679573794, ino=3D302= 1, = mode=3D0100755, nlink=3D1, uid=3D0, gid=3D0, rdev=3D18446744073709551615,= = atime=3D1666341424.915588000, mtime=3D1666341424.915588000, = ctime=3D1666341424.915588000, birthtime=3D1666341424.911595000, = size=3D1752272, blksize=3D4096, blocks=3D3424, flags=3D0x0 } 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|MA= P_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|MA= P_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|MA= P_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|MA= P_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|MA= P_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|MA= P_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|MA= P_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|MA= P_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|MA= P_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|MA= P_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|MA= P_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|MA= P_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>,0xf= fffffff,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/sq= lite3" 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=3D18446744071679573794, = ino=3D3021, mode=3D0100755, nlink=3D1, uid=3D0, gid=3D0, = rdev=3D18446744073709551615, atime=3D1666341424.915588000, = mtime=3D1666341424.915588000, ctime=3D1666341424.915588000, = birthtime=3D1666341424.911595000, size=3D1752272, blksize=3D4096, blocks=3D= 3424, = flags=3D0x0 } 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,0= x32e40,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>,0= xffffffff,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/loca= l/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/loca= l/bin/sqlite3: = exit status 1 " 95968 ldd RET write 93/0x5d 95968 ldd CALL exit(0x1) Best regards, Kristof --=_MailMate_A8A0A7FF-92F0-4C4B-9ABF-013998CF623B_= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <!DOCTYPE html> <html> <head> <meta http-equiv=3D"Content-Type" content=3D"text/xhtml; charset=3Dutf-8"= > </head> <body><div style=3D"font-family: sans-serif;"><div class=3D"markdown" sty= le=3D"white-space: normal;"> <p dir=3D"auto">On 21 Oct 2022, at 15:07, Konstantin Belousov wrote:</p> </div><div class=3D"plaintext" style=3D"white-space: normal;"><blockquote= style=3D"margin: 0 0 5px; padding-left: 5px; border-left: 2px solid #136= BCE; color: #136BCE;"><p dir=3D"auto">On Fri, Oct 21, 2022 at 02:54:59PM = +0200, Kristof Provost wrote:</p> <blockquote style=3D"margin: 0 0 5px; padding-left: 5px; border-left: 2px= solid #136BCE; border-left-color: #4B89CF; color: #4B89CF;"><p dir=3D"au= to">On 21 Oct 2022, at 14:50, Konstantin Belousov wrote:</p> <blockquote style=3D"margin: 0 0 5px; padding-left: 5px; border-left: 2px= solid #136BCE; border-left-color: #4B89CF; color: #4B89CF;"><p dir=3D"au= to">On Fri, Oct 21, 2022 at 02:18:04PM +0200, Kristof Provost wrote:</p> <blockquote style=3D"margin: 0 0 5px; padding-left: 5px; border-left: 2px= solid #136BCE; border-left-color: #4B89CF; color: #4B89CF;"><p dir=3D"au= to">On 6 Oct 2022, at 17:50, Konstantin Belousov wrote:</p> <blockquote style=3D"margin: 0 0 5px; padding-left: 5px; border-left: 2px= solid #136BCE; border-left-color: #4B89CF; color: #4B89CF;"><p dir=3D"au= to">The branch main has been updated by kib:</p> <p dir=3D"auto">URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D= 9cabef3d146e9a844813b6bc8952d6cf2e9d45e5">https://cgit.FreeBSD.org/src/co= mmit/?id=3D9cabef3d146e9a844813b6bc8952d6cf2e9d45e5</a></p> <p dir=3D"auto">commit 9cabef3d146e9a844813b6bc8952d6cf2e9d45e5 <br> Author: Konstantin Belousov <kib@FreeBSD.org> <br> AuthorDate: 2022-09-21 13:55:44 +0000 <br> Commit: Konstantin Belousov <kib@FreeBSD.org> <br> CommitDate: 2022-10-06 15:50:26 +0000</p> <p dir=3D"auto"> ldd: use direct exec mode unconditionally</p> <p dir=3D"auto"> Trying to exec malformed or unusual binary, for insta= nce, a <br> non-FreeBSD <br> ABI, or using a non-standard interpreter, might give unexpected <br> outcome.</p> <p dir=3D"auto"> Reported by: The UK's National Cyber Security Cent= re (NCSC) <br> Reviewed by: emaste, markj, philip <br> Discussed with: jhb <br> Sponsored by: The FreeBSD Foundation <br> admbug: 991 <br> PR: 127276, 175339, 231926 <br> MFC after: 1 week <br> Differential revision: <a href=3D"https://reviews.freebsd.org/D36650= ">https://reviews.freebsd.org/D36650</a></p> </blockquote><p dir=3D"auto">This appears to break things for armv7 (runn= ing on aarch64).</p> <p dir=3D"auto">This manifests while building pfsense (for 3100 / armv7),= which we <br> do on an <br> aarch64 vm (to avoid having to deal with qemu, and because it=E2=80=99s <br> faster).</p> <p dir=3D"auto">During that build a couple ports fail to build, including= <br> databases/sqlite3. <br> It fails running `/usr/bin/ldd -a "/wrkdirs/usr/ports/databases/sqlite3/w= ork-default/stage/usr/local/bin/sqlite3" "/wrkdirs/usr/ports/databases/sq= lite3/work-default/stage/usr/local/lib/libsqlite3.so=E2=80=9D`, <br> which produces:</p> <p dir=3D"auto"> ld-elf.so.1: /wrkdirs/usr/ports/databases/sqlite3/work-d= efault/stage/usr/local/bin/sqlite3: <br> mmap of entire address space failed: Cannot allocate memory <br> /wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sq= lite3: <br> exit status 1</p> <p dir=3D"auto">That fails doing the `mapbase =3D mmap(base_addr, mapsize= , PROT_NONE, <br> base_flags, -1, 0);` call in rtld-elf=E2=80=99s map_object():217. That ca= ll <br> does <br> `mmap(0x10000, 0x1dc000, PROT_NONE, 0x6010, -1, 0) =3D> 0xffffffff`.</= p> <p dir=3D"auto">With this patch reverted we can build successfully.</p> </blockquote><p dir=3D"auto">Can you manually invoke ldd on the binary un= der ktrace -i, and show me <br> the <br> kdump output?</p> </blockquote><p dir=3D"auto">I might be doing something wrong:</p> <p dir=3D"auto"> # 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" <br> ld-elf.so.1: /wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr= /local/bin/sqlite3: <br> mmap of entire address space failed: Cannot allocate memory <br> /wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sq= lite3: <br> exit status 1 <br> # kdump -f ktrace.out <br> 16 @ UNKNOWN(265) <br> kdump: data too short <br> #</p> <p dir=3D"auto">Perhaps because this is running in a jail?</p> </blockquote><p dir=3D"auto">You need to run host-native kdump, because y= our kernel is arm64, I guess.</p> <br></blockquote></div> <div class=3D"markdown" style=3D"white-space: normal;"> <p dir=3D"auto">That seemed to do the trick:</p> <pre style=3D"margin-left: 15px; margin-right: 15px; padding: 5px; border= : thin solid gray; overflow-x: auto; max-width: 90vw; background-color: #= E4E4E4;"><code style=3D"padding: 0 0.25em; background-color: #E4E4E4;">ec= 2-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/s= qlite3/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 m= emory /wrkdirs/usr/ports/databases/sqlite3/work-default/stage/usr/local/bin/sql= ite3: 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>,0x10= 02<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&= gt;) 95968 jexec NAMI "/etc/libmap.conf" 95968 jexec RET open 3 95968 jexec CALL fstat(0x3,0x68367cab3db0) 95968 jexec STRU struct stat {dev=3D80, ino=3D23770, mode=3D0100644,= nlink=3D1, uid=3D0, gid=3D0, rdev=3D1261135, atime=3D1666321328.19472500= 0, mtime=3D1652350957, ctime=3D1652350957, birthtime=3D1652350957, size=3D= 47, blksize=3D32768, blocks=3D8, flags=3D0x800 } 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&= gt;) 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......= =2E.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 |..........= =2E.....................................| 0x0060 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000= 0000 0000 0000 0000 |..........= =2E.....................| 95968 jexec RET read 128/0x80 95968 jexec CALL fstat(0x3,0x68367cab2e78) 95968 jexec STRU struct stat {dev=3D80, ino=3D2835, mode=3D0100444, = nlink=3D1, uid=3D0, gid=3D0, rdev=3D8036, atime=3D1666321328.195437000, m= time=3D1666276131.094594000, ctime=3D1666276131.094619000, birthtime=3D16= 66276131.094527000, size=3D235, blksize=3D32768, blocks=3D8, flags=3D0x0 = } 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=3D80, ino=3D15672, mode=3D0100444,= nlink=3D1, uid=3D0, gid=3D0, rdev=3D100704, atime=3D1666357801.797350000= , mtime=3D1666194814.223023000, ctime=3D1666194815.428701000, birthtime=3D= 1666194814.222123000, size=3D20064, blksize=3D32768, blocks=3D40, flags=3D= 0x800 } 95968 jexec RET fstat 0 95968 jexec CALL mmap(0,0x1000,0x1<PROT_READ>,0x40002<MAP_P= RIVATE|MAP_PREFAULT_READ>,0x3,0) 95968 jexec RET mmap 114583270346752/0x68367f205000 95968 jexec CALL mmap(0,0x35000,0<PROT_NONE>,0x2000<MAP_GUA= RD>,0xffffffff,0) 95968 jexec RET mmap 114583285628928/0x683680098000 95968 jexec CALL mmap(0x683680098000,0x2000,0x1<PROT_READ>,0x6= 0012<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_EX= EC>,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_WR= ITE>,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_WR= ITE>,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=3D80, ino=3D16639, mode=3D0100444,= nlink=3D1, uid=3D0, gid=3D0, rdev=3D97392, atime=3D1666357810.182025000,= mtime=3D1666194867.046448000, ctime=3D1666194874.735000000, birthtime=3D= 1666194867.045312000, size=3D76280, blksize=3D32768, blocks=3D152, flags=3D= 0x800 } 95968 jexec RET fstat 0 95968 jexec CALL mmap(0,0x1000,0x1<PROT_READ>,0x40002<MAP_P= RIVATE|MAP_PREFAULT_READ>,0x3,0) 95968 jexec RET mmap 114583304720384/0x6836812cd000 95968 jexec CALL mmap(0,0x44000,0<PROT_NONE>,0x2000<MAP_GUA= RD>,0xffffffff,0) 95968 jexec RET mmap 114583269560320/0x68367f145000 95968 jexec CALL mmap(0x68367f145000,0x8000,0x1<PROT_READ>,0x6= 0012<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_EX= EC>,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_WR= ITE>,0x40012<MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ>,0x3,0x1100= 0) 95968 jexec RET mmap 114583269761024/0x68367f176000 95968 jexec CALL mmap(0x68367f186000,0x2000,0x3<PROT_READ|PROT_WR= ITE>,0x40012<MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ>,0x3,0x1100= 0) 95968 jexec RET mmap 114583269826560/0x68367f186000 95968 jexec CALL mmap(0x68367f188000,0x1000,0x3<PROT_READ|PROT_WR= ITE>,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=3D80, ino=3D25222, mode=3D0100444,= nlink=3D1, uid=3D0, gid=3D0, rdev=3D224592, atime=3D1666357810.187891000= , mtime=3D1666194516.790211000, ctime=3D1666194546.511993000, birthtime=3D= 1666194516.782103000, size=3D1846240, blksize=3D32768, blocks=3D3712, fla= gs=3D0x20000 } 95968 jexec RET fstat 0 95968 jexec CALL mmap(0,0x1000,0x1<PROT_READ>,0x40002<MAP_P= RIVATE|MAP_PREFAULT_READ>,0x3,0) 95968 jexec RET mmap 114583294234624/0x6836808cd000 95968 jexec CALL mmap(0,0x421000,0<PROT_NONE>,0x2000<MAP_GU= ARD>,0xffffffff,0) 95968 jexec RET mmap 114583296851968/0x683680b4c000 95968 jexec CALL mmap(0x683680b4c000,0x7f000,0x1<PROT_READ>,0x= 60012<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_WR= ITE>,0x40012<MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ>,0x3,0x1b30= 00) 95968 jexec RET mmap 114583298764800/0x683680d1f000 95968 jexec CALL mmap(0x683680d38000,0x6000,0x3<PROT_READ|PROT_WR= ITE>,0x40012<MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ>,0x3,0x1bc0= 00) 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>,0x10= 02<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>,0x1= 5001002<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>,0xc= 001002<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>,0x1= 5001002<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&qu= ot; 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>,0x10= 02<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=3D9256437506442916831, ino=3D10896= 5, mode=3D0100644, nlink=3D1, uid=3D0, gid=3D0, rdev=3D184467440737095516= 15, atime=3D1666220606.850266000, mtime=3D1666220606.851371000, ctime=3D1= 666220606.851395000, birthtime=3D1666220606.850266000, size=3D47, blksize= =3D4096, blocks=3D1, flags=3D0x800 } 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_D= IRECTORY|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......= =2E.|.......{...........................| 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 |..........= =2E.....................................| 0x0060 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000= 0000 0000 0000 0000 |..........= =2E.....................| 95968 ldd RET read 128/0x80 95968 ldd CALL fstat(0x3,0xffffc0e0) 95968 ldd STRU struct stat {dev=3D9256437506442916831, ino=3D27024= 1, mode=3D0100444, nlink=3D1, uid=3D0, gid=3D0, rdev=3D184467440737095516= 15, atime=3D1666340848.547077000, mtime=3D1666340848.547254000, ctime=3D1= 666340848.547318000, birthtime=3D1666340848.547077000, size=3D252, blksiz= e=3D4096, blocks=3D2, flags=3D0x800 } 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_VE= RIFY>) 95968 ldd NAMI "/lib/libelf.so.2" 95968 ldd RET open 3 95968 ldd CALL fstat(0x3,0xffffc240) 95968 ldd STRU struct stat {dev=3D9256437506442916831, ino=3D10904= 3, mode=3D0100444, nlink=3D1, uid=3D0, gid=3D0, rdev=3D184467440737095516= 15, atime=3D1666260705.819655000, mtime=3D1666260705.821324000, ctime=3D1= 666260705.822369000, birthtime=3D1666260705.819655000, size=3D88428, blks= ize=3D88576, blocks=3D113, flags=3D0x800 } 95968 ldd RET fstat 0 95968 ldd CALL mmap(0,0x1000,0x1<PROT_READ>,0x40002<MAP_P= RIVATE|MAP_PREFAULT_READ>,0x3,0x40066008,0,0) 95968 ldd RET mmap 1074028544/0x40046000 95968 ldd CALL mmap(0,0x45000,0<PROT_NONE>,0x2000<MAP_GUA= RD>,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&= gt;,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&= gt;,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&= gt;,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_VE= RIFY>) 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=3D9256437506442916831, ino=3D10924= 5, mode=3D0100444, nlink=3D1, uid=3D0, gid=3D0, rdev=3D184467440737095516= 15, atime=3D1666260708.470966000, mtime=3D1666260708.472429000, ctime=3D1= 666260708.473190000, birthtime=3D1666260708.470966000, size=3D44108, blks= ize=3D44544, blocks=3D55, flags=3D0x800 } 95968 ldd RET fstat 0 95968 ldd CALL mmap(0,0x1000,0x1<PROT_READ>,0x40002<MAP_P= RIVATE|MAP_PREFAULT_READ>,0x3,0x40066008,0,0) 95968 ldd RET mmap 1074028544/0x40046000 95968 ldd CALL mmap(0,0x3b000,0<PROT_NONE>,0x2000<MAP_GUA= RD>,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&g= t;,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&= gt;,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&= gt;,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_VE= RIFY>) 95968 ldd NAMI "/lib/libc.so.7" 95968 ldd RET open 3 95968 ldd CALL fstat(0x3,0xffffc240) 95968 ldd STRU struct stat {dev=3D9256437506442916831, ino=3D10913= 2, mode=3D0100444, nlink=3D1, uid=3D0, gid=3D0, rdev=3D184467440737095516= 15, atime=3D1666260705.011622000, mtime=3D1666260705.037916000, ctime=3D1= 666260705.043398000, birthtime=3D1666260705.011622000, size=3D1708716, bl= ksize=3D131072, blocks=3D2142, flags=3D0x20000 } 95968 ldd RET fstat 0 95968 ldd CALL mmap(0,0x1000,0x1<PROT_READ>,0x40002<MAP_P= RIVATE|MAP_PREFAULT_READ>,0x3,0x40066008,0,0) 95968 ldd RET mmap 1074028544/0x40046000 95968 ldd CALL mmap(0,0x1f6000,0<PROT_NONE>,0x2000<MAP_GU= ARD>,0xffffffff,0xffffc188,0,0) 95968 ldd RET mmap 1074987008/0x40130000 95968 ldd CALL mmap(0x40130000,0x48000,0x1<PROT_READ>,0x6001= 2<MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ>,0x3,0xffffc18= 8,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>,0x= 3,0xffffc188,0x47000,0) 95968 ldd RET mmap 1075343360/0x40187000 95968 ldd CALL mmap(0x402e9000,0x5000,0x3<PROT_READ|PROT_WRITE&= gt;,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&= gt;,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=3D0x2>,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>,0x1= 5001002<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>,0xc00= 1002<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>,0xc00= 1002<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_V= ERIFY>) 95968 ldd NAMI "/wrkdirs/usr/ports/databases/sqlite3/work-def= ault/stage/usr/local/bin/sqlite3" 95968 ldd RET openat 3 95968 ldd CALL fstat(0x3,0xffffd950) 95968 ldd STRU struct stat {dev=3D18446744071679573794, ino=3D3021= , mode=3D0100755, nlink=3D1, uid=3D0, gid=3D0, rdev=3D1844674407370955161= 5, atime=3D1666341424.915588000, mtime=3D1666341424.915588000, ctime=3D16= 66341424.915588000, birthtime=3D1666341424.911595000, size=3D1752272, blk= size=3D4096, blocks=3D3424, flags=3D0x0 } 95968 ldd RET fstat 0 95968 ldd CALL mmap(0,0x1abcd0,0x1<PROT_READ>,0x2<MAP_PRI= VATE>,0x3,0xffffd904,0,0) 95968 ldd RET mmap 1080033280/0x40600000 95968 ldd CALL mmap(0,0x3000,0x3<PROT_READ|PROT_WRITE>,0xc00= 1002<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>,0xc00= 1002<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>,0xc00= 1002<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>,0xc00= 1002<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>,0xc00= 1002<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>,0xc00= 1002<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>,0xc00= 1002<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>,0xc00= 1002<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>,0xc00= 1002<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>,0xc00= 1002<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>,0xc00= 1002<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>,0xc00= 1002<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>,0= x1002<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=3D18446744071679573794, ino=3D3= 021, mode=3D0100755, nlink=3D1, uid=3D0, gid=3D0, rdev=3D1844674407370955= 1615, atime=3D1666341424.915588000, mtime=3D1666341424.915588000, ctime=3D= 1666341424.915588000, birthtime=3D1666341424.911595000, size=3D1752272, b= lksize=3D4096, blocks=3D3424, flags=3D0x0 } 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<MA= P_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&= lt;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 m= emory" 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) </code></pre> <p dir=3D"auto">Best regards,<br> Kristof</p> </div> </div> </body> </html> --=_MailMate_A8A0A7FF-92F0-4C4B-9ABF-013998CF623B_=--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6AEBEA3C-24DD-44AA-8B59-8DCADF62CAFF>