8000 getsockname() breakage? AMD64_LINUX · Issue #1196 · modula3/cm3 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

getsockname() breakage? AMD64_LINUX #1196

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

Open
dragisha opened this issue Dec 13, 2024 · 9 comments
Open

getsockname() breakage? AMD64_LINUX #1196

dragisha opened this issue Dec 13, 2024 · 9 comments

Comments

@dragisha
Copy link
Contributor

I am trying to support some of my old code and along the way, I upgraded my system to d5.11.9

At the moment when my code invokes getsockname();

PROCEDURE getsockname (fd: INTEGER): IP.Endpoint =
  TYPE
    Addr = Uin.struct_sockaddr_in;
  VAR
    addr: Addr;
    endpoint: IP.Endpoint;
    len: Usocket.socklen_t := BYTESIZE (addr);
  BEGIN
    IF Usocket.getsockname (fd, ADR (addr), ADR (len)) >= 0 THEN

I get this:

../src/unix/Common/Usocket.c:253: SockAddrNativeToM3: Assertion family == AF_INET || family == AF_INET6 || family == AF_UNIX' failed.`

Usocket.c code:

static
int
SockAddrNativeToM3(const NativeSockAddrUnionAll* native, M3SockAddrUnionAll* m3)
{
    const unsigned family = native->in.sin_family;
#ifdef AF_UNIX
    printf("in.sin_family=%d\n", family);     
    assert(family == AF_INET || family == AF_INET6 || family == AF_UNIX);

family value is zero at this point.

Does this ring a bell to someone? What changed and what do I have to adjust to make this work?

TIA,
dragisha

@dragisha
Copy link
Contributor Author

It's not so compatible with older code after all.

I will try to retrace this. I would also really appreciate hearing if anybody is using this latest & greatest version with simple TCP listener code.

commit 0584b288f5d083705371da01813d1249f80b27bc
Author: JayKrell <jay.krell@cornell.edu>
Date:   Tue Mar 16 21:51:24 2021 -0700

    m3core: Change Usocket to copy sockaddr in or out.
    Handle AF_INET, AF_INET6, and ifdef AF_UNIX.
    This should enable reverting related recent work,
    and get much after than that work, providing
    source compatibility to existing code while meeting
    the goals of converging platforms. Just at the slight cost
    of gnarly code (gnarly either way) and slight copying cost.


@dragisha
Copy link
Contributor Author

Back to d5.10.0, everything works.

@VictorMiasnikov
Copy link
Contributor

d5.11.9 -- is unfortunately non informative

This is affected
https://github.com/VictorMiasnikov/cm3/releases/tag/d5.11.9-ZZYYXX-20241118_21-50
?

@dragisha
Copy link
Contributor Author
dragisha commented Dec 14, 2024

Will check at some point. I fixed my problem now but will get back to it soon.

More information is - I was building it from the current master, as of a few days ago.

@VictorMiasnikov
Copy link
Contributor
VictorMiasnikov commented Dec 14, 2024

It set half-hidden. I will delete this msg

( Possible offtopic -- please see one old Issue related grammar of M3, or see L i n k e d I n , or send smb to vvm (at) tut.by

Thank! )

@dragisha
Copy link
Contributor Author

You lost me on gammar :), and what is smb? :)

@VictorMiasnikov
Copy link
Contributor
VictorMiasnikov commented Dec 14, 2024

It set half-hidden. I will delete this msg

r added...
smb -- somebody

@VictorMiasnikov
Copy link
Contributor
VictorMiasnikov commented Dec 14, 2024

( To All: I will delete offtopic messages later)
It set half-hidden. I will delete this msg

Battery is low --I switched to smartphone...

( To All: I will delete offtopic messages later)

@jaykrell
Copy link
Contributor
assert(family == AF_INET || family == AF_INET6 || family == AF_UNIX);

change to add || family == 0
?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0