Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t/perf/benchmarks.t: premature exit on threaded builds on FreeBSD-13 #16752

Closed
p5pRT opened this issue Nov 17, 2018 · 12 comments
Closed

t/perf/benchmarks.t: premature exit on threaded builds on FreeBSD-13 #16752

p5pRT opened this issue Nov 17, 2018 · 12 comments
Assignees

Comments

@p5pRT
Copy link

p5pRT commented Nov 17, 2018

Migrated from rt.perl.org#133663 (status was 'open')

Searchable as RT133663$

@p5pRT
Copy link
Author

p5pRT commented Nov 17, 2018

From @jkeenan

Recently we've been getting smoke-test failures on FreeBSD-13-CURRENT in
t/perf/benchmarks.t. See, for example​:

http​://perl5.test-smoke.org/report/74129

Note that the failures in t/perf/benchmarks.t are only occuring on
threaded builds. Note also the "No plan found in TAP output" message,
which is usually associated with a premature exit to the test process
rather than failures in individual tests.

I have not seen such failures on FreeBSD-11 (or any other platform, for
that matter) and we're not getting them in FreeBSD-12 smoke test
reports. Moreover, the test file and its data in t/perf/benchmarks have
been very stable for the last twelve months.

So these failures could be due to some combination of (a) changes in
Perl 5 blead; (b) changes in FreeBSD; or (c) limitations in the
particular FreeBSD instance in which the smoking is being performed.

To diagnose this I installed a FreeBSD-13 VM on a FreeBSD-11 host -- the
same host on which we have a different FreeBSD VM for the monthly
"test-against-dev" analysis. That VM comes from the list of VirtualBox
boxes provided by Hashicorp at vagrantup.com. I suspect that this VM is
quite similar to the one from which we're getting the reports of
failures in t/perf/benchmark.t.

I have been able to reproduce the failures when I build blead with these
configuration arguments​:

#####
$ ./perl -Ilib -V​:config_args
config_args='-des -Dusedevel -Duseithreads -Doptimize=-O2 -pipe
-fstack-protector -fno-strict-aliasing';

$ cd t;./perl harness -v perf/benchmarks.t; cd -
Cannot allocate memory while trying to read 'perf/benchmarks' at
perf/benchmarks.t line 19.
Dubious, test returned 12 (wstat 3072, 0xc00)
No subtests run

Test Summary Report


perf/benchmarks.t (Wstat​: 3072 Tests​: 0 Failed​: 0)
  Non-zero exit status​: 12
  Parse errors​: No plan found in TAP output
Files=1, Tests=0, 0 wallclock secs ( 0.01 usr 0.01 sys + 0.01 cusr
0.01 csys = 0.03 CPU)
Result​: FAIL
#####

However, when I configure without threads, all tests PASS​:

#####
[perl2] $ ./perl -Ilib -V​:config_args
config_args='-des -Dusedevel';
[perl2] $ cd t;./perl harness perf/benchmarks.t; cd -
perf/benchmarks.t .. ok
All tests successful.
Files=1, Tests=1728, 1 wallclock secs ( 0.18 usr 0.02 sys + 0.08 cusr
  0.03 csys = 0.30 CPU)
Result​: PASS
/home/jkeenan/gitwork/perl2
#####

That reproduces the results Carlos Guevara is reporting in the smoke
test report cited above.

When I conduct an internet search for "Cannot allocate memory while
trying to read", I mostly come up with cases on Linux. There's little
that's FreeBSD-specific. For what it's worth, here are two lines from
the output of 'ulimit -a' on this VM​:

#####
max user processes (-u) 3416
open files (-n) 13635
#####

In contrast, on the host on which this VM sits, the corresponding lines
from 'ulimit -a' are​:

#####
max user processes (-u) 12171
open files (-n) 22500
#####

This leads me to suspect that the problem is (c) -- a resource
constraint in the way this particular "box" has been set up -- rather
than something wrong in blead or in FreeBSD-13.

