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

Sporadic munmap_chunk: invalid pointer or corrupted size vs. prev_size, corrupted double-linked list crashes installing ruby on Ubuntu 24.04 arm64 #2345

Closed
chadlwilson opened this issue Jul 3, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@chadlwilson
Copy link
Contributor

chadlwilson commented Jul 3, 2024

Describe the bug

I seem to be having issues installing Ruby with mise on arm64. This may be a ruby-build issue, I am not familiar enough with mise to understand the interactions.

Right now it seems to be crashing reliably on a first run with different reasons.

Seen all of

  • munmap_chunk: invalid pointer
  • corrupted size
  • corrupted double-linked list
  • free(): invalid next size (fast)
  • malloc(): unaligned tcache chunk detected

If I put it in a tight loop retrying I can get it up to where it downloads the Ruby version and starts make so there's some non-determinism here. Once it gets to installing once, it is fine, so I guess it's to do with something cached between "downloads ruby-build" and "ruby-build downloads Ruby 3.3.3".

This is quite possibly a ruby-build issue, so let me know if so, but couldn't replicate it with standard ruby-build commands :-(

Ruby build version will be 20240702 although Mise pulls the latest I believe, which might affect reproducibility.

To Reproduce

docker run -t ubuntu:24.04 bash -c 'apt-get update && apt-get -y install curl && (curl https://mise.jdx.dev/install.sh | sh) && /root/.local/bin/mise use --global --debug ruby@3.3.3 && ruby --version'

Similar with Ubuntu 22.04, also seen on CentOS Stream 9.

Expected behavior

Should install (or fail due to requirements for ruby-build not being met)

Additional context

