首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gen_sctp:open()。返回异常错误:错误的参数-仅针对Erlang从基于Rocky Linux的Docker映像源代码编译

gen_sctp:open()。返回异常错误:错误的参数-仅针对Erlang从基于Rocky Linux的Docker映像源代码编译
EN

Stack Overflow用户
提问于 2021-11-17 09:14:48
回答 1查看 90关注 0票数 0

不久前,我用erlang从源到编写了基于CentOS 7.9的22.3.4.11文件。一切正常--正如预期的那样:

代码语言:javascript
复制
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仅针对。

代码语言:javascript
复制
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:

代码语言:javascript
复制
# 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的差异):

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

发布于 2021-12-21 14:19:45

我再次测试了内核4.19.x5.15.5的所有内容,并注意到以下内容:

运行在基于kernel 4.19.x

  • CentOS 7.9的Docker映像上的
    1. Red 7.x机器与erlang-otp从源构建22.3.4.11 -正确工作基于的码头图像与erlang-otp构建22.3.4.11从源-不工作 (** exception error: bad argument)

  1. The相同的红帽7.x机器,但运行在基于kernel 5.15.5
  • CentOS 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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70001623

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档