metaeducation / ren-c

Library for embedding a Rebol interpreter into C codebases
GNU Lesser General Public License v3.0
128 stars 27 forks source link

Mystery TCP Binding Heisenbug #1147

Open hostilefork opened 2 years ago

hostilefork commented 2 years ago

It happens with the word tls from [the 'tls] in the open method.

This is roughly the character of the problem, though it's with PORT! not object:

port: make object! [
    state: make object! [
         connection: ~
     ]
]

scheme: make object! [
    actor: make object! [
        open: func [
            port [object!]
            <local> conn
        ][
            port.state.connection: conn: compose [
                scheme: (
                    either false [the 'tcp][the 'tls]
                )
            ]
        ]
    ]
]

scheme.actor.open port

The problem has been seen in READ of https://example.com, during the PERFORM-READ stacklevel

LABEL: <eval> @ FILE: ~anonymous~ @ LINE: 3477
LABEL: perform-read @ FILE: ~anonymous~ @ LINE: 3372
LABEL: <eval> @ FILE: ~anonymous~ @ LINE: 3372
LABEL: do-commands @ FILE: ~anonymous~ @ LINE: 3661
LABEL: <eval> @ FILE: ~anonymous~ @ LINE: 3661
LABEL: <anonymous> @ FILE: ~anonymous~ @ LINE: 4296
LABEL: connect @ FILE: ~anonymous~ @ LINE: 4296
LABEL: <eval> @ FILE: ~anonymous~ @ LINE: 4296
LABEL: <anonymous> @ FILE: ~anonymous~ @ LINE: 0
LABEL: open @ FILE: ~anonymous~ @ LINE: 0
LABEL: <eval> @ FILE: ~anonymous~ @ LINE: 0
LABEL: else @ FILE: ~anonymous~ @ LINE: 4232
LABEL: <eval> @ FILE: ~anonymous~ @ LINE: 4232
LABEL: <anonymous> @ FILE: /C/Projects/ren-c/tests/network/http.test.reb @ LINE: 18
LABEL: read @ FILE: /C/Projects/ren-c/tests/network/http.test.reb @ LINE: 18

Putting this information here to keep track of it in case future instances are seen.