Get:1 http://ports.ubuntu.com/ubuntu-ports noble InRelease [256 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports noble-updates InRelease [126 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports noble-backports InRelease [126 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports noble-security InRelease [126 kB]
Get:5 http://ports.ubuntu.com/ubuntu-ports noble/multiverse arm64 Packages [274 kB]
Get:6 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 Packages [1776 kB]
Get:7 http://ports.ubuntu.com/ubuntu-ports noble/restricted arm64 Packages [113 kB]
Get:8 http://ports.ubuntu.com/ubuntu-ports noble/universe arm64 Packages [19.0 MB]
Get:9 http://ports.ubuntu.com/ubuntu-ports noble-updates/multiverse arm64 Packages [12.2 kB]
Get:10 http://ports.ubuntu.com/ubuntu-ports noble-updates/main arm64 Packages [260 kB]
Get:11 http://ports.ubuntu.com/ubuntu-ports noble-updates/restricted arm64 Packages [165 kB]
Get:12 http://ports.ubuntu.com/ubuntu-ports noble-updates/universe arm64 Packages [132 kB]
Get:13 http://ports.ubuntu.com/ubuntu-ports noble-backports/universe arm64 Packages [9723 B]
Get:14 http://ports.ubuntu.com/ubuntu-ports noble-security/multiverse arm64 Packages [12.2 kB]
Get:15 http://ports.ubuntu.com/ubuntu-ports noble-security/universe arm64 Packages [70.9 kB]
Get:16 http://ports.ubuntu.com/ubuntu-ports noble-security/restricted arm64 Packages [165 kB]
Get:17 http://ports.ubuntu.com/ubuntu-ports noble-security/main arm64 Packages [226 kB]
Fetched 22.9 MB in 5s (4245 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  ca-certificates krb5-locales libbrotli1 libcurl4t64 libdb5.3t64 libgssapi-krb5-2 libk5crypto3 libkeyutils1
  libkrb5-3 libkrb5support0 libldap-common libldap2 libnghttp2-14 libpsl5t64 librtmp1 libsasl2-2 libsasl2-modules
  libsasl2-modules-db libssh-4 libssl3t64 openssl publicsuffix
Suggested packages:
  krb5-doc krb5-user libsasl2-modules-gssapi-mit | libsasl2-modules-gssapi-heimdal libsasl2-modules-ldap
  libsasl2-modules-otp libsasl2-modules-sql
The following NEW packages will be installed:
  ca-certificates curl krb5-locales libbrotli1 libcurl4t64 libdb5.3t64 libgssapi-krb5-2 libk5crypto3 libkeyutils1
  libkrb5-3 libkrb5support0 libldap-common libldap2 libnghttp2-14 libpsl5t64 librtmp1 libsasl2-2 libsasl2-modules
  libsasl2-modules-db libssh-4 openssl publicsuffix
The following packages will be upgraded:
  libssl3t64
1 upgraded, 22 newly installed, 0 to remove and 9 not upgraded.
Need to get 6077 kB of archives.
After this operation, 11.6 MB of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports noble-updates/main arm64 libssl3t64 arm64 3.0.13-0ubuntu3.1 [1795 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports noble-updates/main arm64 openssl arm64 3.0.13-0ubuntu3.1 [985 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 ca-certificates all 20240203 [159 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 krb5-locales all 1.20.1-6ubuntu2 [13.8 kB]
Get:5 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 libdb5.3t64 arm64 5.3.28+dfsg2-7 [732 kB]
Get:6 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 libkrb5support0 arm64 1.20.1-6ubuntu2 [33.9 kB]
Get:7 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 libk5crypto3 arm64 1.20.1-6ubuntu2 [85.6 kB]
Get:8 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 libkeyutils1 arm64 1.6.3-3build1 [9654 B]
Get:9 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 libkrb5-3 arm64 1.20.1-6ubuntu2 [349 kB]
Get:10 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 libgssapi-krb5-2 arm64 1.20.1-6ubuntu2 [141 kB]
Get:11 http://ports.ubuntu.com/ubuntu-ports noble-updates/main arm64 libnghttp2-14 arm64 1.59.0-1ubuntu0.1 [74.4 kB]
Get:12 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 libpsl5t64 arm64 0.21.2-1.1build1 [57.4 kB]
Get:13 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 publicsuffix all 20231001.0357-0.1 [129 kB]
Get:14 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 libbrotli1 arm64 1.1.0-2build2 [339 kB]
Get:15 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 libsasl2-modules-db arm64 2.1.28+dfsg1-5ubuntu3 [21.4 kB]
Get:16 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 libsasl2-2 arm64 2.1.28+dfsg1-5ubuntu3 [54.7 kB]
Get:17 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 libldap2 arm64 2.6.7+dfsg-1~exp1ubuntu8 [193 kB]
Get:18 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 librtmp1 arm64 2.4+20151223.gitfa8646d.1-2build7 [57.8 kB]
Get:19 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 libssh-4 arm64 0.10.6-2build2 [189 kB]
Get:20 http://ports.ubuntu.com/ubuntu-ports noble-updates/main arm64 libcurl4t64 arm64 8.5.0-2ubuntu10.1 [333 kB]
Get:21 http://ports.ubuntu.com/ubuntu-ports noble-updates/main arm64 curl arm64 8.5.0-2ubuntu10.1 [222 kB]
Get:22 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 libldap-common all 2.6.7+dfsg-1~exp1ubuntu8 [31.4 kB]
Get:23 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 libsasl2-modules arm64 2.1.28+dfsg1-5ubuntu3 [69.4 kB]
Fetched 6077 kB in 4s (1365 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 4363 files and directories currently installed.)
Preparing to unpack .../libssl3t64_3.0.13-0ubuntu3.1_arm64.deb ...
Unpacking libssl3t64:arm64 (3.0.13-0ubuntu3.1) over (3.0.13-0ubuntu3) ...
Setting up libssl3t64:arm64 (3.0.13-0ubuntu3.1) ...
Selecting previously unselected package openssl.
(Reading database ... 4363 files and directories currently installed.)
Preparing to unpack .../00-openssl_3.0.13-0ubuntu3.1_arm64.deb ...
Unpacking openssl (3.0.13-0ubuntu3.1) ...
Selecting previously unselected package ca-certificates.
Preparing to unpack .../01-ca-certificates_20240203_all.deb ...
Unpacking ca-certificates (20240203) ...
Selecting previously unselected package krb5-locales.
Preparing to unpack .../02-krb5-locales_1.20.1-6ubuntu2_all.deb ...
Unpacking krb5-locales (1.20.1-6ubuntu2) ...
Selecting previously unselected package libdb5.3t64:arm64.
Preparing to unpack .../03-libdb5.3t64_5.3.28+dfsg2-7_arm64.deb ...
Unpacking libdb5.3t64:arm64 (5.3.28+dfsg2-7) ...
Selecting previously unselected package libkrb5support0:arm64.
Preparing to unpack .../04-libkrb5support0_1.20.1-6ubuntu2_arm64.deb ...
Unpacking libkrb5support0:arm64 (1.20.1-6ubuntu2) ...
Selecting previously unselected package libk5crypto3:arm64.
Preparing to unpack .../05-libk5crypto3_1.20.1-6ubuntu2_arm64.deb ...
Unpacking libk5crypto3:arm64 (1.20.1-6ubuntu2) ...
Selecting previously unselected package libkeyutils1:arm64.
Preparing to unpack .../06-libkeyutils1_1.6.3-3build1_arm64.deb ...
Unpacking libkeyutils1:arm64 (1.6.3-3build1) ...
Selecting previously unselected package libkrb5-3:arm64.
Preparing to unpack .../07-libkrb5-3_1.20.1-6ubuntu2_arm64.deb ...
Unpacking libkrb5-3:arm64 (1.20.1-6ubuntu2) ...
Selecting previously unselected package libgssapi-krb5-2:arm64.
Preparing to unpack .../08-libgssapi-krb5-2_1.20.1-6ubuntu2_arm64.deb ...
Unpacking libgssapi-krb5-2:arm64 (1.20.1-6ubuntu2) ...
Selecting previously unselected package libnghttp2-14:arm64.
Preparing to unpack .../09-libnghttp2-14_1.59.0-1ubuntu0.1_arm64.deb ...
Unpacking libnghttp2-14:arm64 (1.59.0-1ubuntu0.1) ...
Selecting previously unselected package libpsl5t64:arm64.
Preparing to unpack .../10-libpsl5t64_0.21.2-1.1build1_arm64.deb ...
Unpacking libpsl5t64:arm64 (0.21.2-1.1build1) ...
Selecting previously unselected package publicsuffix.
Preparing to unpack .../11-publicsuffix_20231001.0357-0.1_all.deb ...
Unpacking publicsuffix (20231001.0357-0.1) ...
Selecting previously unselected package libbrotli1:arm64.
Preparing to unpack .../12-libbrotli1_1.1.0-2build2_arm64.deb ...
Unpacking libbrotli1:arm64 (1.1.0-2build2) ...
Selecting previously unselected package libsasl2-modules-db:arm64.
Preparing to unpack .../13-libsasl2-modules-db_2.1.28+dfsg1-5ubuntu3_arm64.deb ...
Unpacking libsasl2-modules-db:arm64 (2.1.28+dfsg1-5ubuntu3) ...
Selecting previously unselected package libsasl2-2:arm64.
Preparing to unpack .../14-libsasl2-2_2.1.28+dfsg1-5ubuntu3_arm64.deb ...
Unpacking libsasl2-2:arm64 (2.1.28+dfsg1-5ubuntu3) ...
Selecting previously unselected package libldap2:arm64.
Preparing to unpack .../15-libldap2_2.6.7+dfsg-1~exp1ubuntu8_arm64.deb ...
Unpacking libldap2:arm64 (2.6.7+dfsg-1~exp1ubuntu8) ...
Selecting previously unselected package librtmp1:arm64.
Preparing to unpack .../16-librtmp1_2.4+20151223.gitfa8646d.1-2build7_arm64.deb ...
Unpacking librtmp1:arm64 (2.4+20151223.gitfa8646d.1-2build7) ...
Selecting previously unselected package libssh-4:arm64.
Preparing to unpack .../17-libssh-4_0.10.6-2build2_arm64.deb ...
Unpacking libssh-4:arm64 (0.10.6-2build2) ...
Selecting previously unselected package libcurl4t64:arm64.
Preparing to unpack .../18-libcurl4t64_8.5.0-2ubuntu10.1_arm64.deb ...
Unpacking libcurl4t64:arm64 (8.5.0-2ubuntu10.1) ...
Selecting previously unselected package curl.
Preparing to unpack .../19-curl_8.5.0-2ubuntu10.1_arm64.deb ...
Unpacking curl (8.5.0-2ubuntu10.1) ...
Selecting previously unselected package libldap-common.
Preparing to unpack .../20-libldap-common_2.6.7+dfsg-1~exp1ubuntu8_all.deb ...
Unpacking libldap-common (2.6.7+dfsg-1~exp1ubuntu8) ...
Selecting previously unselected package libsasl2-modules:arm64.
Preparing to unpack .../21-libsasl2-modules_2.1.28+dfsg1-5ubuntu3_arm64.deb ...
Unpacking libsasl2-modules:arm64 (2.1.28+dfsg1-5ubuntu3) ...
Setting up libkeyutils1:arm64 (1.6.3-3build1) ...
Setting up libbrotli1:arm64 (1.1.0-2build2) ...
Setting up libsasl2-modules:arm64 (2.1.28+dfsg1-5ubuntu3) ...
Setting up libpsl5t64:arm64 (0.21.2-1.1build1) ...
Setting up libnghttp2-14:arm64 (1.59.0-1ubuntu0.1) ...
Setting up krb5-locales (1.20.1-6ubuntu2) ...
Setting up libldap-common (2.6.7+dfsg-1~exp1ubuntu8) ...
Setting up libkrb5support0:arm64 (1.20.1-6ubuntu2) ...
Setting up librtmp1:arm64 (2.4+20151223.gitfa8646d.1-2build7) ...
Setting up libk5crypto3:arm64 (1.20.1-6ubuntu2) ...
Setting up libdb5.3t64:arm64 (5.3.28+dfsg2-7) ...
Setting up libkrb5-3:arm64 (1.20.1-6ubuntu2) ...
Setting up openssl (3.0.13-0ubuntu3.1) ...
Setting up publicsuffix (20231001.0357-0.1) ...
Setting up libsasl2-modules-db:arm64 (2.1.28+dfsg1-5ubuntu3) ...
Setting up ca-certificates (20240203) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 79.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC entries checked: /etc/perl /usr/local/lib/aarch64-linux-gnu/perl/5.38.2 /usr/local/share/perl/5.38.2 /usr/lib/aarch64-linux-gnu/perl5/5.38 /usr/share/perl5 /usr/lib/aarch64-linux-gnu/perl-base /usr/lib/aarch64-linux-gnu/perl/5.38 /usr/share/perl/5.38 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 8.)
debconf: falling back to frontend: Teletype
Updating certificates in /etc/ssl/certs...
146 added, 0 removed; done.
Setting up libgssapi-krb5-2:arm64 (1.20.1-6ubuntu2) ...
Setting up libsasl2-2:arm64 (2.1.28+dfsg1-5ubuntu3) ...
Setting up libssh-4:arm64 (0.10.6-2build2) ...
Setting up libldap2:arm64 (2.6.7+dfsg-1~exp1ubuntu8) ...
Setting up libcurl4t64:arm64 (8.5.0-2ubuntu10.1) ...
Setting up curl (8.5.0-2ubuntu10.1) ...
Processing triggers for libc-bin (2.39-0ubuntu8) ...
Processing triggers for ca-certificates (20240203) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6300  100  6300    0     0  10777      0 --:--:-- --:--:-- --:--:-- 10787
mise: installing mise...
######################################################################## 100.0%
mise: installed successfully to /root/.local/bin/mise
mise: run `/root/.local/bin/mise --help` to get started
[DEBUG] ARGS: /root/.local/bin/mise use --global --debug ruby@3.3.3
[DEBUG] Config {
    Config Files: [],
}
[DEBUG] Toolset (29.583µs):
[DEBUG] install_versions: ruby@3.3.3
[DEBUG] ToolRequestSet.build(2.125µs): ToolRequestSet:

[DEBUG] GET http://mise-versions.jdx.dev/ruby
[DEBUG] starting new connection: http://mise-versions.jdx.dev/
[DEBUG] GET http://mise-versions.jdx.dev/ruby 200 OK
[DEBUG] Updating ruby-build in /root/.cache/mise/ruby/ruby-build
[DEBUG] Installing ruby-build to /root/.cache/mise/ruby/ruby-build
[DEBUG] cloning https://github.com/rbenv/ruby-build.git to /tmp/mise-ruby-build
munmap_chunk(): invalid pointer
@chadlwilson chadlwilson added the bug Something isn't working label Jul 3, 2024
@chadlwilson chadlwilson changed the title Sporadic munmap_chunk: invalid pointer or corrupted size vs. prev_size crashes installing ruby on Ubuntu 24.04 arm64 Sporadic munmap_chunk: invalid pointer or corrupted size vs. prev_size, corrupted double-lined list crashes installing ruby on Ubuntu 24.04 arm64 Jul 3, 2024
@chadlwilson chadlwilson changed the title Sporadic munmap_chunk: invalid pointer or corrupted size vs. prev_size, corrupted double-lined list crashes installing ruby on Ubuntu 24.04 arm64 Sporadic munmap_chunk: invalid pointer or corrupted size vs. prev_size, corrupted double-linked list crashes installing ruby on Ubuntu 24.04 arm64 Jul 3, 2024
@jdx
Copy link
Owner

jdx commented Jul 3, 2024

duplicate of #2196 and #2287

@jdx jdx closed this as completed Jul 3, 2024
@chadlwilson
Copy link
Contributor Author

Oh, strange. Didn't show up in my search for the most common of the errors. Sorry.

@chadlwilson
Copy link
Contributor Author

chadlwilson commented Jul 9, 2024

For anyone who comes across this issue rather than the others I accidentally duplicated, this appears to be resolved in 2024.7.1 onwards (by #2357), at least for all the cases I could reproduce personally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants