stress-ng: clone system calls randomly fail with -EINVAL on aarch64

Bug #1573117 reported by Colin Ian King
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
stress-ng (Ubuntu)
Fix Released
High
Colin Ian King
Xenial
Fix Released
High
Colin Ian King

Bug Description

[SRU] Xenial

Getting -EINVAL on stressors that call clone() on aarch64. Turns out that the clone() thread's stack has to be 16 byte aligned.

[REPODUCER + FIX]
For example, run:

stress-ng --vm-rw 1 -v

Without the fix, this can randomly exit with -EINVAL when the stack being passed to the clone() system call is not aligned on a 16 byte boundary.

With the fix, the clone() system call works fine and the stressor will run.

[REGRESSION POTENIAL]
Minimal. I have exhaustively tested this on multiple platforms/architectures and the fix ensures that the stack is aligned correctly. stress-ng is a leaf project in universe and this fix only touches 3 of the stress-ng stressors that use the clone() system call.

Revision history for this message
Colin Ian King (colin-king) wrote :
Changed in stress-ng (Ubuntu):
importance: Undecided → High
assignee: nobody → Colin Ian King (colin-king)
status: New → Fix Committed
description: updated
Revision history for this message
Colin Ian King (colin-king) wrote :
description: updated
Changed in stress-ng (Ubuntu Xenial):
importance: Undecided → High
assignee: nobody → Colin Ian King (colin-king)
status: New → In Progress
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Colin, or anyone else affected,

Accepted stress-ng into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/stress-ng/0.05.23-1ubuntu1 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 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 to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

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

Changed in stress-ng (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Colin Ian King (colin-king) wrote :

This failed my testing, looks like I botched the mask and committed in a buggy fix. I've got an additional patch to address this issue:

http://kernel.ubuntu.com/git/cking/stress-ng.git/commit/?id=d12036f3b0bb62b2bc9203d1ca4dae032d50092e

Going to upload the fixed version ASAP.

tags: added: verification-failed
removed: verification-needed
Revision history for this message
Colin Ian King (colin-king) wrote :

..I got bitten that the original code worked on the machines I tested because I got lucky with random stack alignment. Gah.

Revision history for this message
Martin Pitt (pitti) wrote :

Hello Colin, or anyone else affected,

Accepted stress-ng into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/stress-ng/0.05.23-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 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 to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

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

tags: removed: verification-failed
tags: added: verification-needed
Revision history for this message
Colin Ian King (colin-king) wrote :

Tested, works on aarm64 dragonboard.

ubuntu@dragon410c:~$ dpkg -l | grep stress-ng
ii stress-ng 0.05.23-1ubuntu2 arm64 tool to load and stress a computer

ubuntu@dragon410c:~$ stress-ng --vm-rw 0 -v -t 10 --times
stress-ng: debug: [966] 4 processors online, 4 processors configured
stress-ng: info: [966] dispatching hogs: 4 vm-rw
stress-ng: debug: [966] cache allocate: reducing cache level from L3 (too high) to L2
stress-ng: info: [966] cache allocate: default cache size: 512K
stress-ng: debug: [966] starting stressors
stress-ng: debug: [967] stress-ng-vm-rw: started [967] (instance 0)
stress-ng: debug: [968] stress-ng-vm-rw: started [968] (instance 1)
stress-ng: debug: [966] 4 stressors spawned
stress-ng: debug: [969] stress-ng-vm-rw: started [969] (instance 2)
stress-ng: debug: [971] stress-ng-vm-rw: started [971] (instance 3)
stress-ng: debug: [968] stress-ng-vm-rw: exited [968] (instance 1)
stress-ng: debug: [967] stress-ng-vm-rw: exited [967] (instance 0)
stress-ng: debug: [966] process [967] terminated
stress-ng: debug: [966] process [968] terminated
stress-ng: debug: [969] stress-ng-vm-rw: exited [969] (instance 2)
stress-ng: debug: [966] process [969] terminated
stress-ng: debug: [971] stress-ng-vm-rw: exited [971] (instance 3)
stress-ng: debug: [966] process [971] terminated
stress-ng: info: [966] successful run completed in 10.11s
stress-ng: info: [966] for a 10.11s run time:
stress-ng: info: [966] 40.45s available CPU time
stress-ng: info: [966] 0.01s user time ( 0.02%)
stress-ng: info: [966] 40.20s system time ( 99.37%)
stress-ng: info: [966] 40.21s total time ( 99.40%)
stress-ng: info: [966] load average: 0.67 0.25 0.10

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

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

---------------
stress-ng (0.05.23-1ubuntu2) xenial; urgency=medium

  * Fix alignment mask to ensure stacks are 16 byte aligned (LP: #1573117)
    - incorrect mask used in previous fix, now using correct mask

stress-ng (0.05.23-1ubuntu1) xenial; urgency=medium

  * Ensure all clone() calls are 16 byte aligned for aarch64 (LP: #1573117)
  * stress-mmap: handle SIGBUS signals (LP: #1569468)

 -- Colin King <email address hidden> Tue, 26 Apr 2016 12:16:47 +0100

Changed in stress-ng (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for stress-ng has completed successfully and the package has now been 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.

Chris J Arges (arges)
Changed in stress-ng (Ubuntu):
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.