stress-ng-af-alg: bind failed, errno=110 (Connection timed out)

Bug #1851553 reported by Mauricio Faria de Oliveira
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
stress-ng (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Mauricio Faria de Oliveira
Disco
Fix Released
Undecided
Mauricio Faria de Oliveira
Eoan
Fix Released
Undecided
Mauricio Faria de Oliveira

Bug Description

[Impact]

 * Users running stress-ng's 'af-alg' stressor (which is part of the 'cpu'
   and 'os' classes of stressors) with 50+ instances, might get failure exit
   status and the message 'bind failed, errno=110 (Connection timed out)'.

 * For MAAS users, this means the CPU hardware tests (that run the 'cpu'
   class of stressors) on larger systems might report 'FAILED' status, thus
   possibly misleading admins about the hardware present in the system.

 * It has been determined the problem root cause is related to concurrent
   module loading request threshold in the kernel (50), which is exercised
   by the crypto API at the time of the bind() system call (so to load the
   crypto algorithm module requested).

 * The problem happens due to a race condition between the instance that
   exceeded the threshold of concurrent module loading (50 requests), then
   timed out while waiting for a second chance (5 seconds), and another
   instance that successfully made it and requested the module load but the
   module's self-tests didn't finish within the time-out running in the first
   instance (60 seconds), as all the CPUs are currently under stress;
   this error is then returned to userspace/bind().

 * Not all instances fail with that error, as once the crypto algorithm
   module is successfully loaded (i.e., by another concurrent instance
   and the module self-tests eventually finished), the problem no longer
   occurs.

 * The fix simply checks for ETIMEDOUT errno/failure on the bind() system
   call, and performs a bounded retry loop (3 attempts), as the module may
   just have been loaded successfully by another instance.

