不久前,我用erlang从源到编写了基于CentOS 7.9的22.3.4.11文件。一切正常--正如预期的那样:
Erlang/OTP 22 [erts-10.7.2.4] [source] [64-bit] [smp:32:32] [ds:32:32:10] [async-threads:1] [hipe]
Eshell V10.7.2.4 (abort with ^G)
1> gen_sctp:open().
{ok,#Port<0.6>}
2>现在,我正在尝试做同样的事情,但在RockyLinux8.4/8.5 Docker上,并从源代码构建相同的版本- 22.3.4.11。所有这些都是在同一台服务器上成功编译的(作为基于CentOS 7.x的Docker ),但是sctp不能正确地用于Rocky仅针对。
Erlang/OTP 22 [erts-10.7.2.4] [source] [64-bit] [smp:32:32] [ds:32:32:10] [async-threads:1] [hipe]
Eshell V10.7.2.4 (abort with ^G)
1> gen_sctp:open().
** exception error: bad argument
in function gen_sctp:open/1
called as gen_sctp:open([])
2>我还试着测试22.3.4.23版本,并显示了相同的错误。
我还试着从Rocky软件包安装yum install erlang.x86_64 - 22.0.7-1.el8,而且都很好。
我会在Rocky上使用自己的编译版本,这样可以轻松地将erlang更新到更新的版本。
请让我知道我应该做什么来修复洛基Linux的exception error: bad argument gen_sctp:open().?
Rocky Linux 8.5/CentOS 7.9.2009的Dockerfile:
# For Rocky Linux
FROM rockylinux/rockylinux:8.5
# For CentOS Linux - comment above FROM and uncomment below FROM
# FROM centos:7.9.2009
### Update Image packages
RUN echo 'tsflags=nodocs' >> /etc/yum.conf && \
yum clean all && \
yum update -y && \
yum install -y \
glibc-langpack-en \
diffutils \
findutils \
wget \
unzip \
gcc \
gcc-c++ \
autoconf.noarch \
ncurses-devel \
make \
unixODBC-devel.x86_64 \
lksctp-tools \
lksctp-tools-devel
ENV ERLANGOTP_VERSION 22.3.4.11
ENV ERLANGOTP_DIR_NAME otp_src_${ERLANGOTP_VERSION}
ENV ERLANGOTP_ARCHIVE otp_src_${ERLANGOTP_VERSION}.tar.gz
RUN wget https://github.com/erlang/otp/releases/download/OTP-${ERLANGOTP_VERSION}/${ERLANGOTP_ARCHIVE} -O /tmp/${ERLANGOTP_ARCHIVE} && \
tar -xf /tmp/${ERLANGOTP_ARCHIVE} -C /tmp && \
pushd /tmp/${ERLANGOTP_DIR_NAME} && \
./otp_build autoconf && \
./configure \
--enable-sctp \
--prefix=/usr/local \
&& \
make -j $(nproc) -l $(nproc) && \
make install && \
rm -rf /tmp/${ERLANGOTP_DIR_NAME} /tmp/${ERLANGOTP_ARCHIVE}码头建造命令:
docker build -t erltest:1.0.0 .
用于测试的Docker运行命令:
docker run -it --rm erltest:1.0.0 bash
erl
gen_sctp:open().
CentOS 7.9/Rocky Linux8.5DockerImage的SCTP配置结果(在注释中发现sctp的差异):
checking for netpacket/packet.h... yes
checking for netinet/sctp.h... yes
checking for sctp_bindx... no
checking for sctp_peeloff... no
checking for sctp_getladdrs... no
checking for sctp_freeladdrs... no
checking for sctp_getpaddrs... no
checking for sctp_freepaddrs... no
checking whether SCTP_UNORDERED is declared... yes
checking whether SCTP_ADDR_OVER is declared... yes
checking whether SCTP_ABORT is declared... yes
checking whether SCTP_EOF is declared... yes
# for CentOS 7.x - below:
checking whether SCTP_SENDALL is declared... yes
# for Rocky Linux - below:
checking whether SCTP_SENDALL is declared... no
checking whether SCTP_ADDR_CONFIRMED is declared... yes
checking whether SCTP_DELAYED_ACK_TIME is declared... yes
checking whether SCTP_EMPTY is declared... yes
checking whether SCTP_UNCONFIRMED is declared... yes
checking whether SCTP_CLOSED is declared... yes
checking whether SCTPS_IDLE is declared... no
checking whether SCTP_BOUND is declared... no
checking whether SCTPS_BOUND is declared... no
checking whether SCTP_LISTEN is declared... no
checking whether SCTPS_LISTEN is declared... no
checking whether SCTP_COOKIE_WAIT is declared... yes
checking whether SCTPS_COOKIE_WAIT is declared... no
checking whether SCTP_COOKIE_ECHOED is declared... yes
checking whether SCTPS_COOKIE_ECHOED is declared... no
checking whether SCTP_ESTABLISHED is declared... yes
checking whether SCTPS_ESTABLISHED is declared... no
checking whether SCTP_SHUTDOWN_PENDING is declared... yes
checking whether SCTPS_SHUTDOWN_PENDING is declared... no
checking whether SCTP_SHUTDOWN_SENT is declared... yes
checking whether SCTPS_SHUTDOWN_SENT is declared... no
checking whether SCTP_SHUTDOWN_RECEIVED is declared... yes
checking whether SCTPS_SHUTDOWN_RECEIVED is declared... no
checking whether SCTP_SHUTDOWN_ACK_SENT is declared... yes
checking whether SCTPS_SHUTDOWN_ACK_SENT is declared... no
checking for struct sctp_paddrparams.spp_pathmtu... yes
checking for struct sctp_paddrparams.spp_sackdelay... yes
checking for struct sctp_paddrparams.spp_flags... yes
checking for struct sctp_remote_error.sre_data... yes
checking for struct sctp_send_failed.ssf_data... yes
checking for struct sctp_event_subscribe.sctp_authentication_event... yes
checking for struct sctp_event_subscribe.sctp_sender_dry_event... yes
checking for sched.h... (cached) yes
...
checking ERTS version... 10.7.2.4
checking OTP release... 22
checking OTP version... 22.3.4.11发布于 2021-12-21 14:19:45
我再次测试了内核4.19.x和5.15.5的所有内容,并注意到以下内容:
运行在基于kernel 4.19.x
CentOS 7.9的Docker映像上的22.3.4.11 -正确工作基于的码头图像与erlang-otp构建22.3.4.11从源-不工作 (** exception error: bad argument)kernel 5.15.5CentOS 7.9的Docker映像与erlang从源生成({ok,#Port<0.6>})Rocky Linux 8.5 -基于({ok,#Port<0.6>})的正确工作与erlang构建源生成22.3.4.11 -正确工作
看起来,基于Rocky Linux 8.5创建的Docker喜欢现代内核。旧版本的4.19.x内核会引发问题,但是较新的5.15.5内核可以像预期的那样使用相同的基于Rocky Linux 8.5的Docker -我不知道为什么它会修复问题。
顺便说一下。默认的Rocky Linux 8.5内核是4.18.0。
https://stackoverflow.com/questions/70001623
复制相似问题