Skip to content
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

connecache: fix multi-thread use of shared connection cache #4557

Closed
wants to merge 3 commits into from

Conversation

@bagder
Copy link
Member

bagder commented Nov 3, 2019

It could accidentally let the connection get used by more than one
thread, leading to double-free and more.

Reported-by: Christopher Reid
Fixes #4544

@bagder

This comment has been minimized.

Copy link
Member Author

bagder commented Nov 4, 2019

nah, still not quite there, segfaults in test 1541

@bagder bagder force-pushed the bagder/shared-connection-race branch 3 times, most recently from 82e4147 to 94d3061 Nov 4, 2019
@bagder

This comment has been minimized.

Copy link
Member Author

bagder commented Nov 8, 2019

I've now run test 1541 in this branch in a loop in my own FreeBSD 12 VM. 100 iterations and it didn't crash once. I've done the same on my Linux and it didn't crash once.

@bagder bagder force-pushed the bagder/shared-connection-race branch from 9e48b05 to e2b847a Nov 8, 2019
@bagder bagder force-pushed the bagder/shared-connection-race branch 2 times, most recently from fb1db1a to 308d5d8 Dec 2, 2019
@bagder

This comment has been minimized.

Copy link
Member Author

bagder commented Dec 8, 2019

I was able to reproduce this on mac and even though there's no valgrind on this platform, address sanitizer and more assert()s helped me this track down. Will polish and commit a fixup within shortly. Hopefully this was the same issue we saw on freebsd too.

bagder added 2 commits Dec 3, 2019
It could accidentally let the connection get used by more than one
thread, leading to double-free and more.

Reported-by: Christopher Reid
Fixes #4544
@bagder bagder force-pushed the bagder/shared-connection-race branch from 307c058 to 0d150e0 Dec 9, 2019
@bagder

This comment has been minimized.

Copy link
Member Author

bagder commented Dec 9, 2019

It seems to have fixed the race in 1541, but introduced a regression for 1700...

@bagder bagder closed this in ee263de Dec 9, 2019
@bagder bagder deleted the bagder/shared-connection-race branch Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.