[Test Case]

 * A synthetic reproducer is available; a kernel module that uses kprobes to
   force the synchronization of af-alg instances to happen in the way needed
   to reproduce the problem. (comments #7 and #13, test in comments #10-#12)

 * With the kernel module loaded, one of the af-alg instances (not all of
   them) hits the bind() connection timed out if this patch is not applied.

[Regression Potential]

 * The code changes are minimal and contained within af-alg stressor code.

 * Differences in behavior might be af-alg/cpu/os stressors that now
   pass/exit with successful status on larger systems.

[Other Info]

 * Fix applied in stress-ng [1] on V0.10.09 and in Focal (development series).

 * Backport provided for these stable releases: Bionic, Disco, Eoan.

 [1] https://kernel.ubuntu.com/git/cking/stress-ng.git/commit/?id=637e0a9b7050cc69e76eeb7b61c14a659d8b8cfd

[Original Description]

The MAAS hardware test for CPU (long/12h) fails due to stress-ng-af-alg bind() errors.

stress-ng-cpu-long <...> Failed [View log]

disabled 'cpu-online' as it may hang the machine (enable it with the --pathological option)
dispatching hogs: 72 af-alg, 72 atomic, 72 branch, 72 bsearch, 72 cache, 72 context, 72 cpu, 72 crypt, 72 fp-error, 72 funccall, 72 getrandom, 72 heapsort, 72 hsearch, 72 icache, 72 ioport, 72 lockbus, 72 longjmp, 72 lsearch, 72 malloc, 72 matrix, 72 membarrier, 72 memcpy, 72 mergesort, 72 nop, 72 numa, 72 opcode, 72 qsort, 72 radixsort, 72 rdrand, 72 str, 72 stream, 72 tree, 72 tsc, 72 tsearch, 72 vecmath, 72 wcs, 72 zlib
stress-ng-numa: system has 2 of a maximum 1024 memory NUMA nodes
stress-ng-stream: stressor loosely based on a variant of the STREAM benchmark code
stress-ng-stream: do NOT submit any of these results to the STREAM benchmark results
stress-ng-stream: Using CPU cache size of 25344K
stress-ng-af-alg: bind failed, errno=110 (Connection timed out)
stress-ng-af-alg: bind failed, errno=110 (Connection timed out)
stress-ng-af-alg: bind failed, errno=110 (Connection timed out)
stress-ng-af-alg: bind failed, errno=110 (Connection timed out)
stress-ng-af-alg: bind failed, errno=110 (Connection timed out)
stress-ng-af-alg: bind failed, errno=110 (Connection timed out)
...
process 6626 (stress-ng-af_alg) terminated with an error, exit status=1 (stress-ng core failure)
process 6673 (stress-ng-af_alg) terminated with an error, exit status=1 (stress-ng core failure)
process 6713 (stress-ng-af_alg) terminated with an error, exit status=1 (stress-ng core failure)
process 6751 (stress-ng-af_alg) terminated with an error, exit status=1 (stress-ng core failure)
process 6800 (stress-ng-af_alg) terminated with an error, exit status=1 (stress-ng core failure)
...
unsuccessful run completed in 44935.38s (12 hours, 28 mins, 55.38 secs)
...

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

This fix has to wait the current SRU/upload of stress-ng in Eoan (0.10.07-1ubuntu1).

Changed in stress-ng (Ubuntu):
status: New → Fix Released
Changed in stress-ng (Ubuntu Bionic):
status: New → In Progress
assignee: nobody → Mauricio Faria de Oliveira (mfo)
Changed in stress-ng (Ubuntu Disco):
status: New → In Progress
assignee: nobody → Mauricio Faria de Oliveira (mfo)
Changed in stress-ng (Ubuntu Eoan):
status: New → In Progress
assignee: nobody → Mauricio Faria de Oliveira (mfo)
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Attached the debdiffs for B/D/E.
Colin King kindly agreed to review, before I upload them.

The packages built correctly on all architectures, with debug symbols enabled, on both -updates [1] and -proposed [2] enabled as dependency as well.

Testing details/evidence will be provided.

[1] https://launchpad.net/~mfo/+archive/ubuntu/lp1851553/
[2] https://launchpad.net/~mfo/+archive/ubuntu/lp1851553-proposed/

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Colin King reviewed the debdiffs, with positive feedback: "They all look good too me."

description: updated
description: updated
description: updated
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Attached synthetic reproducers used for Bionic (kmod_bionic.c) and Disco/Eoan (kmod.c)

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :
Download full text (4.6 KiB)

Testing on Bionic
=================

$ lsb_release -cs
bionic

$ uname -rv
4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019

Original: (ETIMEDOUT causes unsuccessful run)
--------

$ dpkg -s stress-ng | grep Version:
Version: 0.09.25-1ubuntu4

$ stress-ng --af-alg 2 -t 120

$ sudo modprobe -r md4
$ sudo insmod kmod.ko

$ strace -e bind -o stress-ng_strace_bind.updates_kmod -f -- stress-ng --af-alg 2 -t 120
stress-ng: info: [24185] dispatching hogs: 2 af-alg
stress-ng: fail: [24187] stress-ng-af-alg: bind failed, errno=110 (Connection timed out)
stress-ng: error: [24185] process 24187 (stress-ng-af_alg) terminated with an error, exit status=1 (stress-ng core failure)
stress-ng: info: [24185] unsuccessful run completed in 120.12s (2 mins, 0.12 secs)

$ sudo rmmod kmod

$ grep -e ETIMEDOUT -e 'exited with' stress-ng_strace_bind.updates_kmod
24187 <... bind resumed> ) = -1 ETIMEDOUT (Connection timed out)
24187 +++ exited with 1 +++
24186 +++ exited with 0 +++
24185 +++ exited with 2 +++

Console:
[ 1447.068493] hello
[ 1454.324451] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '24187', (original) return value '0'
[ 1454.329008] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '24186', (original) return value '0'
[ 1454.332156] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '24187', (modified) return value '-62' (FIRST PID) -- ensure crypto_larval_lookup() calls crypto_larval_add().
[ 1454.335468] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '24186', sleep for 10 seconds (OTHER PID) -- wait FIRST PID/crypto_larval_add()/down_write(&crypto_rwsem)
[ 1454.344373] down_write(&crypto_alg_sem) in FIRST PID, FIRST CALL. sleep 15 seconds -- wait OTHER PID/__crypto_register_alg()
[ 1464.467346] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '24186', slept for 10 seconds (OTHER PID)
[ 1464.485379] crypto_alg_tested("md4-generic"), sleep 70 seconds. pid = 24190 -- expire the 60-second timeout of FIRST_PID/crypto_larval_add()/crypto_larval_wait()
[ 1469.587269] down_write(&crypto_alg_sem) in FIRST PID, FIRST CALL. slept 15 seconds
[ 1534.610212] crypto_alg_tested("md4-generic"), slept 70 seconds
[ 1534.788821] CPU feature 'AVX registers' is not supported.
[ 1616.714910] bye

Modified: (ETIMEDOUT but still successful run)
--------

$ sudo reboot

$ apt-cache madison stress-ng | grep ppa
 stress-ng | 0.09.25-1ubuntu5 | http://ppa.launchpad.net/mfo/lp1851553/ubuntu bionic/main amd64 Packages

$ apt install stress-ng

$ dpkg -s stress-ng | grep Version:
Version: 0.09.25-1ubuntu5

$ stress-ng --af-alg 2 -t 120

$ sudo modprobe -r md4
$ sudo insmod kmod.ko

$ strace -e bind -o stress-ng_strace_bind.test-ppa_kmod -f -- stress-ng --af-alg 2 -t 120
stress-ng: info: [5263] dispatching hogs: 2 af-alg
stress-ng: info: [5263] successful run completed in 120.15s (2 mins, 0.15 secs)

$ sudo rmmod kmod

$ grep -e ETIMEDOUT -e 'exited with' stress-ng_strace_bind.test-ppa_kmod
5265 <... bind resumed> ) = -1 ETIMEDOUT (Connection timed out)
5265 +++ exited...

Read more...

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :
Download full text (4.9 KiB)

Testing on Disco
================

$ lsb_release -cs
disco

$ uname -rv
5.0.0-36-generic #39-Ubuntu SMP Tue Nov 12 09:46:06 UTC 2019

Original: (ETIMEDOUT causes unsuccessful run)
--------

$ dpkg -s stress-ng | grep Version:
Version: 0.09.57-0ubuntu3

$ stress-ng --af-alg 2 -t 120
stress-ng: info: [6902] dispatching hogs: 2 af-alg
stress-ng: info: [6902] successful run completed in 120.00s (2 mins, 0.00 secs)

$ sudo modprobe -r md4
$ sudo insmod kmod.ko

$ strace -e bind -o stress-ng_strace_bind.updates_kmod -f -- stress-ng --af-alg 2 -t 120
stress-ng: info: [2550] dispatching hogs: 2 af-alg
stress-ng: fail: [2552] stress-ng-af-alg: bind failed, errno=110 (Connection timed out)
stress-ng: error: [2550] process 2552 (stress-ng-af-alg) terminated with an error, exit status=1 (stress-ng core failure)
stress-ng: info: [2550] unsuccessful run completed in 120.00s (2 mins, 0.00 secs)

$ sudo rmmod kmod

$ grep -e ETIMEDOUT -e 'exited with' stress-ng_strace_bind.updates_kmod
2552 <... bind resumed> ) = -1 ETIMEDOUT (Connection timed out)
2552 +++ exited with 1 +++
2551 +++ exited with 0 +++
2550 +++ exited with 2 +++

[ 709.176027] hello
[ 732.529743] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '2552', (original) return value '10'
[ 732.530311] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '2551', (original) return value '10'
[ 732.533286] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '2552', (modified) return value '-62' (FIRST PID) return address 'ffffffffac8c2a8f' -- ensure crypto_larval_lookup() calls crypto_larval_add().
[ 732.536551] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '2551', sleep for 10 seconds (OTHER PID) -- wait FIRST PID/crypto_larval_add()/down_write(&crypto_rwsem)
[ 732.545221] down_write(&crypto_alg_sem) in FIRST PID, FIRST CALL. sleep 15 seconds -- wait OTHER PID/__crypto_register_alg()
[ 742.773053] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '2551', slept for 10 seconds (OTHER PID)
[ 742.792739] crypto_alg_tested("md4-generic"), sleep 70 seconds. pid = 2556 -- expire the 60-second timeout of FIRST_PID/crypto_larval_add()/crypto_larval_wait()
[ 747.637060] down_write(&crypto_alg_sem) in FIRST PID, FIRST CALL. slept 15 seconds
[ 814.453112] crypto_alg_tested("md4-generic"), slept 70 seconds
[ 814.630120] CPU feature 'AVX registers' is not supported.
[ 872.908469] bye

Modified: (ETIMEDOUT but still successful run)
--------

$ sudo reboot

