Skip to content
This repository has been archived by the owner on Feb 18, 2023. It is now read-only.

tls: missing reset of TCP connection established flag #160

Merged
merged 1 commit into from
Dec 7, 2022

Conversation

cspiel1
Copy link
Collaborator

@cspiel1 cspiel1 commented Dec 6, 2022

The flag that indicates that the local TCP server to remote TCP client
connection was established has to be reset to false if the TCP connection is
closed.

Was found during working on: baresip/re#607

@cspiel1 cspiel1 changed the title tls: Set session only once before Client Hello tls: missing reset of TCP connection established flag Dec 6, 2022
@cspiel1
Copy link
Collaborator Author

cspiel1 commented Dec 6, 2022

A valgrind test fails. Do we need Ubuntu 20.04 like in re baresip/re#606?
Why was 22.04 a problem in re?

Edit: I see. It can be reproduced when compiling re, rem and retest with clang. Then invoke:

valgrind --leak-check=full --show-reachable=yes --error-exitcode=42 ./retest -v -r
==6738== Memcheck, a memory error detector
==6738== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==6738== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==6738== Command: ./retest -v -r
==6738== 
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x1b
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x1b
==6738== Valgrind: debuginfo reader: ensure_valid failed:
==6738== Valgrind:   during call to ML_(img_get)
==6738== Valgrind:   request for range [18060034, +4) exceeds
==6738== Valgrind:   valid image size of 954048 for image:
==6738== Valgrind:   "/home/cspiel/src/retest/retest"
==6738== 
==6738== Valgrind: debuginfo reader: Possibly corrupted debuginfo file.
==6738== Valgrind: I can't recover.  Giving up.  Sorry.

@sreimers
Copy link
Member

sreimers commented Dec 6, 2022

Yes we need to change the image or use -gdwarf-4 since valgrind has no dwarf-5 support.
And Ubuntu 22.04 fails with baresip/re#566

@cspiel1
Copy link
Collaborator Author

cspiel1 commented Dec 6, 2022

Do you want create a PR similar to baresip/re#606 for retest?

The flag that indicates that the local TCP server to remote TCP client
connection was established has to be reset to false if the TCP connection is
closed.
@cspiel1 cspiel1 marked this pull request as ready for review December 7, 2022 06:34
@alfredh alfredh merged commit 305596d into baresip:main Dec 7, 2022
@cspiel1 cspiel1 deleted the tls_session_reuse_cleanup branch December 7, 2022 12:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants