Skip to content

Do not define unsupported IPPROTO_SCTP #15933

Description

@emmatyping

Hi! In working on CPython porting to Emscripten I discovered that IPPROTO_SCTP seems to be defined but when used leads to a failed assert.

My emcc -v output:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.0.0 (3fd52e107187b8a169bb04a02b9f982c8a075205)
clang version 14.0.0 (https://github.com/llvm/llvm-project 4348cd42c385e71b63e5da7e492172cff6a79d7b)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /home/ethanhs/emsdk/upstream/bin

I'm afraid I don't have a small easy reproduction, but you can reporduce the assertion by cloning https://github.com/ethanhs/python-wasm and pull my PR python/cpython#30495 to the cpython sub-directory. Here is the backtrace I get:

Aborted(Assertion failed: undefined)
exiting due to exception: RuntimeError: Aborted(Assertion failed: undefined),RuntimeError: Aborted(Assertion failed: undefined)
    at abort (/home/ethanhs/python-wasm/cpython/builddir/host/python.js:1511:11)
    at assert (/home/ethanhs/python-wasm/cpython/builddir/host/python.js:697:5)
    at Object.createSocket (/home/ethanhs/python-wasm/cpython/builddir/host/python.js:4719:11)
    at ___syscall_socket (/home/ethanhs/python-wasm/cpython/builddir/host/python.js:6643:25)
    at socket (<anonymous>:wasm-function[8038]:0x2e72af)
    at sock_initobj (<anonymous>:wasm-function[5651]:0x23728c)
    at wrap_init (<anonymous>:wasm-function[3135]:0x140540)
    at wrapperdescr_call (<anonymous>:wasm-function[468]:0x20c48)
    at _PyObject_MakeTpCall (<anonymous>:wasm-function[2352]:0xfda86)
    at PyObject_Vectorcall (<anonymous>:wasm-function[2360]:0xfe197)

which is the assert

var streaming = type == 1;
if (protocol) {
  assert(streaming == (protocol == 6)); // if SOCK_STREAM, must be tcp
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions