Re: port binary dumping core on recent head in poudriere [WRONG: 1500026 libsass.so.1.0.0 vs. 1500027 one]

From: Mark Millard <marklmi_at_yahoo.com>
Date: Thu, 21 Nov 2024 21:33:12 UTC
> On Nov 21, 2024, at 13:15, Mark Millard <marklmi@yahoo.com> wrote:
> 
> Summary:
> 
> Turns out in my context: libsass.so <http://libsass.so/>.1.0.0 built for
> 1500026 fails and built for 1500027 works, at least
> when used via a 1500027 world.

So much for that idea: updating the poudriere jail
to be 1500027 based and rebuilding the software
and installing it still gets the problem, despite
file showing 1500027 now.


> # file /usr/local/lib/libsass.so.1.0.0*
> /usr/local/lib/libsass.so.1.0.0:               ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, for FreeBSD 15.0 (1500026), with debug_info, not stripped
> /usr/local/lib/libsass.so.1.0.0.good-from-pkg: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, for FreeBSD 15.0 (1500027), stripped
> /usr/local/lib/libsass.so.1.0.0.orig-stripped: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, for FreeBSD 15.0 (1500026), stripped
> 
> Use of the 1500026 ones fail; use of the 1500027 one works.
> 
> FYI:
> 
> # file /usr/local/bin/sassc /usr/obj/DESTDIRs/main-amd64-pbase/usr/local/bin/sassc 
> /usr/local/bin/sassc:                                   ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 15.0 (1500026), FreeBSD-style, with debug_info, not stripped
> /usr/obj/DESTDIRs/main-amd64-pbase/usr/local/bin/sassc: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 15.0 (1500027), FreeBSD-style, stripped
> 
> 
> The details that lead to finding that out . . .
> 
> I've no got both a failing context (outside a chroot)
> and a working one (inside a PkgBase based chroot that
> got sassc and such via pkg install). So exploring . . .
> 
> Failing (the "Old value = 0x0" is odd):
> 
> Reading symbols from /usr/local/bin/sassc...
> (gdb) set radix 16
> Input and output radices now set to decimal 16, hex 10, octal 20.
> (gdb) watch -l *(unsigned long*)0x800508108
> Hardware watchpoint 1: -location *(unsigned long*)0x800508108
> (gdb) watch -l *(unsigned long*)0x800671170
> Hardware watchpoint 2: -location *(unsigned long*)0x800671170
> (gdb) run
> Starting program: /usr/local/bin/sassc  
> Hardware watchpoint 1: -location *(unsigned long*)0x800508108
> 
> Old value = 0x0
> New value = 0x800249000
> reloc_plt (obj=obj@entry=0x80022a808, flags=flags@entry=0x4, lockstate=lockstate@entry=0x0) at /usr/main-src/libexec/rtld-elf/amd64/reloc.c:343
> 343   break;
> (gdb) c
> Continuing.
> 
> Hardware watchpoint 2: -location *(unsigned long*)0x800671170
> 
> Old value = 0x39696
> New value = 0x80066e696
> reloc_plt (obj=obj@entry=0x80022e408, flags=flags@entry=0x4, lockstate=lockstate@entry=0x0) at /usr/main-src/libexec/rtld-elf/amd64/reloc.c:343
> 343   break;
> (gdb) c
> Continuing.
> 
> Program received signal SIGSEGV, Segmentation fault.
> Invalid permissions for mapped object.
> 0x0000000800249000 in ?? ()
> 
> 
> 
> Working (no odd "Old value" this time):
> (The "watchpoint 2" address is somewhat different.)
> 
> Reading symbols from /usr/local/bin/sassc...
> (No debugging symbols found in /usr/local/bin/sassc)
> (gdb) set radix 16
> Input and output radices now set to decimal 16, hex 10, octal 20.
> (gdb) watch -l *(unsigned long*)0x800508108
> Hardware watchpoint 1: -location *(unsigned long*)0x800508108
> (gdb) watch -l *(unsigned long*)0x800670170
> Hardware watchpoint 2: -location *(unsigned long*)0x800670170
> (gdb) run
> Starting program: /usr/local/bin/sassc  
> Hardware watchpoint 1: -location *(unsigned long*)0x800508108
> 
> Old value = 0x2aada6
> New value = 0x8004f3da6
> reloc_plt (obj=obj@entry=0x80022a808, flags=flags@entry=0x4, lockstate=lockstate@entry=0x0) at /home/pkgbuild/worktrees/main/libexec/rtld-elf/amd64/reloc.c:343
> 343   break;
> (gdb) c
> Continuing.
> 
> Hardware watchpoint 2: -location *(unsigned long*)0x800670170
> 
> Old value = 0x39696
> New value = 0x80066d696
> reloc_plt (obj=obj@entry=0x80022e408, flags=flags@entry=0x4, lockstate=lockstate@entry=0x0) at /home/pkgbuild/worktrees/main/libexec/rtld-elf/amd64/reloc.c:343
> 343   break;
> (gdb) c
> Continuing.
> 
> Hardware watchpoint 1: -location *(unsigned long*)0x800508108
> 
> Old value = 0x8004f3da6
> New value = 0x800648870
> reloc_jmpslot (where=where@entry=0x800508108 <acos@got[plt]>, target=target@entry=0x800648870, obj=obj@entry=0x80022e408, refobj=refobj@entry=0x80022a808, rel=rel@entry=0x8002fcf10)
>    at /home/pkgbuild/worktrees/main/libexec/rtld-elf/amd64/reloc.c:413
> 413 return (target);
> (gdb) c
> Continuing.
> Usage: /usr/local/bin/sassc [options] [INPUT] [OUTPUT]
> 
> Options:
>   -s, --stdin             Read input from standard input instead of an input file.
>   -t, --style NAME        Output style. Can be: nested, expanded, compact, compressed.
>   -l, --line-numbers      Emit comments showing original line numbers.
>       --line-comments
>   -I, --load-path PATH    Set Sass import path.
>   -P, --plugin-path PATH  Set path to autoload plugins.
>   -m, --sourcemap[=TYPE]  Emit source map (auto or inline).
>   -M, --omit-map-comment  Omits the source map url comment.
>   -p, --precision         Set the precision for numbers.
>   -a, --sass              Treat input as indented syntax.
>   -v, --version           Display compiled versions.
>   -h, --help              Display this help message.
> 
> [Inferior 1 (process 87037) exited normally]
> 
> 
> 
> Turns out that copying the /usr/local/lib/libsass.so.1.0.0
> from the working environment to the failing one makes the
> failing one work. So something about the content of
> /usr/local/lib/libsass.so.1.0.0 makes the difference.
> 
> Turns out it tracks the 1500026 vs. 1500027 distinctions
> below:
> 
> # file /usr/local/lib/libsass.so.1.0.0*
> /usr/local/lib/libsass.so.1.0.0:               ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, for FreeBSD 15.0 (1500026), with debug_info, not stripped
> /usr/local/lib/libsass.so.1.0.0.good-from-pkg: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, for FreeBSD 15.0 (1500027), stripped
> /usr/local/lib/libsass.so.1.0.0.orig-stripped: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, for FreeBSD 15.0 (1500026), stripped



===
Mark Millard
marklmi at yahoo.com


===
Mark Millard
marklmi at yahoo.com