Skip to content

SEGV after infinite loop retrying proxy_socks5_read_connection_response #2352

Description

@emdee-is

I have weird networking problems with SOCKS proxies.

This is a very rare SEGV caught by gdb running python (gdb -ex r --args /usr/bin/python3.9). This is an infinite loop leading to a segv under toxygen when connected to a SOCKS5 proxy (Tor). This happening at a time when toxic on the same machine is completely blocked from Tox chat and NGC. SEGVs are a rare case under toxygen - I've very rarely seen it.

The tracebacks are Python running under gdb. toxygen is just wrapping libtoxcore, and any errors in the wrapping are almost always immediately fatal when calling, so I don't suspect toxygen.

So the trace is a mixture of:

  1. a recent c-toxcore compiled TRACE - those messages start
    TRAC>

  2. Python logging, which all looks normal. It starts:
    modname DEBUG|INFO debugmessage
    or DBUG+ or sometimes no prefix at all - [

  3. gdb traceback at the end

Comments:

@Green-Sky I'm not someone who knows the code, but I'd say the the code in TCP_client.c#950 is retrying proxy_socks5_read_connection_response an infinite number of times, and at the very least, as a failsafe, it must give up and fail after a set amount of time or number of tries. There should be no infinite loops.

@JFreegman Why is net_packet_type_name returning "unknown"?
There's no 0x05 entry in typedef enum Net_Packet_Type.

Traceback:

https://bin.nixnet.services/?bf35a2c2c484f266#9JRCgpKJ62Rsruu99Fdr4gzYGpZwWVtyncGWYWdWMosc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions