Hash :
f04a70f0
Author :
Date :
2022-10-22T22:23:52
Fix data-race in ws code (#1360)
@widgetii:
"
=================================================================
==985==ERROR: AddressSanitizer: heap-use-after-free on address 0xb24323e5 at pc 0xb6a06f1c bp 0x9fffc694 sp 0x9fffc260
WRITE of size 2 at 0xb24323e5 thread T22
#0 0xb6a06f1b in __interceptor_memcpy.part.43 (/usr/lib/libasan.so.5+0x41f1b)
0xb24323e5 is located 229 bytes inside of 512-byte region [0xb2432300,0xb2432500)
freed by thread T0 (app) here:
#0 0xb6a849df in free (/usr/lib/libasan.so.5+0xbf9df)
#1 0xb64b6e07 in evbuffer_drain (/usr/lib/libevent_core-2.2.so.1+0x9e07)
previously allocated by thread T22 here:
#0 0xb6a84d17 in __interceptor_malloc (/usr/lib/libasan.so.5+0xbfd17)
#1 0xb64b3d1b (/usr/lib/libevent_core-2.2.so.1+0x6d1b)
#2 0x61223 in onIceCandidateHandler /home/dima/git/app/src/webrtc/local.c:116
#3 0x19296f in onNewIceLocalCandidate /home/dima/git/webrtc-c/src/source/PeerConnection/PeerConnection.c:471
"
* upstream/pr/1360:
Remove bad copy-paste
Add locks for server WS, fixes #1357

$ ./configure
$ make
$ make verify # (optional)
$ sudo make install
See Documentation/Building#Autoconf for more information
Install CMake: https://www.cmake.org
$ md build && cd build
$ cmake -G "Visual Studio 10" .. # Or use any generator you want to use. Run cmake --help for a list
$ cmake --build . --config Release # Or "start libevent.sln" and build with menu in Visual Studio.
See Documentation/Building#Building on Windows for more information
$ mkdir build && cd build
$ cmake .. # Default to Unix Makefiles.
$ make
$ make verify # (optional)
See Documentation/Building#Building on Unix (With CMake) for more information
You can download and install libevent using the vcpkg dependency manager:
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install libevent
The libevent port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.
For the latest released version of Libevent, see the official website at http://libevent.org/ .
There’s a pretty good work-in-progress manual up at http://www.wangafu.net/~nickm/libevent-book/ .
For the latest development versions of Libevent, access our Git repository via
$ git clone https://github.com/libevent/libevent.git
You can browse the git repository online at:
https://github.com/libevent/libevent
To report bugs, issues, or ask for new features:
Patches: https://github.com/libevent/libevent/pulls
OK, those are not really patches. You fork, modify, and hit the “Create Pull Request” button. You can still submit normal git patches via the mailing list.
Bugs, Features [RFC], and Issues: https://github.com/libevent/libevent/issues
Or you can do it via the mailing list.
There’s also a libevent-users mailing list for talking about Libevent use and development:
http://archives.seul.org/libevent/users/
The following people have helped with suggestions, ideas, code or fixing bugs.