$ apt-cache madison stress-ng | grep ppa
 stress-ng | 0.09.57-0ubuntu4 | http://ppa.launchpad.net/mfo/lp1851553/ubuntu disco/main amd64 Packages

$ sudo apt install stress-ng

$ dpkg -s stress-ng | grep Version:
Version: 0.09.57-0ubuntu4

$ stress-ng --af-alg 2 -t 120
stress-ng: info: [973] dispatching hogs: 2 af-alg
stress-ng: info: [973] successful run completed in 118.84s (1 min, 58.84 secs)

$ sudo modprobe -r md4
$ sudo insmod kmod.ko

$ strace -e bind -o stress-ng_strace_bind.test-ppa_kmod -f -- stress-ng --af-alg 2 -t 120
stress-ng: info: [1276] dispatching ho...

Read more...

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :
Download full text (4.9 KiB)

Testing on Eoan
===============

$ lsb_release -cs
eoan

$ uname -rv
5.3.0-19-generic #20-Ubuntu SMP Fri Oct 18 09:04:39 UTC 2019

Original: (ETIMEDOUT causes unsuccessful run)
--------

$ dpkg -s stress-ng | grep Version:
Version: 0.10.07-1ubuntu1

$ stress-ng --af-alg 2 -t 120
stress-ng: info: [9855] dispatching hogs: 2 af-alg
stress-ng: info: [9855] successful run completed in 120.00s (2 mins, 0.00 secs)

$ sudo modprobe -r md4
$ sudo insmod kmod.ko

$ strace -e bind -o stress-ng_strace_bind.updates_kmod -f -- stress-ng --af-alg 2 -t 120
stress-ng: info: [10875] dispatching hogs: 2 af-alg
stress-ng: fail: [10877] stress-ng-af-alg: bind failed, errno=110 (Connection timed out)
stress-ng: error: [10875] process 10877 (stress-ng-af-alg) terminated with an error, exit status=1 (stress-ng core failure)
stress-ng: info: [10875] unsuccessful run completed in 120.00s (2 mins, 0.00 secs)

$ sudo rmmod kmod

$ grep -e ETIMEDOUT -e 'exited with' stress-ng_strace_bind.updates_kmod
10877 <... bind resumed> ) = -1 ETIMEDOUT (Connection timed out)
10877 +++ exited with 1 +++
10876 +++ exited with 0 +++
10875 +++ exited with 2 +++

Console:

[ 6743.872738] hello
[ 6750.849145] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '10877', (original) return value '10'
[ 6750.850112] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '10876', (original) return value '10'
[ 6750.856261] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '10877', (modified) return value '-62' (FIRST PID) return address 'ffffffff892c6f5a' -- ensure crypto_larval_lookup() calls crypto_larval_add().
[ 6750.859332] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '10876', sleep for 10 seconds (OTHER PID) -- wait FIRST PID/crypto_larval_add()/down_write(&crypto_rwsem)
[ 6750.870830] down_write(&crypto_alg_sem) in FIRST PID, FIRST CALL. sleep 15 seconds -- wait OTHER PID/__crypto_register_alg()
[ 6760.875908] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '10876', slept for 10 seconds (OTHER PID)
[ 6760.891766] crypto_alg_tested("md4-generic"), sleep 70 seconds. pid = 10881 -- expire the 60-second timeout of FIRST_PID/crypto_larval_add()/crypto_larval_wait()
[ 6765.995913] down_write(&crypto_alg_sem) in FIRST PID, FIRST CALL. slept 15 seconds
[ 6831.531954] crypto_alg_tested("md4-generic"), slept 70 seconds
[ 6831.705902] CPU feature 'AVX registers' is not supported.
[ 6875.780559] bye

Modified: (ETIMEDOUT but still successful run)
--------

$ sudo reboot

$ apt-cache madison stress-ng | grep ppa
 stress-ng | 0.10.07-1ubuntu2 | http://ppa.launchpad.net/mfo/lp1851553/ubuntu eoan/main amd64 Packages

$ sudo apt install stress-ng

$ dpkg -s stress-ng | grep Version:
Version: 0.10.07-1ubuntu2

$ stress-ng --af-alg 2 -t 120
stress-ng: info: [974] dispatching hogs: 2 af-alg
stress-ng: info: [974] successful run completed in 118.81s (1 min, 58.81 secs)

