[Bug 292008] armv7 (native and chroot) gets SIGSEGV for: gpart show

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 28 Dec 2025 20:41:20 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292008

            Bug ID: 292008
           Summary: armv7 (native and chroot) gets SIGSEGV for: gpart show
           Product: Base System
           Version: 16.0-CURRENT
          Hardware: arm
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: marklmi26-fbsd@yahoo.com

Context: official pkgbase distribution installations,
both native armv7 boot and armv7 chroot world on aarch64.
But the details backtraces differ in the native vs.
not examples involved. Also, the freebsd-arm and
freebsd-current lists had messages about this before
this submittal.

armv7 native backtrace (there was no output before
the SIGSEGV notice):

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

armv7 chroot on aarch64 example backtrace:

Program terminated with signal SIGSEGV, Segmentation fault.
Address not mapped to object.
#0  0x200c5ef0 in delete_config (gp=0x2053e224) at
/usr/src/lib/libgeom/geom_xml2tree.c:502

warning: Source file is more recent than executable.
502 LIST_REMOVE(cf, lg_config);
(gdb) bt
#0  0x200c5ef0 in delete_config (gp=0x2053e224) at
/usr/src/lib/libgeom/geom_xml2tree.c:502
#1  geom_deletetree (gmp=gmp@entry=0xffffcb48) at
/usr/src/lib/libgeom/geom_xml2tree.c:524
#2  0x204d2064 in gpart_show (req=<optimized out>, fl=<optimized out>) at
/usr/src/lib/geom/part/geom_part.c:797
#3  0x000230dc in run_command (argc=0, argv=<optimized out>) at
/usr/src/sbin/geom/core/geom.c:497
#4  0x00022308 in main (argc=1, argv=0xffffdc70) at
/usr/src/sbin/geom/core/geom.c:861

The arm7 chroot on aarch64 example outputs some
before the SIGSEGV and the sizes are messed up:

# gpart show 
=>        34  1000215149  nda0  GPT  (2)(null)
          34        2014        - free -  (2)
        2048      532480     1  efi  (517M)
      534528       32768     2  ms-reserved  (517M)
      567296   997287936     3  ms-basic-data  (517M)
   997855232     2359296     4  ms-recovery  (517M)
  1000214528         655        - free -  (2)

=>        34  2930277101  da0  GPT  (0)(null)
          34       32734       - free -  (0)
       32768      501760    1  efi  (517M)
      534528    20971520    2  freebsd-swap  (517M)
    21506048    29360128    3  freebsd-swap  (517M)
    50866176    33554432    4  freebsd-swap  (517M)
    84420608    67108864    5  freebsd-swap  (517M)
   151529472    96468992    6  freebsd-swap  (517M)
   247998464   268435456    7  freebsd-swap  (517M)
   516433920     7340032    8  freebsd-swap  (517M)
   523773952    13096960       - free -  (0)
   536870912  2357198848    9  freebsd-ufs  (517M)
  2894069760    36207375       - free -  (0)

=>        40  1953525088  da1  GPT  (0)(null)
          40      532480    1  efi  (517M)
      532520        2008       - free -  (0)
      534528     3563520    2  freebsd-swap  (517M)
     4098048     6504448       - free -  (0)
    10602496  1740636160    4  freebsd-ufs  (517M)
  1751238656     7546880    3  freebsd-swap  (517M)
  1758785536   194739592       - free -  (0)

Segmentation fault (core dumped)

-- 
You are receiving this mail because:
You are the assignee for the bug.