I experimented at splitting the fixtures in t/perf/benchmarks into two
files, then modifying t/perf/benchmarks.t so that it does one run over
each of the two files. That worked; I did not get the "Cannot allocate
memory" error.

Unless someone has a better way of handling this problem, I'd like to
apply that splitting-up to blead so that we can reduce the amount of
"noise" coming from these apparently spurious test failures.

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented Nov 17, 2018

From @jkeenan

Summary of my perl5 (revision 5 version 29 subversion 5) configuration​:
  Commit id​: 3db0bcc
  Platform​:
  osname=freebsd
  osvers=13.0-current
  archname=amd64-freebsd-thread-multi
  uname='freebsd perl-reporter-05 13.0-current freebsd 13.0-current r340361 generic amd64 '
  config_args='-des -Dusedevel -Duseithreads -Doptimize=-O2 -pipe -fstack-protector -fno-strict-aliasing'
  hint=recommended
  useposix=true
  d_sigaction=define
  useithreads=define
  usemultiplicity=define
  use64bitint=define
  use64bitall=define
  uselongdouble=undef
  usemymalloc=n
  default_inc_excludes_dot=define
  bincompat5005=undef
  Compiler​:
  cc='cc'
  ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_FORTIFY_SOURCE=2'
  optimize='-O2 -pipe -fstack-protector -fno-strict-aliasing'
  cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
  ccversion=''
  gccversion='4.2.1 Compatible FreeBSD Clang 6.0.1 (tags/RELEASE_601/final 335540)'
  gccosandvers=''
  intsize=4
  longsize=8
  ptrsize=8
  doublesize=8
  byteorder=12345678
  doublekind=3
  d_longlong=define
  longlongsize=8
  d_longdbl=define
  longdblsize=16
  longdblkind=3
  ivtype='long'
  ivsize=8
  nvtype='double'
  nvsize=8
  Off_t='off_t'
  lseeksize=8
  alignbytes=8
  prototype=define
  Linker and Libraries​:
  ld='cc'
  ldflags ='-pthread -Wl,-E -fstack-protector-strong -L/usr/local/lib'
  libpth=/usr/lib /usr/local/lib /usr/lib/clang/6.0.1/lib /usr/lib
  libs=-lpthread -lgdbm -ldl -lm -lcrypt -lutil
  perllibs=-lpthread -ldl -lm -lcrypt -lutil
  libc=
  so=so
  useshrplib=false
  libperl=libperl.a
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs
  dlext=so
  d_dlsymun=undef
  ccdlflags=' '
  cccdlflags='-DPIC -fPIC'
  lddlflags='-shared -L/usr/local/lib -fstack-protector-strong'

Characteristics of this binary (from libperl)​:
  Compile-time options​:
  HAS_TIMES
  MULTIPLICITY
  PERLIO_LAYERS
  PERL_COPY_ON_WRITE
  PERL_DONT_CREATE_GVSV
  PERL_IMPLICIT_CONTEXT
  PERL_MALLOC_WRAP
  PERL_OP_PARENT
  PERL_PRESERVE_IVUV
  PERL_USE_DEVEL
  USE_64_BIT_ALL
  USE_64_BIT_INT
  USE_ITHREADS
  USE_LARGE_FILES
  USE_LOCALE
  USE_LOCALE_COLLATE
  USE_LOCALE_CTYPE
  USE_LOCALE_NUMERIC
  USE_LOCALE_TIME
  USE_PERLIO
  USE_PERL_ATOF
  USE_REENTRANT_API
  Built under freebsd
  Compiled at Nov 17 2018 14​:26​:37
  %ENV​:
  PERL2DIR="/home/jkeenan/gitwork/perl2"
  PERL_WORKDIR="/home/jkeenan/gitwork/perl"
  @​INC​:
  lib
  /usr/local/lib/perl5/site_perl/5.29.5/amd64-freebsd-thread-multi
  /usr/local/lib/perl5/site_perl/5.29.5
  /usr/local/lib/perl5/5.29.5/amd64-freebsd-thread-multi
  /usr/local/lib/perl5/5.29.5

@p5pRT
Copy link
Author

p5pRT commented Nov 17, 2018

From @iabyn

On Sat, Nov 17, 2018 at 12​:58​:47PM -0800, James E Keenan (via RT) wrote​:

Recently we've been getting smoke-test failures on FreeBSD-13-CURRENT in
t/perf/benchmarks.t. See, for example​:

$ cd t;./perl harness -v perf/benchmarks.t; cd -
Cannot allocate memory while trying to read 'perf/benchmarks' at
perf/benchmarks.t line 19.

At that point perf/benchmarks.t is simply executing

  do 'perf/benchmarks';

and perf/benchmarks is a 2000-ish line chunk of perl src which
creates an array of 864 hashes.

So either the VM doesn't have enough memory to compile that bit of code,
or its hitting a stack limit while recursively scanning the op tree during
compilation. In which case...

max user processes (-u) 3416
open files (-n) 13635

it's much more likely to be one of these​:

  data seg size (kbytes, -d) unlimited
  max memory size (kbytes, -m) unlimited
  stack size (kbytes, -s) 8192
  virtual memory (kbytes, -v) unlimited

What do those give you on the BSD VM and its host?

I experimented at splitting the fixtures in t/perf/benchmarks into two
files, then modifying t/perf/benchmarks.t so that it does one run over
each of the two files. That worked; I did not get the "Cannot allocate
memory" error.

Unless someone has a better way of handling this problem, I'd like to
apply that splitting-up to blead so that we can reduce the amount of
"noise" coming from these apparently spurious test failures.

The file t/perf/benchmarks is the core of a benchmarking system for the
perl core; t/perf/benchmarks.t is just a quick sanity check that the file
is compilabe and that the code snippets within it are compilable.
Splitting t/perf/benchmarks in two involves changing a lot more
infrastructure than just t/perf/benchmarks.t.

We should probably just skip the test file when 'ulimit -X' gives a low
value (for whatever X it turns out to be) - and if possible find out
why perl is choking on a 2000-line src file, and maybe fix some of the
recursion limits in op.c if that is indeed the problem.

--
Counsellor Troi states something other than the blindingly obvious.
  -- Things That Never Happen in "Star Trek" #16

@p5pRT
Copy link
Author

p5pRT commented Nov 17, 2018

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Nov 17, 2018

From @jkeenan

On Sat, 17 Nov 2018 22​:37​:12 GMT, davem wrote​:

On Sat, Nov 17, 2018 at 12​:58​:47PM -0800, James E Keenan (via RT) wrote​:

Recently we've been getting smoke-test failures on FreeBSD-13-CURRENT in
t/perf/benchmarks.t. See, for example​:

$ cd t;./perl harness -v perf/benchmarks.t; cd -
Cannot allocate memory while trying to read 'perf/benchmarks' at
perf/benchmarks.t line 19.

At that point perf/benchmarks.t is simply executing

do 'perf/benchmarks';

and perf/benchmarks is a 2000-ish line chunk of perl src which
creates an array of 864 hashes.

So either the VM doesn't have enough memory to compile that bit of code,
or its hitting a stack limit while recursively scanning the op tree during
compilation. In which case...

max user processes (-u) 3416
open files (-n) 13635

it's much more likely to be one of these​:

data seg size           \(kbytes\, \-d\) unlimited
max memory size         \(kbytes\, \-m\) unlimited
stack size              \(kbytes\, \-s\) 8192
virtual memory          \(kbytes\, \-v\) unlimited

What do those give you on the BSD VM and its host?

# On the host​:

#####
$ ulimit -a | sort
core file size (512-blocks, -c) unlimited
cpu time (seconds, -t) unlimited
data seg size (kbytes, -d) 33554432
file size (512-blocks, -f) unlimited
kqueues (-k) unlimited
locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
max user processes (-u) 12171
open files (-n) 22500
pseudo-terminals (-p) unlimited
socket buffer size (bytes, -b) unlimited
stack size (kbytes, -s) 524288
swap limit (kbytes, -w) unlimited
umtx shared locks (-o) unlimited
virtual mem size (kbytes, -v) unlimited
#####

In the FreeBSD-13 VM​:

#####
% ulimit -a | sort
core file size (512-blocks, -c) unlimited
cpu time (seconds, -t) unlimited
data seg size (kbytes, -d) 33554432
file size (512-blocks, -f) unlimited
kqueues (-k) unlimited
locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
max user processes (-u) 3416
open files (-n) 13635
pseudo-terminals (-p) unlimited
socket buffer size (bytes, -b) unlimited
stack size (kbytes, -s) 524288
swap limit (kbytes, -w) unlimited
umtx shared locks (-o) unlimited
virtual mem size (kbytes, -v) unlimited
#####

I experimented at splitting the fixtures in t/perf/benchmarks into two
files, then modifying t/perf/benchmarks.t so that it does one run over
each of the two files. That worked; I did not get the "Cannot allocate
memory" error.

Unless someone has a better way of handling this problem, I'd like to
apply that splitting-up to blead so that we can reduce the amount of
"noise" coming from these apparently spurious test failures.

The file t/perf/benchmarks is the core of a benchmarking system for the
perl core; t/perf/benchmarks.t is just a quick sanity check that the file
is compilabe and that the code snippets within it are compilable.
Splitting t/perf/benchmarks in two involves changing a lot more
infrastructure than just t/perf/benchmarks.t.

We should probably just skip the test file when 'ulimit -X' gives a low
value (for whatever X it turns out to be) - and if possible find out
why perl is choking on a 2000-line src file, and maybe fix some of the
recursion limits in op.c if that is indeed the problem.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Nov 18, 2018

From @eserte

Dana Sat, 17 Nov 2018 12​:58​:46 -0800, jkeenan@​pobox.com reče​:

Recently we've been getting smoke-test failures on FreeBSD-13-CURRENT in
t/perf/benchmarks.t. See, for example​:

http​://perl5.test-smoke.org/report/74129

Note that the failures in t/perf/benchmarks.t are only occuring on
threaded builds. Note also the "No plan found in TAP output" message,
which is usually associated with a premature exit to the test process
rather than failures in individual tests.

I have not seen such failures on FreeBSD-11 (or any other platform, for
that matter) and we're not getting them in FreeBSD-12 smoke test
reports. Moreover, the test file and its data in t/perf/benchmarks have
been very stable for the last twelve months.

So these failures could be due to some combination of (a) changes in
Perl 5 blead; (b) changes in FreeBSD; or (c) limitations in the
particular FreeBSD instance in which the smoking is being performed.

To diagnose this I installed a FreeBSD-13 VM on a FreeBSD-11 host -- the
same host on which we have a different FreeBSD VM for the monthly
"test-against-dev" analysis. That VM comes from the list of VirtualBox
boxes provided by Hashicorp at vagrantup.com. I suspect that this VM is
quite similar to the one from which we're getting the reports of
failures in t/perf/benchmark.t.

I have been able to reproduce the failures when I build blead with these
configuration arguments​:

#####
$ ./perl -Ilib -V​:config_args
config_args='-des -Dusedevel -Duseithreads -Doptimize=-O2 -pipe
-fstack-protector -fno-strict-aliasing';

$ cd t;./perl harness -v perf/benchmarks.t; cd -
Cannot allocate memory while trying to read 'perf/benchmarks' at
perf/benchmarks.t line 19.
Dubious, test returned 12 (wstat 3072, 0xc00)
No subtests run

Test Summary Report
-------------------
perf/benchmarks.t (Wstat​: 3072 Tests​: 0 Failed​: 0)
Non-zero exit status​: 12
Parse errors​: No plan found in TAP output
Files=1, Tests=0, 0 wallclock secs ( 0.01 usr 0.01 sys + 0.01 cusr
0.01 csys = 0.03 CPU)
Result​: FAIL
#####

However, when I configure without threads, all tests PASS​:

