[SRU] wrk fails to run

Bug #2026760 reported by Juanjo Aparicio
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
wrk (Ubuntu)
Fix Released
Undecided
Unassigned
Mantic
Fix Released
Undecided
Unassigned

Bug Description

[ Impact ]

wrk is completely unusable as it will fail to run with the following error when tried to benchmark the http server:

$ wrk http://localhost/
PANIC: unprotected error in call to Lua API (attempt to index a nil value)

[ Test Plan ]

wrk is a http benchmarking tool and can be used to benchmark servers.

* Test with a local server:
  - Install wrk and apache2
  - execute "wrk http://127.0.0.1/"
  - It should show result like:

$ wrk http://127.0.0.1
Running 10s test @ http://127.0.0.1
  2 threads and 10 connections
  Thread Stats Avg Stdev Max +/- Stdev
    Latency 252.68us 396.44us 4.85ms 91.09%
    Req/Sec 33.23k 4.37k 43.34k 70.00%
  661179 requests in 10.00s, 6.73GB read
Requests/sec: 66114.70
Transfer/sec: 688.92MB

* Test with remote server:
  - Install wrk
  - execute "wrk https://ubuntu.com/"
  - It should show results like:

$ wrk https://ubuntu.com/
Running 10s test @ https://ubuntu.com/
  2 threads and 10 connections
  Thread Stats Avg Stdev Max +/- Stdev
    Latency 53.19ms 117.13ms 1.28s 95.87%
    Req/Sec 148.63 34.23 220.00 70.50%
  2964 requests in 10.01s, 293.91MB read
Requests/sec: 296.04
Transfer/sec: 29.36MB

[ Where problems could occur ]

This is not changing anything, is just a rebuild which Ubuntu missed for some reason. Debian has done the rebuild as '4.1.0-3+b2' for the libluajit transition. And, the chances of regression because of the rebuild is almost nil.

[ Other Info ]

Just for fun, I tried to do a benchmark of google.com also for a comparison with ubuntu.com benchmarking result.

$ wrk https://google.com
Running 10s test @ https://google.com
  2 threads and 10 connections
  Thread Stats Avg Stdev Max +/- Stdev
    Latency 187.83ms 175.23ms 949.07ms 81.17%
    Req/Sec 37.29 55.67 202.00 84.62%
  598 requests in 10.03s, 650.20KB read
Requests/sec: 59.62
Transfer/sec: 64.83KB

[ Original Bug Description ]

Running wrk 4.1.0-3build1 against a web server fails:

bnt@workstation:~$ wrk http://localhost/
PANIC: unprotected error in call to Lua API (attempt to index a nil value)

I'm running Ubuntu 23.04.

Running wrk with no options shows the help info:

bnt@workstation:~$ wrk
Usage: wrk <options> <url>
  Options:
    -c, --connections <N> Connections to keep open
    -d, --duration <T> Duration of test
    -t, --threads <N> Number of threads to use

    -s, --script <S> Load Lua script file
    -H, --header <H> Add header to request
        --latency Print latency statistics
        --timeout <T> Socket/request timeout
    -v, --version Print version details

  Numeric arguments may include a SI unit (1k, 1M, 1G)
  Time arguments may include a time unit (2s, 2m, 2h)

ldd shows wrk relies on libluajit-5.1.so.2, which is installed:

bnt@workstation:~$ ldd /usr/bin/wrk
 linux-vdso.so.1 (0x00007ffe049a4000)
 libluajit-5.1.so.2 => /lib/x86_64-linux-gnu/libluajit-5.1.so.2 (0x00007f30f0321000)
 libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f30f0238000)
 libssl.so.3 => /lib/x86_64-linux-gnu/libssl.so.3 (0x00007f30f0193000)
 libcrypto.so.3 => /lib/x86_64-linux-gnu/libcrypto.so.3 (0x00007f30efc00000)
 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f30ef800000)
 libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f30f016d000)
 /lib64/ld-linux-x86-64.so.2 (0x00007f30f03fe000)

bnt@workstation:~$ dpkg --list libluajit*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=====================-================================-============-============================>
ii libluajit-5.1-2:amd64 2.1.0~beta3+git20220320+dfsg-4.1 amd64 Just in time compiler for Lu>
ii libluajit-5.1-common 2.1.0~beta3+git20220320+dfsg-4.1 all Just in time compiler for Lu>
un libluajit2-5.1-2 <none> <none> (no description available)
un libluajit2-5.1-common <none> <none> (no description available)

Revision history for this message
Juanjo Aparicio (bnt) wrote :

I downloaded the package sources via

    apt-get download wrk

then proceeded to build the package with

    dpkg-buildpackage -us -uc

The process complained about missing libraries, libluajit-5.1-dev if I recall correctly. Installing it allowed me to build the package.

Installing the generated package results in a wrk binary that actually works.

Revision history for this message
Juanjo Aparicio (bnt) wrote :

Additional info: the package wrk 4.1.0-3build1 on Ubuntu 22.04.02 LTS *does* work correctly.

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in wrk (Ubuntu):
status: New → Confirmed
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

I can confirm that the issue is seen on Mantic. Also tested and confirmed Jammy and Noble are not affected.

Changed in wrk (Ubuntu Mantic):
status: New → Confirmed
assignee: nobody → Sudip Mukherjee (sudipmuk)
Changed in wrk (Ubuntu):
status: Confirmed → Fix Released
Changed in wrk (Ubuntu Mantic):
status: Confirmed → In Progress
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

debdiff attached for Mantic.

summary: - wrk fails to run
+ [SRU] wrk fails to run
description: updated
Changed in wrk (Ubuntu Mantic):
assignee: Sudip Mukherjee (sudipmuk) → nobody
status: In Progress → Confirmed
Revision history for this message
Lena Voytek (lvoytek) wrote :

sponsored the no change rebuild

Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Juanjo, or anyone else affected,

Accepted wrk into mantic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/wrk/4.1.0-3build2 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, what testing has been performed on the package and change the tag from verification-needed-mantic to verification-done-mantic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-mantic. 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 wrk (Ubuntu Mantic):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-mantic
Revision history for this message
Juanjo Aparicio (bnt) wrote :

I can confirm the proposed package fixes the issue for me.

Just upgraded to

ii wrk 4.1.0-3build2 amd64 HTTP benchmarking tool

Tested against the following webservers:

* localhost

bnt@workstation:~$ wrk http://localhost/
Running 10s test @ http://localhost/
  2 threads and 10 connections
  Thread Stats Avg Stdev Max +/- Stdev
    Latency 509.81us 4.59ms 86.87ms 99.17%
    Req/Sec 35.11k 5.34k 42.95k 82.50%
  698425 requests in 10.00s, 7.65GB read
Requests/sec: 69835.52
Transfer/sec: 783.22MB

* different host on the same LAN

bnt@workstation:~$ wrk http://www.fastpace.org/
Running 10s test @ http://www.fastpace.org/
  2 threads and 10 connections
  Thread Stats Avg Stdev Max +/- Stdev
    Latency 136.95us 27.55us 1.03ms 73.95%
    Req/Sec 35.24k 1.51k 38.68k 71.64%
  704908 requests in 10.10s, 314.61MB read
Requests/sec: 69797.92
Transfer/sec: 31.15MB

* Internet host

bnt@workstation:~$ wrk http://www.google.com/
Running 10s test @ http://www.google.com/
  2 threads and 10 connections
  Thread Stats Avg Stdev Max +/- Stdev
    Latency 441.69ms 61.96ms 774.67ms 75.00%
    Req/Sec 13.25 8.47 40.00 80.77%
  220 requests in 10.02s, 11.25MB read
Requests/sec: 21.96
Transfer/sec: 1.12MB

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

This bug was fixed in the package wrk - 4.1.0-3build2

---------------
wrk (4.1.0-3build2) mantic; urgency=medium

  * No-change rebuild to pick up alternative libluajit2
    dependency. (LP: #2026760)

 -- Sudip Mukherjee <email address hidden> Mon, 19 Feb 2024 20:34:42 +0000

Changed in wrk (Ubuntu Mantic):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for wrk 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.

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.