Re: amd64->armv7 cross-build failure for security/ca_root_nss: It failed in memcpy () from /libexec/ld-elf.so.1

2020-03-23 Thread Mark Millard via freebsd-ports



On 2020-Mar-16, at 21:48, Mark Millard  wrote:

> Context: head -r358966 attempting to update ports
> to -r528535 . Also, 50+ ports built just fine
> but the below has been repeatable in my context.
> 
> The original failure was under devel/poudriere-devel (with
> nxb-bin/ materials used). But part of the below is from
> exploring with various steps in a handier context.
> 
> The original error message was:
> 
> ===
> ===>  Building for ca_root_nss-3.51
> ##  Untrusted certificates omitted from this bundle: 2
> openssl x509 failed with exit code 11 at 
> /wrkdirs/usr/ports/security/ca_root_nss/work/MAca-bundle.pl line 78.
> *** Error code 255
> 
> The original source that reported the message was:
> 
> sub printcert_info($$)
> {
>my (undef, $certdata) = @_;
>return unless $certdata;
>open(OUT, "|openssl x509 -text -inform DER -fingerprint")
>|| die "could not pipe to openssl x509";
>print OUT $certdata;
>close(OUT) or die "openssl x509 failed with exit code $?";
> }
> 
> The die produced:
> 
> -rw-r--r-- 1 root  wheel  7909376 Mar 17 03:18:04 2020 qemu_openssl.core
> 
> gdb reported for it:
> 
> Core was generated by `openssl'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  0xf501adb4 in memcpy () from /libexec/ld-elf.so.1
> 
> and:
> 
> (gdb) info threads
>  Id   Target Id Frame 
> * 1LWP 1592 "x509"   0xf501adb4 in memcpy () from /libexec/ld-elf.so.1
> 
> and:
> 
> gdb) bt
> #0  0xf501adb4 in memcpy () from /libexec/ld-elf.so.1
> #1  0xf5004cd0 in do_copy_relocations () from /libexec/ld-elf.so.1
> 
> and (from a disass):
> 
> => 0xf501adb4 <+436>: strdr4, [r3], #8
> 
> (It was not clear what code context to supply so
> I stuck to showing the instruction with the register
> used such that SIGSEGV could result from the use: r3 .)
> 
> Finally the registers were listed as holding:
> 
> (gdb) info reg
> r0 0xf4f5d57c  4109751676
> r1 0x1420
> r2 0x93000 602112
> r3 0x1 1
> r4 0x1016
> r5 0x9fffdfa4  2684346276
> r6 0xf4fe2404  4110296068
> r7 0xf4fe2004  4110295044
> r8 0x93000 602112
> r9 0x93000 602112
> r100x9fffdfe0  2684346336
> r110x0 0
> r120x9fffdf80  2684346240
> sp 0x9fffdf80  0x9fffdf80
> lr 0xf5004cd0  4110437584
> pc 0xf501adb4  0xf501adb4 
> cpsr   0x6010  1610612752
> 
> Yep: r3==1 would do it.
> 
> 
> Note: I've otherwise ignored here seeing lots of:
> 
> qemu: unsupported syscall: 574 (calling anyway)
> 
> notices while doing things for extracting
> this information.
> 
> 
> I'll note that I had no such SIGSEGV when
> ca_root_nss 3.50 built back at OSVERSION=1300077
> on 2020-Feb-16: it built and worked fine back
> then.
> 
> 
> 
> I'm not sure when I'll have time to do more with this
> or if I will again just abandon qemu-user-static for
> a time. (Insufficient time to allocate to do more?)
> Hopefully the basic information is useful to someone
> at some point.
> 
> I'm not claiming that I know qemu-user-static is the
> problem, or openssl, or whatever. Just that the
> combination is broken in my context.
> 
> Having security/ca_root_nss blocked, blocks
> cross-building lots of other things, including
> devel/llvm10 .

Using:

# poudriere bulk -j FBSDFSSDjailArmV7 -i -w ports-mgmt/portmaster

to allow trying things from inside the poudriere
build environment, I tried:

# openssl 
qemu: uncaught target signal 11 (Segmentation fault) - core dumped

# file `which openssl`
/usr/bin/openssl: ELF 32-bit LSB executable, ARM, EABI5 version 1 (FreeBSD), 
dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 13.0 
(1300084), FreeBSD-style, not stripped

The backtrace was again memcpy and do_copy_relocations.
(So "x509" had nothing to do with the inability to
run the original failed command.)

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)

___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


amd64->armv7 cross-build failure for security/ca_root_nss: It failed in memcpy () from /libexec/ld-elf.so.1

2020-03-16 Thread Mark Millard via freebsd-ports
Context: head -r358966 attempting to update ports
to -r528535 . Also, 50+ ports built just fine
but the below has been repeatable in my context.

The original failure was under devel/poudriere-devel (with
nxb-bin/ materials used). But part of the below is from
exploring with various steps in a handier context.

The original error message was:

===
===>  Building for ca_root_nss-3.51
##  Untrusted certificates omitted from this bundle: 2
openssl x509 failed with exit code 11 at 
/wrkdirs/usr/ports/security/ca_root_nss/work/MAca-bundle.pl line 78.
*** Error code 255

The original source that reported the message was:

sub printcert_info($$)
{
my (undef, $certdata) = @_;
return unless $certdata;
open(OUT, "|openssl x509 -text -inform DER -fingerprint")
|| die "could not pipe to openssl x509";
print OUT $certdata;
close(OUT) or die "openssl x509 failed with exit code $?";
}

The die produced:

-rw-r--r-- 1 root  wheel  7909376 Mar 17 03:18:04 2020 qemu_openssl.core

gdb reported for it:

Core was generated by `openssl'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0xf501adb4 in memcpy () from /libexec/ld-elf.so.1

and:

(gdb) info threads
  Id   Target Id Frame 
* 1LWP 1592 "x509"   0xf501adb4 in memcpy () from /libexec/ld-elf.so.1

and:

gdb) bt
#0  0xf501adb4 in memcpy () from /libexec/ld-elf.so.1
#1  0xf5004cd0 in do_copy_relocations () from /libexec/ld-elf.so.1

and (from a disass):

=> 0xf501adb4 <+436>:   strdr4, [r3], #8

(It was not clear what code context to supply so
I stuck to showing the instruction with the register
used such that SIGSEGV could result from the use: r3 .)

Finally the registers were listed as holding:

(gdb) info reg
r0 0xf4f5d57c  4109751676
r1 0x1420
r2 0x93000 602112
r3 0x1 1
r4 0x1016
r5 0x9fffdfa4  2684346276
r6 0xf4fe2404  4110296068
r7 0xf4fe2004  4110295044
r8 0x93000 602112
r9 0x93000 602112
r100x9fffdfe0  2684346336
r110x0 0
r120x9fffdf80  2684346240
sp 0x9fffdf80  0x9fffdf80
lr 0xf5004cd0  4110437584
pc 0xf501adb4  0xf501adb4 
cpsr   0x6010  1610612752

Yep: r3==1 would do it.


Note: I've otherwise ignored here seeing lots of:

qemu: unsupported syscall: 574 (calling anyway)

notices while doing things for extracting
this information.


I'll note that I had no such SIGSEGV when
ca_root_nss 3.50 built back at OSVERSION=1300077
on 2020-Feb-16: it built and worked fine back
then.



I'm not sure when I'll have time to do more with this
or if I will again just abandon qemu-user-static for
a time. (Insufficient time to allocate to do more?)
Hopefully the basic information is useful to someone
at some point.

I'm not claiming that I know qemu-user-static is the
problem, or openssl, or whatever. Just that the
combination is broken in my context.

Having security/ca_root_nss blocked, blocks
cross-building lots of other things, including
devel/llvm10 .



===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)

___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"