Re: armv7 main's gpart [show]: signal 11 core dump during boot, before login; xo_format_string_direct; official pkgbase distribution (kernel and world)
- Reply: Mark Millard : "Re: armv7 main's gpart [show]: signal 11 core dump during boot, before login; xo_format_string_direct; official pkgbase distribution (kernel and world)"
- In reply to: Mark Millard : "armv7 main's gpart: signal 11 core dump during boot, before login; xo_format_string_direct; official pkgbase distribution (kernel and world)"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 28 Dec 2025 07:35:07 UTC
On Dec 27, 2025, at 22:03, Mark Millard <marklmi@yahoo.com> wrote:
> Context:
>
> # uname -apKU
> FreeBSD OPiP2E-RPi2v1p1 16.0-CURRENT FreeBSD 16.0-CURRENT main-n282732-939ac0c8fde2 GENERIC-NODEBUG arm armv7 1600007 1600007
>
> That is an official pkgbase distribution that I installed, not
> a personal build. pkgbase for main has world being a debug
> build, no matter which of the kernels one choses to boot.
> For pkgbase, 939ac0c8fde2 would be correct(?) for the kernel
> but might not be exact for the world: /usr/src/sys/ and
> /usr/src/ (without sys/) are from different times, last I
> knew anyway. Changes can happen between.
>
> During boot, the time on the Orange Pi Plus 2ed is bad so:
>
> # ls -lodT /gpart.core
> -rw------- 1 root wheel nodump 3174400 Jan 1 00:01:01 2010 /gpart.core
>
> Also, for pkgbase, a source file distributed can be newer
> for its time stamp than the program distributed that was
> based on the source file. Such happens below.
>
>
>
> Core was generated by `gpart show'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> Address not mapped to object.
> #0 xo_format_string_direct (xop=xop@entry=0x2009b120, xbp=xbp@entry=0x2009b150, flags=flags@entry=4096, wcp=0x0, cp=0x6e480000 <error: Cannot access memory at address 0x6e480000>, len=-1, max=-1,
> need_enc=3, have_enc=2) at /usr/src/contrib/libxo/libxo/libxo.c:2715
>
> warning: Source file is more recent than executable.
> 2715 if (*cp == '\0')
> (gdb) bt
> #0 xo_format_string_direct (xop=xop@entry=0x2009b120, xbp=xbp@entry=0x2009b150, flags=flags@entry=4096, wcp=0x0, cp=0x6e480000 <error: Cannot access memory at address 0x6e480000>, len=-1, max=-1,
> need_enc=3, have_enc=2) at /usr/src/contrib/libxo/libxo/libxo.c:2715
> #1 0x20150908 in xo_format_string (xop=0x2009b120, xbp=0x2009b150, flags=4096, xfp=0xbfbfd280) at /usr/src/contrib/libxo/libxo/libxo.c:2982
> #2 xo_do_format_field (xop=<optimized out>, xop@entry=0x2009b120, xbp=0x2009b150, fmt=fmt@entry=0x20130635 "%s", flen=flen@entry=2, flags=4096) at /usr/src/contrib/libxo/libxo/libxo.c:3503
> #3 0x2014c69c in xo_simple_field (xop=0x2009b120, encode_only=0, value=0x0, vlen=0, fmt=0x20130635 "%s", flen=2, flags=<optimized out>) at /usr/src/contrib/libxo/libxo/libxo.c:3817
> #4 xo_format_value (xop=<optimized out>, xop@entry=0x2009b120, name=<optimized out>, name@entry=0x204bf931 "state}\n", nlen=<optimized out>, nlen@entry=5, value=0x0, vlen=0, fmt=0x20130635 "%s",
> flen=2, encoding=0x0, elen=0, flags=<optimized out>) at /usr/src/contrib/libxo/libxo/libxo.c:4373
> #5 0x20148710 in xo_do_emit_fields (xop=<optimized out>, xop@entry=0x2009b120, fields=<optimized out>, fields@entry=0xbfbfd7e8, max_fields=max_fields@entry=17, fmt=<optimized out>)
> at /usr/src/contrib/libxo/libxo/libxo.c:6372
> #6 0x201476a0 in xo_do_emit (xop=xop@entry=0x2009b120, flags=<optimized out>, fmt=fmt@entry=0x204bf8e3 "=>{t:start/%*jd} {t:sectors/%*jd} {t:name/%*s} {:scheme} ({h:size/%ld}){t:state}\n")
> at /usr/src/contrib/libxo/libxo/libxo.c:6551
> #7 0x20147840 in xo_emit (fmt=0x204bf8e3 "=>{t:start/%*jd} {t:sectors/%*jd} {t:name/%*s} {:scheme} ({h:size/%ld}){t:state}\n") at /usr/src/contrib/libxo/libxo/libxo.c:6622
> #8 0x204d1fd4 in gpart_show_geom (gp=gp@entry=0x20089168, element=element@entry=0x204bfe51 "type", show_providers=show_providers@entry=0) at /usr/src/lib/geom/part/geom_part.c:654
> #9 0x204d1048 in gpart_show (req=0x20089000, fl=<optimized out>) at /usr/src/lib/geom/part/geom_part.c:793
> #10 0x000230dc in run_command (argc=0, argv=<optimized out>) at /usr/src/sbin/geom/core/geom.c:497
> #11 0x00022308 in main (argc=1, argv=0xbfbfed90) at /usr/src/sbin/geom/core/geom.c:861
> (gdb) list
> 2710 for (;;) {
> 2711 if (len == 0)
> 2712 break;
> 2713
> 2714 if (cp) {
> 2715 if (*cp == '\0')
> 2716 break;
> 2717 if ((flags & XFF_UNESCAPE) && (*cp == '\\' || *cp == '%')) {
> 2718 cp += 1;
> 2719 len -= 1;
> (gdb) up
> #1 0x20150908 in xo_format_string (xop=0x2009b120, xbp=0x2009b150, flags=4096, xfp=0xbfbfd280) at /usr/src/contrib/libxo/libxo/libxo.c:2982
> 2982 cols = xo_format_string_direct(xop, xbp, flags, wcp, cp, len,
> (gdb) list
> 2977
> 2978 return rc;
> 2979 }
> 2980 }
> 2981
> 2982 cols = xo_format_string_direct(xop, xbp, flags, wcp, cp, len,
> 2983 xfp->xf_width[XF_WIDTH_MAX],
> 2984 need_enc, xfp->xf_enc);
> 2985 if (cols < 0)
> 2986 goto bail;
> (gdb) list
> 3498
> 3499 xf.xf_enc = (xf.xf_fc == 'm') ? XF_ENC_UTF8
> 3500 : (xf.xf_lflag || (xf.xf_fc == 'S')) ? XF_ENC_WIDE
> 3501 : xf.xf_hflag ? XF_ENC_LOCALE : XF_ENC_UTF8;
> 3502
> 3503 rc = xo_format_string(xop, xbp, flags, &xf);
> 3504
> 3505 if ((flags & XFF_TRIM_WS) && xo_style_is_encoding(xop))
> 3506 rc = xo_trim_ws(xbp, rc);
> 3507
> (gdb) up
> #3 0x2014c69c in xo_simple_field (xop=0x2009b120, encode_only=0, value=0x0, vlen=0, fmt=0x20130635 "%s", flen=2, flags=<optimized out>) at /usr/src/contrib/libxo/libxo/libxo.c:3817
> 3817 xo_do_format_field(xop, NULL, fmt, flen, flags);
> (gdb) list
> 3812 {
> 3813 if (encode_only)
> 3814 flags |= XFF_NO_OUTPUT;
> 3815
> 3816 if (vlen == 0)
> 3817 xo_do_format_field(xop, NULL, fmt, flen, flags);
> 3818 else if (!encode_only)
> 3819 xo_data_append_content(xop, value, vlen, flags);
> 3820 }
> 3821
> (gdb) up
> #4 xo_format_value (xop=<optimized out>, xop@entry=0x2009b120, name=<optimized out>, name@entry=0x204bf931 "state}\n", nlen=<optimized out>, nlen@entry=5, value=0x0, vlen=0, fmt=0x20130635 "%s",
> flen=2, encoding=0x0, elen=0, flags=<optimized out>) at /usr/src/contrib/libxo/libxo/libxo.c:4373
> 4373 xo_simple_field(xop, FALSE, value, vlen, fmt, flen, flags);
> (gdb) list
> 4368
> 4369 save.xhs_offset = xbp->xb_curp - xbp->xb_bufp;
> 4370 save.xhs_columns = xop->xo_columns;
> 4371 save.xhs_anchor_columns = xop->xo_anchor_columns;
> 4372
> 4373 xo_simple_field(xop, FALSE, value, vlen, fmt, flen, flags);
> 4374
> 4375 if (flags & XFF_HUMANIZE)
> 4376 xo_format_humanize(xop, xbp, &save, flags);
> 4377 break;
> (gdb) up
> #5 0x20148710 in xo_do_emit_fields (xop=<optimized out>, xop@entry=0x2009b120, fields=<optimized out>, fields@entry=0xbfbfd7e8, max_fields=max_fields@entry=17, fmt=<optimized out>)
> at /usr/src/contrib/libxo/libxo/libxo.c:6372
> 6372 xo_format_value(xop, content, clen, NULL, 0,
> (gdb) list
> 6367 flags &= ~XFF_WS; /* Prevent later handling of this flag */
> 6368 }
> 6369 }
> 6370
> 6371 if (ftype == 'V')
> 6372 xo_format_value(xop, content, clen, NULL, 0,
> 6373 xfip->xfi_format, xfip->xfi_flen,
> 6374 xfip->xfi_encoding, xfip->xfi_elen, flags);
> 6375 else if (ftype == '[')
> 6376 xo_anchor_start(xop, xfip, content, clen);
> (gdb) up
> #6 0x201476a0 in xo_do_emit (xop=xop@entry=0x2009b120, flags=<optimized out>, fmt=fmt@entry=0x204bf8e3 "=>{t:start/%*jd} {t:sectors/%*jd} {t:name/%*s} {:scheme} ({h:size/%ld}){t:state}\n")
> at /usr/src/contrib/libxo/libxo/libxo.c:6551
> 6551 return xo_do_emit_fields(xop, fields, max_fields, fmt);
> (gdb) list
> 6546 /* Retain the info */
> 6547 xo_retain_add(fmt, fields, max_fields);
> 6548 }
> 6549 }
> 6550
> 6551 return xo_do_emit_fields(xop, fields, max_fields, fmt);
> 6552 }
> 6553
> 6554 /*
> 6555 * Rebuild a format string in a gettext-friendly format. This function
> (gdb) up
> #7 0x20147840 in xo_emit (fmt=0x204bf8e3 "=>{t:start/%*jd} {t:sectors/%*jd} {t:name/%*s} {:scheme} ({h:size/%ld}){t:state}\n") at /usr/src/contrib/libxo/libxo/libxo.c:6622
> 6622 rc = xo_do_emit(xop, 0, fmt);
> (gdb) list
> 6617 {
> 6618 xo_handle_t *xop = xo_default(NULL);
> 6619 ssize_t rc;
> 6620
> 6621 va_start(xop->xo_vap, fmt);
> 6622 rc = xo_do_emit(xop, 0, fmt);
> 6623 va_end(xop->xo_vap);
> 6624 bzero(&xop->xo_vap, sizeof(xop->xo_vap));
> 6625
> 6626 return rc;
> (gdb) up
> #8 0x204d1fd4 in gpart_show_geom (gp=gp@entry=0x20089168, element=element@entry=0x204bfe51 "type", show_providers=show_providers@entry=0) at /usr/src/lib/geom/part/geom_part.c:654
> warning: Source file is more recent than executable.
> 654 xo_emit("=>{t:start/%*jd} {t:sectors/%*jd} {t:name/%*s} {:scheme} ({h:size/%ld}){t:state}\n",
> (gdb) list
> 649 }
> 650 wname = wmax;
> 651 pp = LIST_FIRST(&gp->lg_consumer)->lg_provider;
> 652 secsz = pp->lg_sectorsize;
> 653 xo_open_instance("part");
> 654 xo_emit("=>{t:start/%*jd} {t:sectors/%*jd} {t:name/%*s} {:scheme} ({h:size/%ld}){t:state}\n",
> 655 wblocks, (intmax_t)first, wblocks, (intmax_t)(last - first + 1),
> 656 wname, gp->lg_name,
> 657 scheme, pp->lg_mediasize,
> 658 s ? " [CORRUPT]": "");
> (gdb) up
> #9 0x204d1048 in gpart_show (req=0x20089000, fl=<optimized out>) at /usr/src/lib/geom/part/geom_part.c:793
> 793 gpart_show_geom(gp, element, show_providers);
> (gdb) list
> 788 else
> 789 errx(EXIT_FAILURE, "No such geom: %s.", name);
> 790 }
> 791 } else {
> 792 LIST_FOREACH(gp, &classp->lg_geom, lg_geom) {
> 793 gpart_show_geom(gp, element, show_providers);
> 794 }
> 795 }
> 796 xo_close_list(name);
> 797 geom_deletetree(&mesh);
> (gdb) up
> #10 0x000230dc in run_command (argc=0, argv=<optimized out>) at /usr/src/sbin/geom/core/geom.c:497
> warning: Source file is more recent than executable.
> 497 cmd->gc_func(req, flags);
> (gdb) list
> 492 buf[0] = '\0';
> 493 if (cmd->gc_func != NULL) {
> 494 unsigned flags;
> 495
> 496 flags = set_flags(cmd);
> 497 cmd->gc_func(req, flags);
> 498 errstr = req->error;
> 499 } else {
> 500 gctl_add_param(req, "output", sizeof(buf), buf,
> 501 GCTL_PARAM_WR | GCTL_PARAM_ASCII);
> (gdb) up
> #11 0x00022308 in main (argc=1, argv=0xbfbfed90) at /usr/src/sbin/geom/core/geom.c:861
> 861 run_command(argc, argv);
> (gdb) list
> 856 show_tree();
> 857 return (0);
> 858 }
> 859
> 860 get_class(&argc, &argv);
> 861 run_command(argc, argv);
> 862 /* NOTREACHED */
> 863
> 864 exit(EXIT_FAILURE);
> 865 }
>
>
> For reference:
>
> # ls -lodT /usr/src/contrib/libxo/libxo/libxo.c /usr/src/lib/geom/part/geom_part.c /usr/src/sbin/geom/core/geom.c /sbin/gpart
> -r-xr-xr-x 17 root wheel - 30720 Dec 18 07:22:59 2025 /sbin/gpart
> -rw-r--r-- 1 root wheel - 211505 Dec 24 08:29:29 2025 /usr/src/contrib/libxo/libxo/libxo.c
> -rw-r--r-- 1 root wheel - 35380 Dec 24 08:29:29 2025 /usr/src/lib/geom/part/geom_part.c
> -rw-r--r-- 1 root wheel - 36298 Dec 24 08:29:29 2025 /usr/src/sbin/geom/core/geom.c
>
> That explains the "warning: Source file is more recent than executable"
> messages.
Additional context notes:
) On the Cortex-A7 SUT the above is repeatable at the
shell prompt when logged in: just try "gpart show",
including via gdb use. "/rescue/gpart show" also
core dumps.
) In a armv7 chroot on a aarch64 system (the Windows
Dev Kit 2023), the "gpart show" works just fine.
But the vintages could well be a little different.
(Tracing to git commits for pkgbase is problematical.)
I'll note:
Johan Söllvander <js_at_FreeBSD.org>
Date: Thu, 18 Dec 2025 15:23:29 UTC
The branch main has been updated by js:
URL: https://cgit.FreeBSD.org/src/commit/?id=4f809ffec69cd6ede3e7be9a5bc876b2e5931028
commit 4f809ffec69cd6ede3e7be9a5bc876b2e5931028
Author: Johan Söllvander <js@FreeBSD.org>
AuthorDate: 2025-12-18 15:06:09 +0000
Commit: Johan Söllvander <js@FreeBSD.org>
CommitDate: 2025-12-18 15:22:59 +0000
gpart: add libxo support for "show" subcommand + man page updates
Added libxo support to `gpart show`, also updated the man
pages for geom and gpart to show where you can expect
libxo formatted output.
PR: 290629
MFC after: 1 week
Sponsored by: ConnectWise
Reviewed by: asomers, mckusick, phil
Approved by: asomers (mentor)
Differential Revision: https://reviews.freebsd.org/D53950
---
. . .
Note: Dec 18 07:22:59 2025 /sbin/gpart for my time zone
would be 2025-12-18 15:22:59 +0000 (the CommitDate) UTC.
===
Mark Millard
marklmi at yahoo.com