$ sudo modprobe -r md4
$ sudo insmod kmod.ko

$ strace -e bind -o stress-ng_strace_bind.test-ppa_kmod -f -- stress-ng --af-alg 2 -t 120
stress-ng: info: [1...

Read more...

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :
description: updated
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

I asked Eric (slashd) for an additional review on this before uploading, to double check.

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Eric mentioned the changes 'lgtm' provided necessary testing had been done
(and testing steps/details are present in previous comments in this bug.)

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Checks performed before uploading
===

Unapproved Queues: (no stress-ng)
https://launchpad.net/ubuntu/bionic/+queue?queue_state=1&queue_text=stress-ng
https://launchpad.net/ubuntu/disco/+queue?queue_state=1&queue_text=stress-ng
https://launchpad.net/ubuntu/eoan/+queue?queue_state=1&queue_text=stress-ng

 $ package='stress-ng'; \
          releases='bionic disco eoan'; \
          for release in $releases; \
          do \
            echo "Checking the Unapproved queue of release '$release'"; \
            echo; \
            curl -sL "https://launchpad.net/ubuntu/${release}/+queue?queue_state=1&queue_text=${package}" \
              | grep 'The Unapproved queue is empty.' \
                  || echo " ... The Unapproved queue has matches for '$package'"; \
            echo;
          done

Pending SRU: (no stress-ng)
https://people.canonical.com/~ubuntu-archive/pending-sru.html

 $ package='stress-ng'; \
          curl -sL https://people.canonical.com/~ubuntu-archive/pending-sru.html | grep -e '^<h3>' -e "$package"

Upgrade Path: (ok along B/D/E/F)
---

Current Versions:
$ rmadison stress-ng | cut -d, -f1
...
 stress-ng | 0.09.25-1 | bionic/universe | source
 stress-ng | 0.09.25-1ubuntu4 | bionic-updates/universe | source
 stress-ng | 0.09.57-0ubuntu2 | disco/universe | source
 stress-ng | 0.09.57-0ubuntu3 | disco-updates/universe | source
 stress-ng | 0.10.07-1 | eoan/universe | source
 stress-ng | 0.10.07-1ubuntu1 | eoan-updates/universe | source
 stress-ng | 0.10.12-1 | focal/universe | source

Next Versions:

$ grep -m1 '^+stress-ng' */dput*/*.debdiff
bionic/dput-bionic/lp1851553_bionic.debdiff:+stress-ng (0.09.25-1ubuntu5) bionic; urgency=medium
disco/dput-disco/lp1851553_disco.debdiff:+stress-ng (0.09.57-0ubuntu4) disco; urgency=medium
eoan/dput-eoan/lp1851553-eoan.debdiff:+stress-ng (0.10.07-1ubuntu2) eoan; urgency=medium

Upgrade Path:

bionic-updates -> bionic-proposed:
$ dpkg --compare-versions 0.09.25-1ubuntu4 lt 0.09.25-1ubuntu5 && echo TRUE || echo FALSE
TRUE

bionic-proposed -> disco-updates:
$ dpkg --compare-versions 0.09.25-1ubuntu5 lt 0.09.57-0ubuntu3 && echo TRUE || echo FALSE
TRUE

disco-updates -> disco-proposed:
$ dpkg --compare-versions 0.09.57-0ubuntu3 lt 0.09.57-0ubuntu4 && echo TRUE || echo FALSE
TRUE

disco-proposed -> eoan-updates:
$ dpkg --compare-versions 0.09.57-0ubuntu4 lt 0.10.07-1ubuntu1 && echo TRUE || echo FALSE
TRUE

eoan-updates -> eoan-proposed:
$ dpkg --compare-versions 0.10.07-1ubuntu1 lt 0.10.07-1ubuntu2 && echo TRUE || echo FALSE
TRUE

eoan-proposed -> focal:
$ dpkg --compare-versions 0.10.07-1ubuntu2 lt 0.10.12-1 && echo TRUE || echo FALSE
TRUE

Changelog:

- LP: #<number> / ok
- d/p/file.patch matches actual filename and series file / ok

Patch:
- DEP3 headers: Origin/From, Subject/Description, Bug-Ubuntu. / ok
- Backport description / ok

Patch Series:
- Sequence number / ok

Build test:

- PPA with -updates / ok
- PPA with -proposed / ok
(comment #5)

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Package uploaded to bionic/disco/eoan.

Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Mauricio, or anyone else affected,

Accepted stress-ng into eoan-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/stress-ng/0.10.07-1ubuntu2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-eoan to verification-done-eoan. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-eoan. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in stress-ng (Ubuntu Eoan):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-eoan
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Mauricio, or anyone else affected,

Accepted stress-ng into disco-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/stress-ng/0.09.57-0ubuntu4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-disco to verification-done-disco. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-disco. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in stress-ng (Ubuntu Disco):
status: In Progress → Fix Committed
tags: added: verification-needed-disco
Changed in stress-ng (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed-bionic
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Mauricio, or anyone else affected,

Accepted stress-ng into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/stress-ng/0.09.25-1ubuntu5 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Verification done with eoan-proposed.
bind() fails with ETIMEDOUT and stress-ng finishes successfully.
--

$ multipass launch --cpus 4 --mem 4G --disk 4G --name lp1851553-e eoan
$ multipass shell lp1851553-e

$ echo "deb http://archive.ubuntu.com/ubuntu $(lsb_release -cs)-proposed universe" | sudo tee /etc/apt/sources.list.d/proposed.list
$ sudo apt update
$ sudo apt install -y stress-ng
$ sudo rm /etc/apt/sources.list.d/proposed.list

$ sudo apt install -y gcc make libelf-dev linux-headers-$(uname -r)

$ wget https://bugs.launchpad.net/ubuntu/+source/stress-ng/+bug/1851553/+attachment/5308837/+files/kmod.c

$ cat <<"EOF" | sed 's/^TAB/\t/' >Makefile
obj-m := kmod.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
TAB$(MAKE) -C $(KDIR) M=$(PWD) modules
clean:
TAB$(MAKE) -C $(KDIR) M=$(PWD) clean
EOF

$ make

$ lsb_release -cs
eoan

$ dpkg -s stress-ng | grep ^Version
Version: 0.10.07-1ubuntu2

$ uname -rv
5.3.0-24-generic #26-Ubuntu SMP Thu Nov 14 01:33:18 UTC 2019

$ stress-ng --af-alg 2 -t 20

$ sudo modprobe -r md4
$ sudo insmod kmod.ko

$ strace -e bind -o stress-ng_strace_bind.proposed_kmod -f -- stress-ng --af-alg 2 -t 120
stress-ng: info: [1407] dispatching hogs: 2 af-alg
stress-ng: info: [1407] successful run completed in 120.00s (2 mins, 0.00 secs)

$ sudo rmmod kmod

$ grep -e ETIMEDOUT -e 'exited with' stress-ng_strace_bind.proposed_kmod
1409 <... bind resumed> ) = -1 ETIMEDOUT (Connection timed out)
1409 +++ exited with 0 +++
1408 +++ exited with 0 +++
1407 +++ exited with 0 +++

$ dmesg
...
[ 365.484879] kmod: loading out-of-tree module taints kernel.
[ 365.484937] kmod: module verification failed: signature and/or required key missing - tainting kernel
[ 365.485334] hello
[ 370.473296] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '1409', (original) return value '10'
[ 370.482348] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '1408', (original) return value '10'
[ 370.484286] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '1409', (modified) return value '-62' (FIRST PID) return address 'ffffffffb66c709a' -- ensure crypto_larval_lookup() calls crypto_larval_add().
[ 370.490041] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '1408', sleep for 10 seconds (OTHER PID) -- wait FIRST PID/crypto_larval_add()/down_write(&crypto_rwsem)
[ 370.507659] down_write(&crypto_alg_sem) in FIRST PID, FIRST CALL. sleep 15 seconds -- wait OTHER PID/__crypto_register_alg()
[ 380.583129] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '1408', slept for 10 seconds (OTHER PID)
[ 380.618773] crypto_alg_tested("md4-generic"), sleep 70 seconds. pid = 1413 -- expire the 60-second timeout of FIRST_PID/crypto_larval_add()/crypto_larval_wait()
[ 385.703145] down_write(&crypto_alg_sem) in FIRST PID, FIRST CALL. slept 15 seconds
[ 452.007129] crypto_alg_tested("md4-generic"), slept 70 seconds
[ 509.268392] bye

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Verification done with disco-proposed.
bind() fails with ETIMEDOUT and stress-ng finishes successfully.
--

$ multipass launch --cpus 4 --mem 4G --disk 4G --name lp1851553-d disco
$ multipass shell lp1851553-d

$ echo "deb http://archive.ubuntu.com/ubuntu $(lsb_release -cs)-proposed universe" | sudo tee /etc/apt/sources.list.d/proposed.list
$ sudo apt update
$ sudo apt install -y stress-ng
$ sudo rm /etc/apt/sources.list.d/proposed.list

$ sudo apt install -y gcc make libelf-dev linux-headers-$(uname -r)

$ wget https://bugs.launchpad.net/ubuntu/+source/stress-ng/+bug/1851553/+attachment/5308837/+files/kmod.c

$ cat <<"EOF" | sed 's/^TAB/\t/' >Makefile
obj-m := kmod.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
TAB$(MAKE) -C $(KDIR) M=$(PWD) modules
clean:
TAB$(MAKE) -C $(KDIR) M=$(PWD) clean
EOF

$ make

$ lsb_release -cs
disco

$ dpkg -s stress-ng | grep ^Version
Version: 0.09.57-0ubuntu4

$ uname -rv
5.0.0-36-generic #39-Ubuntu SMP Tue Nov 12 09:46:06 UTC 2019

$ stress-ng --af-alg 2 -t 20

$ sudo modprobe -r md4
$ sudo insmod kmod.ko

$ strace -e bind -o stress-ng_strace_bind.proposed_kmod -f -- stress-ng --af-alg 2 -t 120
stress-ng: info: [17194] dispatching hogs: 2 af-alg
stress-ng: info: [17194] successful run completed in 120.00s (2 mins, 0.00 secs)

$ sudo rmmod kmod

$ grep -e ETIMEDOUT -e 'exited with' stress-ng_strace_bind.proposed_kmod
17196 <... bind resumed> ) = -1 ETIMEDOUT (Connection timed out)
17196 +++ exited with 0 +++
17195 +++ exited with 0 +++
17194 +++ exited with 0 +++

$ dmesg
...
[ 289.539191] kmod: loading out-of-tree module taints kernel.
[ 289.539292] kmod: module verification failed: signature and/or required key missing - tainting kernel
[ 289.539999] hello
[ 298.985346] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '17196', (original) return value '10'
[ 298.991378] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '17196', (modified) return value '-62' (FIRST PID) return address 'ffffffffbb0c2a8f' -- ensure crypto_larval_lookup() calls crypto_larval_add().
[ 298.994316] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '17195', (original) return value '10'
[ 298.998540] down_write(&crypto_alg_sem) in FIRST PID, FIRST CALL. sleep 15 seconds -- wait OTHER PID/__crypto_register_alg()
[ 299.000284] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '17195', sleep for 10 seconds (OTHER PID) -- wait FIRST PID/crypto_larval_add()/down_write(&crypto_rwsem)
[ 309.219770] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '17195', slept for 10 seconds (OTHER PID)
[ 309.239352] crypto_alg_tested("md4-generic"), sleep 70 seconds. pid = 17202 -- expire the 60-second timeout of FIRST_PID/crypto_larval_add()/crypto_larval_wait()
[ 314.083747] down_write(&crypto_alg_sem) in FIRST PID, FIRST CALL. slept 15 seconds
[ 380.387767] crypto_alg_tested("md4-generic"), slept 70 seconds

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :
Download full text (4.6 KiB)

Verification done with bionic-proposed.
bind() fails with ETIMEDOUT and stress-ng finishes successfully.
--

$ multipass launch --cpus 4 --mem 4G --disk 4G --name lp1851553-b bionic
$ multipass shell lp1851553-b

$ echo "deb http://archive.ubuntu.com/ubuntu $(lsb_release -cs)-proposed universe" | sudo tee /etc/apt/sources.list.d/proposed.list
$ sudo apt update
$ sudo apt install -y stress-ng
$ sudo rm /etc/apt/sources.list.d/proposed.list

$ sudo apt install -y gcc make libelf-dev linux-headers-$(uname -r)

$ wget https://bugs.launchpad.net/ubuntu/+source/stress-ng/+bug/1851553/+attachment/5308835/+files/kmod_bionic.c -O kmod.c

$ cat <<"EOF" | sed 's/^TAB/\t/' >Makefile
obj-m := kmod.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
TAB$(MAKE) -C $(KDIR) M=$(PWD) modules
clean:
TAB$(MAKE) -C $(KDIR) M=$(PWD) clean
EOF

$ make

$ lsb_release -cs
bionic

$ dpkg -s stress-ng | grep ^Version
Version: 0.09.25-1ubuntu5

$ uname -rv
4.15.0-70-generic #79-Ubuntu SMP Tue Nov 12 10:36:11 UTC 2019

$ stress-ng --af-alg 2 -t 20

$ sudo modprobe -r md4
$ sudo insmod kmod.ko

$ strace -e bind -o stress-ng_strace_bind.proposed_kmod -f -- stress-ng --af-alg 2 -t 120
stress-ng: info: [18926] dispatching hogs: 2 af-alg
stress-ng: info: [18926] successful run completed in 120.03s (2 mins, 0.03 secs)

$ sudo rmmod kmod

$ grep -e ETIMEDOUT -e 'exited with' stress-ng_strace_bind.proposed_kmod
18927 bind(4, {sa_family=AF_ALG, sa_data="hash\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0md4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, 88) = -1 ETIMEDOUT (Connection timed out)
18928 +++ exited with 0 +++
18927 +++ exited with 0 +++
18926 +++ exited with 0 +++

$ dmesg
...
[ 559.745309] kmod: loading out-of-tree module taints kernel.
[ 559.745423] kmod: module verification failed: signature and/or required key missing - tainting kernel
[ 559.745880] hello
[ 567.570886] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18928', (original) return value '0'
[ 567.574235] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18928', (modified) return value '-62' (FIRST PID) -- ensure crypto_larval_lookup() calls crypto_larval_add().
[ 567.579835] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18927', (original) return value '0'
[ 567.581534] down_write(&crypto_alg_sem) in FIRST PID, FIRST CALL. sleep 15 seconds -- wait OTHER PID/__crypto_register_alg()
[ 567.585936] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18927', sleep for 10 seconds (OTHER PID) -- wait FIRST PID/crypto_larval_add()/down_write(&crypto_rwsem)
[ 577.782958] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18927', slept for 10 seconds (OTHER PID)
[ 577.945825] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18927', (original) return value '0'
[ 577.952874] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18927', sleep for 10 seconds (OTHER PID) -- wait FIRST PID/...

Read more...

tags: added: verification-done verification-done-bionic verification-done-disco verification-done-eoan
removed: verification-needed verification-needed-bionic verification-needed-disco verification-needed-eoan
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package stress-ng - 0.10.07-1ubuntu2

---------------
stress-ng (0.10.07-1ubuntu2) eoan; urgency=medium

  * d/p/0005-stress-af-alg-handle-bind-ETIMEDOUT-failures.patch:
    retry bind() on ETIMEDOUT in case the requested module just
    gets loaded by another stress-af-alg worker. (LP: #1851553)

 -- Mauricio Faria de Oliveira <email address hidden> Wed, 06 Nov 2019 17:03:40 -0300

Changed in stress-ng (Ubuntu Eoan):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for stress-ng has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package stress-ng - 0.09.57-0ubuntu4

---------------
stress-ng (0.09.57-0ubuntu4) disco; urgency=medium

  * d/p/0004-stress-af-alg-handle-bind-ETIMEDOUT-failures.patch:
    retry bind() on ETIMEDOUT in case the requested module just
    gets loaded by another stress-af-alg worker. (LP: #1851553)

 -- Mauricio Faria de Oliveira <email address hidden> Wed, 06 Nov 2019 17:23:50 -0300

Changed in stress-ng (Ubuntu Disco):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package stress-ng - 0.09.25-1ubuntu5

---------------
stress-ng (0.09.25-1ubuntu5) bionic; urgency=medium

  * d/p/0015-stress-af-alg-handle-bind-ETIMEDOUT-failures.patch:
    retry bind() on ETIMEDOUT in case the requested module just
    gets loaded by another stress-af-alg worker. (LP: #1851553)

 -- Mauricio Faria de Oliveira <email address hidden> Wed, 06 Nov 2019 17:42:36 -0300

Changed in stress-ng (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.