Re: arm64 vs. jemalloc and swapping in and out, sh/su examples: being swapped out leads to later Failed assertion: "tsd_booted" after being swapped in

2017-02-27 Thread Poul-Henning Kamp

In message <41a51b66-4290-48e0-a3e3-aeb809b27...@dsl-only.net>, Mark Millard 
writes:

>The evidence is that process-memory is trashed and so likely continued
>operation of any previously swapped-out processes is unreliable.

I can confirm process corruption on RPi3 as of r313567.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: arm64 vs. jemalloc and swapping in and out, sh/su examples: being swapped out leads to later Failed assertion: "tsd_booted" after being swapped in

2017-02-27 Thread Mark Millard
On 2017-Feb-27, at 7:21 PM, Mark Millard  wrote:

> [I've added a variant of this material to bugzilla 217138.]
> 
> I've reduced the testing context to the following
> type of example (no longer involving buildworld
> buildkernel):
> 
> # sh
> # sh
> # sh
> . . .
> # sh
> 
> (So a bunch of nested sh's in an ssh session that
> will have most swapped out. I happened to have
> done this under 2 users for the example material
> below: in one I did an su first. Plus I had another
> session without such a nesting but with an su: this
> is the one were I ran stress.)
> 
> After forcing these to mostly swap out (see below)
> I used ^D or exit exit a currently interactive one.
> Then the rest of the swapped out ones from the
> nesting get the tsd_booted failure.
> 
> So, for example:
> 
> # stress -m 1 --vm-bytes 1536M
> 
> The context is a PINE64+ with 2GB of RAM. The above
> was enough in my context to cause the needed swapouts:
> 
> # ps -aOuser,flags
>  PID USER  F TT  STATTIME COMMAND
>  688 root   4102 u0  IWs  0:00.00 login [pam] (login)
>  689 root   10004002 u0  I+   0:00.06 -sh (sh)
> 72611 markmi 4002  0  IWs  0:00.00 -sh (sh)
> 72613 markmi 4002  0  IW   0:00.00 sh
> 72614 markmi 4002  0  IW   0:00.00 sh
> 72615 markmi 4002  0  IW   0:00.00 sh
> 72616 markmi 4002  0  IW   0:00.00 sh
> 72617 markmi 4002  0  IW   0:00.00 sh
> 72618 markmi 4002  0  IW   0:00.00 sh
> 72619 markmi 4002  0  IW   0:00.00 sh
> 72620 markmi 4002  0  IW   0:00.00 sh
> 72621 markmi 4002  0  IW   0:00.00 sh
> 72622 markmi 4002  0  IW   0:00.00 sh
> 72623 markmi 4002  0  IW   0:00.00 sh
> 72624 markmi 4002  0  IW   0:00.00 sh
> 72625 markmi 4002  0  IW   0:00.00 sh
> 72626 markmi 10004002  0  I+   0:00.01 sh
>  167 markmi 4002  1  IWs  0:00.00 -sh (sh)
>  169 root   4102  1  IW   0:00.00 su
>  170 root   4002  1  IW   0:00.00 su (sh)
>  171 root   4002  1  IW   0:00.00 sh
>  172 root   4002  1  IW   0:00.00 sh
>  173 root   4002  1  IW   0:00.00 sh
>  174 root   4002  1  IW   0:00.00 sh
>  175 root   4002  1  IW   0:00.00 sh
>  176 root   4002  1  IW   0:00.00 sh
>  177 root   4002  1  IW   0:00.00 sh
>  178 root   4002  1  IW   0:00.00 sh
>  179 root   10004002  1  I+   0:00.01 sh
> 60961 root   4002  2  IW   0:00.00 stress -m 1 --vm-bytes 1536M
> 60962 root   1002  2  R0:29.41 stress -m 1 --vm-bytes 1536M
> 60964 root   10004002  2  R+   0:00.01 ps -aOuser,flags
> 82389 markmi 4002  2  IWs  0:00.00 -sh (sh)
> 82391 root   4102  2  IW   0:00.00 su
> 82392 root   10004002  2  S0:00.22 su (sh)
> 
> So with that swapped out context established:
> 
> (The markmi user case of nested sh's:)
> 
> $ ^D: 
> /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: Failed 
> assertion: "tsd_booted"
> : /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
> Failed assertion: "tsd_booted"
> : /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
> Failed assertion: "tsd_booted"
> : /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
> Failed assertion: "tsd_booted"
> : /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
> Failed assertion: "tsd_booted"
> : /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
> Failed assertion: "tsd_booted"
> : /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
> Failed assertion: "tsd_booted"
> : /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
> Failed assertion: "tsd_booted"
> : /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
> Failed assertion: "tsd_booted"
> : /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
> Failed assertion: "tsd_booted"
> : /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
> Failed assertion: "tsd_booted"
> : /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
> Failed assertion: "tsd_booted"
> : /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
> Failed assertion: "tsd_booted"
> : /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
> Failed assertion: "tsd_booted"
> 
> 
> (The su'd user case of nested sh's:)
> 
> # ^D: 
> /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: Failed 
> assertion: "tsd_booted"
> : /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
> Failed assertion: "tsd_booted"
> : /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
> Failed assertion: "tsd_booted"
> : /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
> Failed assertion: "tsd_booted"
> : /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
> Failed assertion: "tsd_booted"
> : /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
> Failed assertion: "tsd_booted"
> : /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
> Failed assertion: "tsd_booted"
> : 

arm64 vs. jemalloc and swapping in and out, sh/su examples: being swapped out leads to later Failed assertion: "tsd_booted" after being swapped in

2017-02-27 Thread Mark Millard
[I've added a variant of this material to bugzilla 217138.]

I've reduced the testing context to the following
type of example (no longer involving buildworld
buildkernel):

# sh
# sh
# sh
. . .
# sh

(So a bunch of nested sh's in an ssh session that
will have most swapped out. I happened to have
done this under 2 users for the example material
below: in one I did an su first. Plus I had another
session without such a nesting but with an su: this
is the one were I ran stress.)

After forcing these to mostly swap out (see below)
I used ^D or exit exit a currently interactive one.
Then the rest of the swapped out ones from the
nesting get the tsd_booted failure.

So, for example:

# stress -m 1 --vm-bytes 1536M

The context is a PINE64+ with 2GB of RAM. The above
was enough in my context to cause the needed swapouts:

# ps -aOuser,flags
  PID USER  F TT  STATTIME COMMAND
  688 root   4102 u0  IWs  0:00.00 login [pam] (login)
  689 root   10004002 u0  I+   0:00.06 -sh (sh)
72611 markmi 4002  0  IWs  0:00.00 -sh (sh)
72613 markmi 4002  0  IW   0:00.00 sh
72614 markmi 4002  0  IW   0:00.00 sh
72615 markmi 4002  0  IW   0:00.00 sh
72616 markmi 4002  0  IW   0:00.00 sh
72617 markmi 4002  0  IW   0:00.00 sh
72618 markmi 4002  0  IW   0:00.00 sh
72619 markmi 4002  0  IW   0:00.00 sh
72620 markmi 4002  0  IW   0:00.00 sh
72621 markmi 4002  0  IW   0:00.00 sh
72622 markmi 4002  0  IW   0:00.00 sh
72623 markmi 4002  0  IW   0:00.00 sh
72624 markmi 4002  0  IW   0:00.00 sh
72625 markmi 4002  0  IW   0:00.00 sh
72626 markmi 10004002  0  I+   0:00.01 sh
  167 markmi 4002  1  IWs  0:00.00 -sh (sh)
  169 root   4102  1  IW   0:00.00 su
  170 root   4002  1  IW   0:00.00 su (sh)
  171 root   4002  1  IW   0:00.00 sh
  172 root   4002  1  IW   0:00.00 sh
  173 root   4002  1  IW   0:00.00 sh
  174 root   4002  1  IW   0:00.00 sh
  175 root   4002  1  IW   0:00.00 sh
  176 root   4002  1  IW   0:00.00 sh
  177 root   4002  1  IW   0:00.00 sh
  178 root   4002  1  IW   0:00.00 sh
  179 root   10004002  1  I+   0:00.01 sh
60961 root   4002  2  IW   0:00.00 stress -m 1 --vm-bytes 1536M
60962 root   1002  2  R0:29.41 stress -m 1 --vm-bytes 1536M
60964 root   10004002  2  R+   0:00.01 ps -aOuser,flags
82389 markmi 4002  2  IWs  0:00.00 -sh (sh)
82391 root   4102  2  IW   0:00.00 su
82392 root   10004002  2  S0:00.22 su (sh)

So with that swapped out context established:

(The markmi user case of nested sh's:)

$ ^D: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"


(The su'd user case of nested sh's:)

# ^D: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"
: /usr/src/contrib/jemalloc/include/jemalloc/internal/tsd.h:687: 
Failed assertion: "tsd_booted"

The one without the deeply nested sh's (but an su):