#####
[perl2] $ ./perl -Ilib -V​:config_args
config_args='-des -Dusedevel';
[perl2] $ cd t;./perl harness perf/benchmarks.t; cd -
perf/benchmarks.t .. ok
All tests successful.
Files=1, Tests=1728, 1 wallclock secs ( 0.18 usr 0.02 sys + 0.08 cusr
0.03 csys = 0.30 CPU)
Result​: PASS
/home/jkeenan/gitwork/perl2
#####

That reproduces the results Carlos Guevara is reporting in the smoke
test report cited above.

When I conduct an internet search for "Cannot allocate memory while
trying to read", I mostly come up with cases on Linux. There's little
that's FreeBSD-specific. For what it's worth, here are two lines from
the output of 'ulimit -a' on this VM​:

#####
max user processes (-u) 3416
open files (-n) 13635
#####

In contrast, on the host on which this VM sits, the corresponding lines
from 'ulimit -a' are​:

#####
max user processes (-u) 12171
open files (-n) 22500
#####

This leads me to suspect that the problem is (c) -- a resource
constraint in the way this particular "box" has been set up -- rather
than something wrong in blead or in FreeBSD-13.

I experimented at splitting the fixtures in t/perf/benchmarks into two
files, then modifying t/perf/benchmarks.t so that it does one run over
each of the two files. That worked; I did not get the "Cannot allocate
memory" error.

Unless someone has a better way of handling this problem, I'd like to
apply that splitting-up to blead so that we can reduce the amount of
"noise" coming from these apparently spurious test failures.

Thank you very much.
Jim Keenan

Maybe related​: ZEFRAM/XML-Easy-0.011.tar.gz fails with perl 5.29.4 with a warning

  WARNING​: Complex regular subexpression recursion limit (65534) exceeded at t/syntax_main.t line 79, <GEN0> line 1635.

(seen on linux + freebsd). This does not happen with 5.29.3. So maybe something in blead is consuming more resources?

@p5pRT
Copy link
Author

p5pRT commented Nov 18, 2018

From @jkeenan

On Sun, 18 Nov 2018 16​:52​:44 GMT, slaven@​rezic.de wrote​:

Dana Sat, 17 Nov 2018 12​:58​:46 -0800, jkeenan@​pobox.com reče​:

Recently we've been getting smoke-test failures on FreeBSD-13-CURRENT
in
t/perf/benchmarks.t. See, for example​:

http​://perl5.test-smoke.org/report/74129

Note that the failures in t/perf/benchmarks.t are only occuring on
threaded builds. Note also the "No plan found in TAP output"
message,
which is usually associated with a premature exit to the test process
rather than failures in individual tests.

I have not seen such failures on FreeBSD-11 (or any other platform,
for
that matter) and we're not getting them in FreeBSD-12 smoke test
reports. Moreover, the test file and its data in t/perf/benchmarks
have
been very stable for the last twelve months.

So these failures could be due to some combination of (a) changes in
Perl 5 blead; (b) changes in FreeBSD; or (c) limitations in the
particular FreeBSD instance in which the smoking is being performed.

To diagnose this I installed a FreeBSD-13 VM on a FreeBSD-11 host --
the
same host on which we have a different FreeBSD VM for the monthly
"test-against-dev" analysis. That VM comes from the list of
VirtualBox
boxes provided by Hashicorp at vagrantup.com. I suspect that this VM
is
quite similar to the one from which we're getting the reports of
failures in t/perf/benchmark.t.

I have been able to reproduce the failures when I build blead with
these
configuration arguments​:

#####
$ ./perl -Ilib -V​:config_args
config_args='-des -Dusedevel -Duseithreads -Doptimize=-O2 -pipe
-fstack-protector -fno-strict-aliasing';

$ cd t;./perl harness -v perf/benchmarks.t; cd -
Cannot allocate memory while trying to read 'perf/benchmarks' at
perf/benchmarks.t line 19.
Dubious, test returned 12 (wstat 3072, 0xc00)
No subtests run

Test Summary Report
-------------------
perf/benchmarks.t (Wstat​: 3072 Tests​: 0 Failed​: 0)
Non-zero exit status​: 12
Parse errors​: No plan found in TAP output
Files=1, Tests=0, 0 wallclock secs ( 0.01 usr 0.01 sys + 0.01
cusr
0.01 csys = 0.03 CPU)
Result​: FAIL
#####

However, when I configure without threads, all tests PASS​:

#####
[perl2] $ ./perl -Ilib -V​:config_args
config_args='-des -Dusedevel';
[perl2] $ cd t;./perl harness perf/benchmarks.t; cd -
perf/benchmarks.t .. ok
All tests successful.
Files=1, Tests=1728, 1 wallclock secs ( 0.18 usr 0.02 sys + 0.08
cusr
0.03 csys = 0.30 CPU)
Result​: PASS
/home/jkeenan/gitwork/perl2
#####

That reproduces the results Carlos Guevara is reporting in the smoke
test report cited above.

When I conduct an internet search for "Cannot allocate memory while
trying to read", I mostly come up with cases on Linux. There's
little
that's FreeBSD-specific. For what it's worth, here are two lines
from
the output of 'ulimit -a' on this VM​:

#####
max user processes (-u) 3416
open files (-n) 13635
#####

In contrast, on the host on which this VM sits, the corresponding
lines
from 'ulimit -a' are​:

#####
max user processes (-u) 12171
open files (-n) 22500
#####

This leads me to suspect that the problem is (c) -- a resource
constraint in the way this particular "box" has been set up -- rather
than something wrong in blead or in FreeBSD-13.

I experimented at splitting the fixtures in t/perf/benchmarks into
two
files, then modifying t/perf/benchmarks.t so that it does one run
over
each of the two files. That worked; I did not get the "Cannot
allocate
memory" error.

Unless someone has a better way of handling this problem, I'd like to
apply that splitting-up to blead so that we can reduce the amount of
"noise" coming from these apparently spurious test failures.

Thank you very much.
Jim Keenan

Maybe related​: ZEFRAM/XML-Easy-0.011.tar.gz fails with perl 5.29.4
with a warning

WARNING​: Complex regular subexpression recursion limit (65534)
exceeded at t/syntax_main.t line 79, <GEN0> line 1635.

(seen on linux + freebsd). This does not happen with 5.29.3. So maybe
something in blead is consuming more resources?

No, this is a situation where a change in blead exposed sub-optimal code in XML​::Easy's test suite. This was detected in the October "CPAN-river-3000" run and I provided a patch to the author. See​: https://rt.cpan.org/Ticket/Display.html?id=127416#txn-1816119

Thank you very much.
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Nov 19, 2018

From @iabyn

On Sat, Nov 17, 2018 at 02​:44​:15PM -0800, James E Keenan via RT wrote​:

On Sat, 17 Nov 2018 22​:37​:12 GMT, davem wrote​:

On Sat, Nov 17, 2018 at 12​:58​:47PM -0800, James E Keenan (via RT) wrote​:

Recently we've been getting smoke-test failures on FreeBSD-13-CURRENT in
t/perf/benchmarks.t. See, for example​:

$ cd t;./perl harness -v perf/benchmarks.t; cd -
Cannot allocate memory while trying to read 'perf/benchmarks' at
perf/benchmarks.t line 19.

At that point perf/benchmarks.t is simply executing

do 'perf/benchmarks';

and perf/benchmarks is a 2000-ish line chunk of perl src which
creates an array of 864 hashes.

So either the VM doesn't have enough memory to compile that bit of code,
or its hitting a stack limit while recursively scanning the op tree during
compilation. In which case...

max user processes (-u) 3416
open files (-n) 13635

it's much more likely to be one of these​:

data seg size           \(kbytes\, \-d\) unlimited
max memory size         \(kbytes\, \-m\) unlimited
stack size              \(kbytes\, \-s\) 8192
virtual memory          \(kbytes\, \-v\) unlimited

What do those give you on the BSD VM and its host?

[ all other values identical on host and VM]

That's odd.

Does it fail if you execute the script directly​:

  ./perl t/perf/benchmarks

and if so does it appear to be just the size of the array of hashes it
creates, or something specific about the content?

--
Monto Blanco... scorchio!

@p5pRT
Copy link
Author

p5pRT commented Nov 19, 2018

From @jkeenan

On Mon, 19 Nov 2018 14​:55​:04 GMT, davem wrote​:

On Sat, Nov 17, 2018 at 02​:44​:15PM -0800, James E Keenan via RT wrote​:

On Sat, 17 Nov 2018 22​:37​:12 GMT, davem wrote​:

On Sat, Nov 17, 2018 at 12​:58​:47PM -0800, James E Keenan (via RT)
wrote​:

Recently we've been getting smoke-test failures on FreeBSD-13-
CURRENT in
t/perf/benchmarks.t. See, for example​:

$ cd t;./perl harness -v perf/benchmarks.t; cd -
Cannot allocate memory while trying to read 'perf/benchmarks' at
perf/benchmarks.t line 19.

At that point perf/benchmarks.t is simply executing

do 'perf/benchmarks';

and perf/benchmarks is a 2000-ish line chunk of perl src which
creates an array of 864 hashes.

So either the VM doesn't have enough memory to compile that bit of
code,
or its hitting a stack limit while recursively scanning the op tree
during
compilation. In which case...

max user processes (-u) 3416
open files (-n) 13635

it's much more likely to be one of these​:

data seg size (kbytes, -d) unlimited
max memory size (kbytes, -m) unlimited
stack size (kbytes, -s) 8192
virtual memory (kbytes, -v) unlimited

What do those give you on the BSD VM and its host?

[ all other values identical on host and VM]

That's odd.

Does it fail if you execute the script directly​:

./perl t/perf/benchmarks

and if so does it appear to be just the size of the array of hashes it
creates, or something specific about the content?

#####
[perl] $ ./perl -Ilib -v | head -2 | tail -1
This is perl 5, version 29, subversion 5 (v5.29.5 (v5.29.4-91-g2d0e7d1fca)) built for amd64-freebsd-thread-multi
[perl] $ ./perl -Ilib -V​:config_args
config_args='-des -Dusedevel -Duseithreads -Doptimize=-O2 -pipe -fstack-protector -fno-strict-aliasing';
[perl] $ cd t;./perl harness -v perf/benchmarks.t; cd -
Cannot allocate memory while trying to read 'perf/benchmarks' at perf/benchmarks.t line 19.
Dubious, test returned 12 (wstat 3072, 0xc00)
No subtests run

Test Summary Report


perf/benchmarks.t (Wstat​: 3072 Tests​: 0 Failed​: 0)
  Non-zero exit status​: 12
  Parse errors​: No plan found in TAP output
Files=1, Tests=0, 0 wallclock secs ( 0.02 usr 0.02 sys + 0.02 cusr 0.00 csys = 0.05 CPU)
Result​: FAIL
/home/jkeenan/gitwork/perl
[perl] $ ./perl -Ilib t/perf/benchmarks.t
Cannot allocate memory while trying to read 'perf/benchmarks' at t/perf/benchmarks.t line 19.
[perl] $ ./perl -Ilib t/perf/benchmarks
[perl] $
#####

Based on my debugging the other day, I would say that it's the size of the array of hashes rather than any specific element therein.

I started by commenting out all tests, then uncommenting them one "block" at a time -- where a block is a group of elements with similar keys -- then running the test. Repeat until FAIL. I got about 70% of the way through the file before I got the error.

I then reversed the process, commenting all tests out and uncommenting them from the bottom upwards. Once again, I got about 70% of the way through the file before the error occurred.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Nov 20, 2018

From @iabyn

On Mon, Nov 19, 2018 at 10​:57​:48AM -0800, James E Keenan via RT wrote​:

[perl] $ ./perl -Ilib t/perf/benchmarks.t
Cannot allocate memory while trying to read 'perf/benchmarks' at t/perf/benchmarks.t line 19.
[perl] $ ./perl -Ilib t/perf/benchmarks

I've just pushed the following commit. Can you retry ./perl -Ilib t/perf/benchmarks.t and show me what the error message is now?

commit 516795a
Author​: David Mitchell <davem@​iabyn.com>
AuthorDate​: Tue Nov 20 10​:59​:22 2018 +0000

  t/perf/benchmarks.t​: improve do error checks
 
  Make the checks for "do 't/perf/benchmarks'" look more like those
  suggested for 'do' in perlfunc.
 
  In particular, this may help track down the issue in RT #133663.

--
That he said that that that that is is is debatable, is debatable.

@p5pRT
Copy link
Author

p5pRT commented Nov 20, 2018

From @jkeenan

On Tue, 20 Nov 2018 11​:12​:39 GMT, davem wrote​:

On Mon, Nov 19, 2018 at 10​:57​:48AM -0800, James E Keenan via RT wrote​:

[perl] $ ./perl -Ilib t/perf/benchmarks.t
Cannot allocate memory while trying to read 'perf/benchmarks' at
t/perf/benchmarks.t line 19.
[perl] $ ./perl -Ilib t/perf/benchmarks

I've just pushed the following commit. Can you retry ./perl -Ilib
t/perf/benchmarks.t and show me what the error message is now?

commit 516795a
Author​: David Mitchell <davem@​iabyn.com>
AuthorDate​: Tue Nov 20 10​:59​:22 2018 +0000

t/perf/benchmarks.t​: improve do error checks

Make the checks for "do 't/perf/benchmarks'" look more like those
suggested for 'do' in perlfunc.

In particular, this may help track down the issue in RT #133663.

This looks good.

#####
[perl] $ uname -mrs
FreeBSD 13.0-CURRENT amd64
[perl] $ ./perl -Ilib -v | head -2 | tail -1
This is perl 5, version 29, subversion 5 (v5.29.5 (v5.29.4-99-g516795a038)) built for amd64-freebsd-thread-multi
[perl] $ ./perl -Ilib -V​:config_args
config_args='-des -Dusedevel -Duseithreads -Doptimize=-O2 -pipe -fstack-protector -fno-strict-aliasing';
[perl] $ cd t;./perl harness perf/benchmarks.t; cd -
perf/benchmarks.t .. ok
All tests successful.
Files=1, Tests=1728, 0 wallclock secs ( 0.18 usr 0.01 sys + 0.09 cusr 0.02 csys = 0.30 CPU)
Result​: PASS
/home/jkeenan/gitwork/perl
[perl] $ ./perl -Ilib t/perf/benchmarks.t
...
ok 1727 - running regex​::whilem​::max_captures_fail
ok 1728 - running regex​::whilem​::min_captures_fail

#####

I will close this ticket once I see smoke-test results. Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@jkeenan
Copy link
Contributor

jkeenan commented Jan 31, 2020

./perl -Ilib t/perf/benchmarks.t

I should have checked the smoke results a year-and-a-half ago!

[perl] $ uname -mrs
FreeBSD 13.0-CURRENT amd64
[perl] $ ./perl -v | head -2 | tail -1
This is perl 5, version 31, subversion 9 (v5.31.9 (v5.31.8-86-g2b301921ff)) built for amd64-freebsd-thread-multi
[perl] $ cc --version
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1)
Target: x86_64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin
[perl] $ ./perl -Ilib -V:config_args
config_args='-des -Dusedevel -Duseithreads -Doptimize=-O2 -pipe -fstack-protector -fno-strict-aliasing';
[perl] $ cd t;./perl harness perf/benchmarks.t; cd -
perf/benchmarks.t .. ok         
All tests successful.
Files=1, Tests=1732,  0 wallclock secs ( 0.20 usr  0.00 sys +  0.09 cusr  0.02 csys =  0.31 CPU)
Result: PASS

We're good. Closing.

@jkeenan jkeenan closed this as completed Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants