简体   繁体   English

Pip SSLError malloc 在chroot中失败

[英]Pip SSLError malloc failure in chroot

I have mounted a debian (linaro) based rootfs.img.raw created from sparse image (with simg2img ) and ran chroot:我已经安装了一个基于 debian (linaro) 的rootfs.img.raw从稀疏图像(使用simg2img )创建并运行 chroot:

$ sudo chroot /mnt/intrinsycimg qemu-aarch64-static /bin/bash

using qemu to emulate ARM64.使用 qemu 模拟 ARM64。 My qemu-aarch64 version is 2.11.1(Debian 1:2.11+dfsg-1ubuntu7.26).我的qemu-aarch64版本是 2.11.1(Debian 1:2.11+dfsg-1ubuntu7.26)。

Using pip (version 18.1) on python (version 3.7.3) I tried to install a random package with it, but I get the following error:在 python(版本 3.7.3)上使用 pip(版本 18.1)我尝试安装随机 package,但出现以下错误:

root@user:/home/linaro# pip3 install --user progress
qemu: Unsupported syscall: 278
Collecting progress
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(336236609, '[SSL] malloc failure (_ssl.c:2994)'))': /simple/progress/
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(336236609, '[SSL] malloc failure (_ssl.c:2994)'))': /simple/progress/
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(336236609, '[SSL] malloc failure (_ssl.c:2994)'))': /simple/progress/
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(336236609, '[SSL] malloc failure (_ssl.c:2994)'))': /simple/progress/
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(336236609, '[SSL] malloc failure (_ssl.c:2994)'))': /simple/progress/
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
  Could not find a version that satisfies the requirement progress (from versions: )
No matching distribution found for progress

I tried adding a --trusted-host flag as per this github issue answer and I got a malloc failure:我尝试根据此github 问题答案添加--trusted-host标志,但出现 malloc 失败:

root@user:/home/linaro# pip3 install progress --trusted-host pypi.org --trusted-host files.pythonhosted.org
qemu: Unsupported syscall: 278
Collecting progress
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(336236609, '[SSL] malloc failure (_ssl.c:2994)'))': /simple/progress/
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(336236609, '[SSL] malloc failure (_ssl.c:2994)'))': /simple/progress/
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(336236609, '[SSL] malloc failure (_ssl.c:2994)'))': /simple/progress/
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(336236609, '[SSL] malloc failure (_ssl.c:2994)'))': /simple/progress/
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(336236609, '[SSL] malloc failure (_ssl.c:2994)'))': /simple/progress/
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
  Could not fetch URL https://pypi.org/simple/progress/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/progress/ (Caused by SSLError(SSLError(336236609, '[SSL] malloc failure (_ssl.c:2994)'))) - skipping
  Could not find a version that satisfies the requirement progress (from versions: )
No matching distribution found for progress

I also tried to mount /run , /dev , /sys and /proc (eg sudo mount --rbind /run/ /mnt/linaroimg/run/ ) as this user suggested , but I get the same result.我还尝试按照 该用户的建议安装/run/dev/sys/proc (例如sudo mount --rbind /run/ /mnt/linaroimg/run/ ),但我得到了相同的结果。

My openssl version is OpenSSL 1.1.1d and I found an issue regardingmalloc failure for 1.1.1d , so if I run the same command I get the same error:我的 openssl 版本是OpenSSL 1.1.1d ,我发现一个关于malloc 故障的问题 1.1.1d ,所以如果我运行相同的命令,我会得到错误:

root@user:/home/linaro# python3 -c 'import urllib.request; urllib.request.urlopen("https://pypi.org")'
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 278
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.7/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/lib/python3.7/urllib/request.py", line 543, in _open
    '_open', req)
  File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.7/urllib/request.py", line 1360, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/usr/lib/python3.7/urllib/request.py", line 1285, in do_open
    h = http_class(host, timeout=req.timeout, **http_conn_args)
  File "/usr/lib/python3.7/http/client.py", line 1383, in __init__
    context = ssl._create_default_https_context()
  File "/usr/lib/python3.7/ssl.py", line 565, in create_default_context
    context = SSLContext(PROTOCOL_TLS)
  File "/usr/lib/python3.7/ssl.py", line 388, in __new__
    self = _SSLContext.__new__(cls, protocol)
ssl.SSLError: [SSL] malloc failure (_ssl.c:2994)

I tried manually compiling OpenSSL_1_1_1g version:我尝试手动编译OpenSSL_1_1_1g版本:

root@user:/home/linaro# openssl version
OpenSSL 1.1.1g  21 Apr 2020 (Library: OpenSSL 1.1.1d  10 Sep 2019)

but same end result.但最终结果相同。 I'm suspicious of Library: OpenSSL 1.1.1d , but I git cloned the openssl repo and checked out the OpenSSL_1.1.1g tag.我怀疑Library: OpenSSL 1.1.1d ,但我 git 克隆了 openssl 存储库并检查了OpenSSL_1.1.1g Also I would like to avoid compiling the openssl myself, since I prefer to update it via apt later on.另外我想避免自己编译 openssl,因为我更喜欢稍后通过 apt 更新它。

Any ideas how I should fix this issue?任何想法我应该如何解决这个问题?

The problem here is that you're using an old version of QEMU, which has known bugs in its linux-user mode support (it has in particular problems with multithreaded guest programs).这里的问题是您使用的是旧版本的 QEMU,它在其 linux 用户模式支持中存在已知错误(它在多线程来宾程序方面尤其存在问题)。 Trying a more recent version such as QEMU 5.0 should cause the errors to go away.尝试更新的版本(例如 QEMU 5.0)应该会导致 go 的错误消失。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM