Re: panic: Unaligned free (was: kernel panic while copying files)

2021-06-30 Thread Gary Jennejohn
On Wed, 30 Jun 2021 10:35:14 -0600
Warner Losh  wrote:

> On Wed, Jun 30, 2021 at 6:58 AM Gary Jennejohn  wrote:
> 
> > On Wed, 30 Jun 2021 06:02:59 +0100
> > Graham Perrin  wrote:
> >  
> > > On 29/06/2021 10:42, Gary Jennejohn wrote:  
> > > > ___ panic is now the result of an unaligned free.
> > > >
> > > > panic: Unaligned free of 0xf800259e2800 from zone
> > > >  0xfe00dc9d2000(da_ccb) slab 0xf800259e2fd8(3)
> > > >
> > > > I have the crash dump and a debug kernel in case anyone wants more  
> > info.  
> > > Can you post the backtrace etc. here? Thanks
> > >  
> >
> > Sure.  As can be seen from the uma zone being da_ccb, the panic
> > resulted from setting kern.cam.da.enable_uma_ccbs=1.
> >
> > Unread portion of the kernel message buffer:
> > panic: Unaligned free of 0xf800259e2800 from zone
> > 0xfe00dc9d2000(da_ccb) slab 0xf800259e2fd8(3)
> > cpuid = 2
> > time = 1624958650
> > KDB: stack backtrace:
> > db_trace_self_wrapper() at db_trace_self_wrapper+0x2c/frame
> > 0xfe00c62687a0
> > kdb_backtrace() at kdb_backtrace+0x46/frame 0xfe00c6268850
> > vpanic() at vpanic+0x227/frame 0xfe00c62688f0
> > panic() at panic+0x4e/frame 0xfe00c6268950
> > uma_dbg_free() at uma_dbg_free+0xfc/frame 0xfe00c62689a0
> > item_dtor() at item_dtor+0x7c/frame 0xfe00c62689e0
> > uma_zfree_arg() at uma_zfree_arg+0xf0/frame 0xfe00c6268a50
> > uma_zfree() at uma_zfree+0x23/frame 0xfe00c6268a70
> > xpt_free_ccb() at xpt_free_ccb+0x43/frame 0xfe00c6268a90
> > camperiphdone() at camperiphdone+0x211/frame 0xfe00c6268ae0
> > xpt_done_process() at xpt_done_process+0x550/frame 0xfe00c6268b40
> > xpt_done_td() at xpt_done_td+0x1c0/frame 0xfe00c6268b80
> > fork_exit() at fork_exit+0x117/frame 0xfe00c6268bf0
> > fork_trampoline() at fork_trampoline+0xe/frame 0xfe00c6268bf0
> > --- trap 0, rip = 0, rsp = 0, rbp = 0 ---
> > KDB: enter: panic
> >
> > doadump (textdump=0) at /usr/src/sys/kern/kern_shutdown.c:399
> > 399 dumptid = curthread->td_tid;
> > (kgdb) bt
> > #0  doadump (textdump=0) at /usr/src/sys/kern/kern_shutdown.c:399
> > #1  0x804d5dd7 in db_dump (dummy=-2138843371, dummy2=false,
> > dummy3=-1,
> > dummy4=0xfe00c6268320 "") at /usr/src/sys/ddb/db_command.c:575
> > #2  0x804d5bf4 in db_command (
> > last_cmdp=0x8114ce80 , cmd_table=0x0,
> > dopager=1)
> > at /usr/src/sys/ddb/db_command.c:482
> > #3  0x804d583c in db_command_loop ()
> > at /usr/src/sys/ddb/db_command.c:535
> > #4  0x804da27c in db_trap (type=3, code=0)
> > at /usr/src/sys/ddb/db_main.c:270
> > #5  0x8083df9d in kdb_trap (type=3, code=0, tf=0xfe00c6268770)
> > at /usr/src/sys/kern/subr_kdb.c:727
> > #6  0x80d31494 in trap (frame=0xfe00c6268770)
> > at /usr/src/sys/amd64/amd64/trap.c:604
> > #7  0x80d32628 in trap_check (frame=0xfe00c6268770)
> > at /usr/src/sys/amd64/amd64/trap.c:664
> > #8  
> > #9  breakpoint () at /usr/src/sys/amd64/include/cpufunc.h:66
> > #10 0x8083d3d0 in kdb_enter (why=0x80e0355b "panic",
> > msg=0x80e0355b "panic") at /usr/src/sys/kern/subr_kdb.c:505
> > #11 0x807d1725 in vpanic (
> > fmt=0x80dbca46 "Unaligned free of %p from zone %p(%s) slab
> > %p(%d)", ap=0xfe00c6268930) at /usr/src/sys/kern/kern_shutdown.c:906
> > #12 0x807d120e in panic (
> > fmt=0x80dbca46 "Unaligned free of %p from zone %p(%s) slab
> > %p(%d)")
> > at /usr/src/sys/kern/kern_shutdown.c:843
> > #13 0x80c16a8c in uma_dbg_free (zone=0xfe00dc9d2000,
> > slab=0xf800259e2fd8, item=0xf800259e2800)
> > at /usr/src/sys/vm/uma_core.c:5659
> > #14 0x80c0c5dc in item_dtor (zone=0xfe00dc9d2000,
> > item=0xf800259e2800, size=544, udata=0x0, skip=SKIP_NONE)
> > at /usr/src/sys/vm/uma_core.c:3418
> > #15 0x80c0ba60 in uma_zfree_arg (zone=0xfe00dc9d2000,
> > item=0xf800259e2800, udata=0x0) at /usr/src/sys/vm/uma_core.c:4374
> > #16 0x802e45d3 in uma_zfree (zone=0xfe00dc9d2000,
> > item=0xf800259e2800) at /usr/src/sys/vm/uma.h:404
> > #17 0x802dc3c3 in xpt_free_ccb (free_ccb=0xf800259e2800)
> > at /usr/src/sys/cam/cam_xpt.c:4676
> > #18 0x802dacf1 in camperiphdone (periph=0xf80025329b00,
> > done_ccb=0xf80025a24cc0) at /usr/src/sys/cam/cam_periph.c:1427
> > #19 0x802e4520 in xpt_done_process (ccb_h=0xf80025a24cc0)
> > at /usr/src/sys/cam/cam_xpt.c:5493
> > #20 0x802e68e0 in xpt_done_td (arg=0x81143700 )
> > at /usr/src/sys/cam/cam_xpt.c:5548
> > #21 0x807673c7 in fork_exit (callout=0x802e6720
> > ,
> > arg=0x81143700 , frame=0xfe00c6268c00)
> > at /usr/src/sys/kern/kern_fork.c:1083
> > #22 
> >
> > [kgdb stuff removed]
> >
> > (kgdb) down
> > #15 0x80c0ba60 in uma_zfree_arg 

Re: 14-CURRENT: www/nextcloud: php occ/web access : Segmentation fault

2021-06-30 Thread Bakul Shah
On Jun 28, 2021, at 1:39 PM, O. Hartmann  wrote:
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
> 
> 
> Hello,
> 
> we ran into serious trouble here with an www/nextcloud installation on a 
> recent 14-CURRENT
> (FreeBSD 14.0-CURRENT #23 main-n247612-e6dd0e2e8d4: Mon Jun 28 18:08:20 CEST 
> 2021 amd64).
> Ports tree is up to date and ports are built via traditional "make". Port 
> www/nextcloud, all
> mod_ ports and even every php-* port (php74 is installed and default) has 
> been recompiled
> within the last two weeks via "portmaster -f".
> 
> The phenomenon occured back a couple of weeks, when access from the web via 
> cjromoum and/or
> firefox reported out of the sudden "Secure Connection Failed". I checked the 
> Apache
> 2.4 server's certificate (self signed,never had been an issue so far), but 
> there seems no
> issue to exist.
> It got very strange when I tried to perfom an upgrade and/or check via
> 
> cd /usr/local/www/nextcloud
> su -m -c "/usr/local/bin/php ./occ upgrade"
> 
> Whenever I access occ, I receive an @"Segmentation fault".
> The I checked the server's error log and I found for each access of the 
> nextcloud instance an
> entry like
> 
> [Tue Jun 01 06:04:40.667026 2021] [core:notice] [pid 81123:tid 34374492160] 
> AH00052: child pid
> 24598 exit signal Segmentation fault (11)
> 
> Well, I'm out of ideas, it seems nextcloud, php or apache ar all in 
> combination do have a
> serious problem hard to come by with 14-CURRENT (another instance running on 
> 12.2-RELENG
> doesn't have any issues).
> 
> Can someone hint me to what to do track this nasty error?

Some general ideas:

You can use ktrace and tcpdump to capture in some detail what is going on.
ktrace can tell you if there was a failing open near the crash (often due to
the "all the world is linux" syndrome). There should be a core dump connected
to the segfault - make sure coredumpsize limit is not set to 0. You may be
able to get a stacktrace from it. You can then compile the offending program
with -g and capture file:line with gdb. You can then pore over the source
code and add some checks or traps of your own (if you are guessing what the
bug may be). Also look at /var/log/messages for anything unusual. ["Unusual"
may become more apparent as you gain debugging experience.]

If you have a bug report, adding such relevant details may be of help to others.

Note that if you switch to a different version of *some* s/w piece, the
problem may disappear. That may be fine if you are under time pressure and
just want to work around the problem but in general it is better to try to
catch the bug without changing its environment.




Re: 14-CURRENT: www/nextcloud: php occ/web access : Segmentation fault

2021-06-30 Thread Michael Gmelin



On Wed, 30 Jun 2021 20:05:43 +0200
"O. Hartmann"  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
> 
> Am Mon, 28 Jun 2021 23:34:44 +0200
> Michael Gmelin  schrieb:
> 
> > > On 28. Jun 2021, at 22:41, O. Hartmann 
> > > wrote:
> > > 
> > > -BEGIN PGP SIGNED MESSAGE-
> > > Hash: SHA512
> > > 
> > > 
> > > Hello,
> > > 
> > > we ran into serious trouble here with an www/nextcloud
> > > installation on a recent 14-CURRENT (FreeBSD 14.0-CURRENT #23
> > > main-n247612-e6dd0e2e8d4: Mon Jun 28 18:08:20 CEST 2021 amd64).
> > > Ports tree is up to date and ports are built via traditional
> > > "make". Port www/nextcloud, all mod_ ports and even every php-*
> > > port (php74 is installed and default) has been recompiled within
> > > the last two weeks via "portmaster -f".
> > > 
> > > The phenomenon occured back a couple of weeks, when access from
> > > the web via cjromoum and/or firefox reported out of the sudden
> > > "Secure Connection Failed". I checked the Apache 2.4 server's
> > > certificate (self signed,never had been an issue so far), but
> > > there seems no issue to exist. It got very strange when I tried
> > > to perfom an upgrade and/or check via
> > > 
> > > cd /usr/local/www/nextcloud
> > > su -m -c "/usr/local/bin/php ./occ upgrade"
> > > 
> > > Whenever I access occ, I receive an @"Segmentation fault".
> > > The I checked the server's error log and I found for each access
> > > of the nextcloud instance an entry like
> > > 
> > > [Tue Jun 01 06:04:40.667026 2021] [core:notice] [pid 81123:tid
> > > 34374492160] AH00052: child pid 24598 exit signal Segmentation
> > > fault (11)
> > > 
> > > Well, I'm out of ideas, it seems nextcloud, php or apache ar all
> > > in combination do have a serious problem hard to come by with
> > > 14-CURRENT (another instance running on 12.2-RELENG doesn't have
> > > any issues).
> > > 
> > > Can someone hint me to what to do track this nasty error?
> > > 
> > > Thanks in advance,
> > > 
> > 
> > Do you have a minimal setup to reproduce? Could you try building
> > all ports against OpenSSL from ports?
> > 
> > -m
> > 
> > 
> >   
> > > oh
> > > 
> > > - -- 
> > > O. Hartmann
> > > 
> > > Ich widerspreche der Nutzung oder Übermittlung meiner Daten für
> > > Werbezwecke oder für die Markt- oder Meinungsforschung (§ 28 Abs.
> > > 4 BDSG). -BEGIN PGP SIGNATURE-
> > > 
> > > iHUEARYKAB0WIQSy8IBxAPDkqVBaTJ44N1ZZPba5RwUCYNozlwAKCRA4N1ZZPba5
> > > Rx2nAPwNf9014LCwIKdjN1lxdiESP0daa97tqvFsZiOM8OgpmAD+M6pmqlCVG6TE
> > > HyuCprAwjwvP9zxov3BDaVmJRI3ZpAw=
> > > =z4d+
> > > -END PGP SIGNATURE-
> > 
> >   
> 
> I had already filed a PR regarding this probleme, here is the link:
> 
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256844
> 
> Building all ports against OpenSSL from ports would exceed the
> capabilities of my hosts, the box in question is under load and an
> older Ivy-Bridge XEON with limited speed, so that would take days. I
> hoped the problem could be isolated otherwise ...

I found this issue on the nextcloud issue tracker:
https://github.com/nextcloud/server/issues/25761

Based on that, you should enable apcu for php CLI by adding this
to your php.ini:

  apc.enable_cli=1

which should fix `occ upgrade'.

No idea if it works, but it sounds similar enough to give it a shot.

Cheers
Michael

p.s. see also https://www.php.net/manual/en/apcu.configuration.php


> - -- 
> O. Hartmann
> 
> Ich widerspreche der Nutzung oder Übermittlung meiner Daten für
> Werbezwecke oder für die Markt- oder Meinungsforschung (§ 28 Abs. 4
> BDSG). -BEGIN PGP SIGNATURE-
> 
> iHUEARYKAB0WIQSy8IBxAPDkqVBaTJ44N1ZZPba5RwUCYNyykgAKCRA4N1ZZPba5
> R68PAPwIioYhbPZ4DXLbJXKsWuAYUr9oZRgwMiTqhpqqwBIwCgEAwmcxE/ZpQ3Og
> 0mXO2DBqBNv+RAFQ7U/3qSnOlKeAdgQ=
> =0VYB
> -END PGP SIGNATURE-



-- 
Michael Gmelin



Re: 14-CURRENT: www/nextcloud: php occ/web access : Segmentation fault

2021-06-30 Thread O. Hartmann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Am Mon, 28 Jun 2021 23:34:44 +0200
Michael Gmelin  schrieb:

> > On 28. Jun 2021, at 22:41, O. Hartmann  wrote:
> > 
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA512
> > 
> > 
> > Hello,
> > 
> > we ran into serious trouble here with an www/nextcloud installation on a 
> > recent 14-CURRENT
> > (FreeBSD 14.0-CURRENT #23 main-n247612-e6dd0e2e8d4: Mon Jun 28 18:08:20 
> > CEST 2021 amd64).
> > Ports tree is up to date and ports are built via traditional "make". Port 
> > www/nextcloud,
> > all mod_ ports and even every php-* port (php74 is installed and default) 
> > has been
> > recompiled within the last two weeks via "portmaster -f".
> > 
> > The phenomenon occured back a couple of weeks, when access from the web via 
> > cjromoum and/or
> > firefox reported out of the sudden "Secure Connection Failed". I checked 
> > the Apache
> > 2.4 server's certificate (self signed,never had been an issue so far), but 
> > there seems no
> > issue to exist.
> > It got very strange when I tried to perfom an upgrade and/or check via
> > 
> > cd /usr/local/www/nextcloud
> > su -m -c "/usr/local/bin/php ./occ upgrade"
> > 
> > Whenever I access occ, I receive an @"Segmentation fault".
> > The I checked the server's error log and I found for each access of the 
> > nextcloud instance
> > an entry like
> > 
> > [Tue Jun 01 06:04:40.667026 2021] [core:notice] [pid 81123:tid 34374492160] 
> > AH00052: child
> > pid 24598 exit signal Segmentation fault (11)
> > 
> > Well, I'm out of ideas, it seems nextcloud, php or apache ar all in 
> > combination do have a
> > serious problem hard to come by with 14-CURRENT (another instance running 
> > on 12.2-RELENG
> > doesn't have any issues).
> > 
> > Can someone hint me to what to do track this nasty error?
> > 
> > Thanks in advance,
> >   
> 
> Do you have a minimal setup to reproduce? Could you try building all ports 
> against OpenSSL
> from ports?
> 
> -m
> 
> 
> 
> > oh
> > 
> > - -- 
> > O. Hartmann
> > 
> > Ich widerspreche der Nutzung oder Übermittlung meiner Daten für
> > Werbezwecke oder für die Markt- oder Meinungsforschung (§ 28 Abs. 4 BDSG).
> > -BEGIN PGP SIGNATURE-
> > 
> > iHUEARYKAB0WIQSy8IBxAPDkqVBaTJ44N1ZZPba5RwUCYNozlwAKCRA4N1ZZPba5
> > Rx2nAPwNf9014LCwIKdjN1lxdiESP0daa97tqvFsZiOM8OgpmAD+M6pmqlCVG6TE
> > HyuCprAwjwvP9zxov3BDaVmJRI3ZpAw=
> > =z4d+
> > -END PGP SIGNATURE-  
> 
> 

I had already filed a PR regarding this probleme, here is the link:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256844

Building all ports against OpenSSL from ports would exceed the capabilities of 
my hosts, the
box in question is under load and an older Ivy-Bridge XEON with limited speed, 
so that would
take days. I hoped the problem could be isolated otherwise ...

- -- 
O. Hartmann

Ich widerspreche der Nutzung oder Übermittlung meiner Daten für
Werbezwecke oder für die Markt- oder Meinungsforschung (§ 28 Abs. 4 BDSG).
-BEGIN PGP SIGNATURE-

iHUEARYKAB0WIQSy8IBxAPDkqVBaTJ44N1ZZPba5RwUCYNyykgAKCRA4N1ZZPba5
R68PAPwIioYhbPZ4DXLbJXKsWuAYUr9oZRgwMiTqhpqqwBIwCgEAwmcxE/ZpQ3Og
0mXO2DBqBNv+RAFQ7U/3qSnOlKeAdgQ=
=0VYB
-END PGP SIGNATURE-


Re: panic: Unaligned free (was: kernel panic while copying files)

2021-06-30 Thread Warner Losh
On Wed, Jun 30, 2021 at 6:58 AM Gary Jennejohn  wrote:

> On Wed, 30 Jun 2021 06:02:59 +0100
> Graham Perrin  wrote:
>
> > On 29/06/2021 10:42, Gary Jennejohn wrote:
> > > ___ panic is now the result of an unaligned free.
> > >
> > > panic: Unaligned free of 0xf800259e2800 from zone
> > >  0xfe00dc9d2000(da_ccb) slab 0xf800259e2fd8(3)
> > >
> > > I have the crash dump and a debug kernel in case anyone wants more
> info.
> > Can you post the backtrace etc. here? Thanks
> >
>
> Sure.  As can be seen from the uma zone being da_ccb, the panic
> resulted from setting kern.cam.da.enable_uma_ccbs=1.
>
> Unread portion of the kernel message buffer:
> panic: Unaligned free of 0xf800259e2800 from zone
> 0xfe00dc9d2000(da_ccb) slab 0xf800259e2fd8(3)
> cpuid = 2
> time = 1624958650
> KDB: stack backtrace:
> db_trace_self_wrapper() at db_trace_self_wrapper+0x2c/frame
> 0xfe00c62687a0
> kdb_backtrace() at kdb_backtrace+0x46/frame 0xfe00c6268850
> vpanic() at vpanic+0x227/frame 0xfe00c62688f0
> panic() at panic+0x4e/frame 0xfe00c6268950
> uma_dbg_free() at uma_dbg_free+0xfc/frame 0xfe00c62689a0
> item_dtor() at item_dtor+0x7c/frame 0xfe00c62689e0
> uma_zfree_arg() at uma_zfree_arg+0xf0/frame 0xfe00c6268a50
> uma_zfree() at uma_zfree+0x23/frame 0xfe00c6268a70
> xpt_free_ccb() at xpt_free_ccb+0x43/frame 0xfe00c6268a90
> camperiphdone() at camperiphdone+0x211/frame 0xfe00c6268ae0
> xpt_done_process() at xpt_done_process+0x550/frame 0xfe00c6268b40
> xpt_done_td() at xpt_done_td+0x1c0/frame 0xfe00c6268b80
> fork_exit() at fork_exit+0x117/frame 0xfe00c6268bf0
> fork_trampoline() at fork_trampoline+0xe/frame 0xfe00c6268bf0
> --- trap 0, rip = 0, rsp = 0, rbp = 0 ---
> KDB: enter: panic
>
> doadump (textdump=0) at /usr/src/sys/kern/kern_shutdown.c:399
> 399 dumptid = curthread->td_tid;
> (kgdb) bt
> #0  doadump (textdump=0) at /usr/src/sys/kern/kern_shutdown.c:399
> #1  0x804d5dd7 in db_dump (dummy=-2138843371, dummy2=false,
> dummy3=-1,
> dummy4=0xfe00c6268320 "") at /usr/src/sys/ddb/db_command.c:575
> #2  0x804d5bf4 in db_command (
> last_cmdp=0x8114ce80 , cmd_table=0x0,
> dopager=1)
> at /usr/src/sys/ddb/db_command.c:482
> #3  0x804d583c in db_command_loop ()
> at /usr/src/sys/ddb/db_command.c:535
> #4  0x804da27c in db_trap (type=3, code=0)
> at /usr/src/sys/ddb/db_main.c:270
> #5  0x8083df9d in kdb_trap (type=3, code=0, tf=0xfe00c6268770)
> at /usr/src/sys/kern/subr_kdb.c:727
> #6  0x80d31494 in trap (frame=0xfe00c6268770)
> at /usr/src/sys/amd64/amd64/trap.c:604
> #7  0x80d32628 in trap_check (frame=0xfe00c6268770)
> at /usr/src/sys/amd64/amd64/trap.c:664
> #8  
> #9  breakpoint () at /usr/src/sys/amd64/include/cpufunc.h:66
> #10 0x8083d3d0 in kdb_enter (why=0x80e0355b "panic",
> msg=0x80e0355b "panic") at /usr/src/sys/kern/subr_kdb.c:505
> #11 0x807d1725 in vpanic (
> fmt=0x80dbca46 "Unaligned free of %p from zone %p(%s) slab
> %p(%d)", ap=0xfe00c6268930) at /usr/src/sys/kern/kern_shutdown.c:906
> #12 0x807d120e in panic (
> fmt=0x80dbca46 "Unaligned free of %p from zone %p(%s) slab
> %p(%d)")
> at /usr/src/sys/kern/kern_shutdown.c:843
> #13 0x80c16a8c in uma_dbg_free (zone=0xfe00dc9d2000,
> slab=0xf800259e2fd8, item=0xf800259e2800)
> at /usr/src/sys/vm/uma_core.c:5659
> #14 0x80c0c5dc in item_dtor (zone=0xfe00dc9d2000,
> item=0xf800259e2800, size=544, udata=0x0, skip=SKIP_NONE)
> at /usr/src/sys/vm/uma_core.c:3418
> #15 0x80c0ba60 in uma_zfree_arg (zone=0xfe00dc9d2000,
> item=0xf800259e2800, udata=0x0) at /usr/src/sys/vm/uma_core.c:4374
> #16 0x802e45d3 in uma_zfree (zone=0xfe00dc9d2000,
> item=0xf800259e2800) at /usr/src/sys/vm/uma.h:404
> #17 0x802dc3c3 in xpt_free_ccb (free_ccb=0xf800259e2800)
> at /usr/src/sys/cam/cam_xpt.c:4676
> #18 0x802dacf1 in camperiphdone (periph=0xf80025329b00,
> done_ccb=0xf80025a24cc0) at /usr/src/sys/cam/cam_periph.c:1427
> #19 0x802e4520 in xpt_done_process (ccb_h=0xf80025a24cc0)
> at /usr/src/sys/cam/cam_xpt.c:5493
> #20 0x802e68e0 in xpt_done_td (arg=0x81143700 )
> at /usr/src/sys/cam/cam_xpt.c:5548
> #21 0x807673c7 in fork_exit (callout=0x802e6720
> ,
> arg=0x81143700 , frame=0xfe00c6268c00)
> at /usr/src/sys/kern/kern_fork.c:1083
> #22 
>
> [kgdb stuff removed]
>
> (kgdb) down
> #15 0x80c0ba60 in uma_zfree_arg (zone=0xfe00dc9d2000,
> item=0xf800259e2800, udata=0x0) at /usr/src/sys/vm/uma_core.c:4374
> 4374item_dtor(zone, item, cache_uz_size(cache), udata,
> SKIP_NONE);
> (kgdb) down
> #14 0x80c0c5dc in item_dtor (zone=0xfe00dc9d2000,
> 

Re: panic: Unaligned free (was: kernel panic while copying files)

2021-06-30 Thread Gary Jennejohn
On Wed, 30 Jun 2021 06:02:59 +0100
Graham Perrin  wrote:

> On 29/06/2021 10:42, Gary Jennejohn wrote:
> > ___ panic is now the result of an unaligned free.
> >
> > panic: Unaligned free of 0xf800259e2800 from zone
> >  0xfe00dc9d2000(da_ccb) slab 0xf800259e2fd8(3)
> >
> > I have the crash dump and a debug kernel in case anyone wants more info.  
> Can you post the backtrace etc. here? Thanks
> 

Sure.  As can be seen from the uma zone being da_ccb, the panic
resulted from setting kern.cam.da.enable_uma_ccbs=1.

Unread portion of the kernel message buffer:
panic: Unaligned free of 0xf800259e2800 from zone 
0xfe00dc9d2000(da_ccb) slab 0xf800259e2fd8(3)
cpuid = 2
time = 1624958650
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2c/frame 0xfe00c62687a0
kdb_backtrace() at kdb_backtrace+0x46/frame 0xfe00c6268850
vpanic() at vpanic+0x227/frame 0xfe00c62688f0
panic() at panic+0x4e/frame 0xfe00c6268950
uma_dbg_free() at uma_dbg_free+0xfc/frame 0xfe00c62689a0
item_dtor() at item_dtor+0x7c/frame 0xfe00c62689e0
uma_zfree_arg() at uma_zfree_arg+0xf0/frame 0xfe00c6268a50
uma_zfree() at uma_zfree+0x23/frame 0xfe00c6268a70
xpt_free_ccb() at xpt_free_ccb+0x43/frame 0xfe00c6268a90
camperiphdone() at camperiphdone+0x211/frame 0xfe00c6268ae0
xpt_done_process() at xpt_done_process+0x550/frame 0xfe00c6268b40
xpt_done_td() at xpt_done_td+0x1c0/frame 0xfe00c6268b80
fork_exit() at fork_exit+0x117/frame 0xfe00c6268bf0
fork_trampoline() at fork_trampoline+0xe/frame 0xfe00c6268bf0
--- trap 0, rip = 0, rsp = 0, rbp = 0 ---
KDB: enter: panic

doadump (textdump=0) at /usr/src/sys/kern/kern_shutdown.c:399
399 dumptid = curthread->td_tid;
(kgdb) bt
#0  doadump (textdump=0) at /usr/src/sys/kern/kern_shutdown.c:399
#1  0x804d5dd7 in db_dump (dummy=-2138843371, dummy2=false, dummy3=-1,
dummy4=0xfe00c6268320 "") at /usr/src/sys/ddb/db_command.c:575
#2  0x804d5bf4 in db_command (
last_cmdp=0x8114ce80 , cmd_table=0x0, dopager=1)
at /usr/src/sys/ddb/db_command.c:482
#3  0x804d583c in db_command_loop ()
at /usr/src/sys/ddb/db_command.c:535
#4  0x804da27c in db_trap (type=3, code=0)
at /usr/src/sys/ddb/db_main.c:270
#5  0x8083df9d in kdb_trap (type=3, code=0, tf=0xfe00c6268770)
at /usr/src/sys/kern/subr_kdb.c:727
#6  0x80d31494 in trap (frame=0xfe00c6268770)
at /usr/src/sys/amd64/amd64/trap.c:604
#7  0x80d32628 in trap_check (frame=0xfe00c6268770)
at /usr/src/sys/amd64/amd64/trap.c:664
#8  
#9  breakpoint () at /usr/src/sys/amd64/include/cpufunc.h:66
#10 0x8083d3d0 in kdb_enter (why=0x80e0355b "panic",
msg=0x80e0355b "panic") at /usr/src/sys/kern/subr_kdb.c:505
#11 0x807d1725 in vpanic (
fmt=0x80dbca46 "Unaligned free of %p from zone %p(%s) slab %p(%d)", 
ap=0xfe00c6268930) at /usr/src/sys/kern/kern_shutdown.c:906
#12 0x807d120e in panic (
fmt=0x80dbca46 "Unaligned free of %p from zone %p(%s) slab %p(%d)")
at /usr/src/sys/kern/kern_shutdown.c:843
#13 0x80c16a8c in uma_dbg_free (zone=0xfe00dc9d2000,
slab=0xf800259e2fd8, item=0xf800259e2800)
at /usr/src/sys/vm/uma_core.c:5659
#14 0x80c0c5dc in item_dtor (zone=0xfe00dc9d2000,
item=0xf800259e2800, size=544, udata=0x0, skip=SKIP_NONE)
at /usr/src/sys/vm/uma_core.c:3418
#15 0x80c0ba60 in uma_zfree_arg (zone=0xfe00dc9d2000,
item=0xf800259e2800, udata=0x0) at /usr/src/sys/vm/uma_core.c:4374
#16 0x802e45d3 in uma_zfree (zone=0xfe00dc9d2000,
item=0xf800259e2800) at /usr/src/sys/vm/uma.h:404
#17 0x802dc3c3 in xpt_free_ccb (free_ccb=0xf800259e2800)
at /usr/src/sys/cam/cam_xpt.c:4676
#18 0x802dacf1 in camperiphdone (periph=0xf80025329b00,
done_ccb=0xf80025a24cc0) at /usr/src/sys/cam/cam_periph.c:1427
#19 0x802e4520 in xpt_done_process (ccb_h=0xf80025a24cc0)
at /usr/src/sys/cam/cam_xpt.c:5493
#20 0x802e68e0 in xpt_done_td (arg=0x81143700 )
at /usr/src/sys/cam/cam_xpt.c:5548
#21 0x807673c7 in fork_exit (callout=0x802e6720 ,
arg=0x81143700 , frame=0xfe00c6268c00)
at /usr/src/sys/kern/kern_fork.c:1083
#22 

[kgdb stuff removed]

(kgdb) down
#15 0x80c0ba60 in uma_zfree_arg (zone=0xfe00dc9d2000,
item=0xf800259e2800, udata=0x0) at /usr/src/sys/vm/uma_core.c:4374
4374item_dtor(zone, item, cache_uz_size(cache), udata, 
SKIP_NONE);
(kgdb) down
#14 0x80c0c5dc in item_dtor (zone=0xfe00dc9d2000,
item=0xf800259e2800, size=544, udata=0x0, skip=SKIP_NONE)
at /usr/src/sys/vm/uma_core.c:3418
3418uma_dbg_free(zone, NULL, item);
(kgdb) p/x skipdbg
$26 = 0x0
(kgdb) p/x zone->uz_flags
$27 = 0x4100 (UMA_ZFLAG_TRASH|UMA_ZFLAG_CTORDTOR)

Fw: Problem building openoffice

2021-06-30 Thread Filippo Moretti via current
 

   - Forwarded Message - From: Filippo Moretti 
To: off...@freebsd.org Sent: 
Wednesday, June 30, 2021, 10:42:48 AM GMT+2Subject: Problem building openoffice
 Good morning,    I get the following error while 
attempting to update openoffice-4 on amd64 arc on current:1 module(s): 
    sccomp
need(s) to be rebuilt

Reason(s):

ERROR: error 65280 occurred while making 
/usr/ports/editors/openoffice-4/work/aoo-4.1.10/main/sccomp/source/solver

When you have fixed the errors in that module you can resume the build by 
running:

    build --from sccomp

*** Error code 1

Stop.
make: stopped in /usr/ports/editors/openoffice-4

I never had this problem before and I do not know how to rebuild the module any 
help appreciatedsincrelyFilippo