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

iocp: fix crash, GetQueuedCompletionStatus() write freed WSAOVERLAPPED memory #4136

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ad71e9d
iocp: fix crash, GetQueuedCompletionStatus() write freed WSAOVERLAPPE…
jimying Nov 7, 2024
ccecf7e
wrap some logic to functions to make code clean
jimying Nov 8, 2024
7908954
remove one useless code
jimying Nov 8, 2024
0fc931d
Simplify the cancel pending io logic
jimying Nov 14, 2024
ea00645
avoid double key-unregistration
jimying Nov 17, 2024
9a5cbb7
minor optimization: no memcpy
jimying Nov 17, 2024
99adb39
Add check to confirm there're no pending operations before key return…
jimying Nov 21, 2024
be88a99
only keep the PJ_IOQUEUE_HAS_SAFE_UNREG=1 logic
jimying Dec 13, 2024
ab10f5e
remove closing_list, use ref_count=0 to release key
jimying Dec 13, 2024
e53fadd
remove useless free_time
jimying Dec 13, 2024
c52406b
Merge branch 'master' into pr/4136
nanangizz Jan 15, 2025
b7a8338
Use pending-op pool
nanangizz Jan 15, 2025
9ea705a
Integrate group lock
nanangizz Jan 20, 2025
8edf128
Merge branch 'master' into pr/4136
nanangizz Jan 22, 2025
4c287c9
Update ci-win.yml
nanangizz Jan 22, 2025
f39b7ae
Update ci-win.yml
nanangizz Jan 22, 2025
e517f94
Update ci-win.yml
nanangizz Jan 22, 2025
fea5fef
Update ci-win.yml
nanangizz Jan 22, 2025
974dc46
Update ci-win.yml
nanangizz Jan 22, 2025
62c1763
Update ci-win.yml
nanangizz Jan 22, 2025
cca809c
Merge branch 'master' into pr/4136
nanangizz Jan 24, 2025
c633102
add the reproducing test, also fix minor bugs
nanangizz Jan 24, 2025
d3fddb3
Update Makefile
nanangizz Jan 24, 2025
6c9599c
Merge branch 'master' into pr/4136
nanangizz Jan 24, 2025
3823a04
Update ci-win.yml
nanangizz Jan 24, 2025
9e0d2cb
Changes based on comments
nanangizz Jan 27, 2025
c26067d
update copyright line order
nanangizz Jan 27, 2025
c07ee83
fixes based on comments
nanangizz Jan 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/ci-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -590,3 +590,33 @@ jobs:
set LIB=%LIB%;%FFMPEG_DIR%\lib;%SDL_DIR%\lib\x86
msbuild pjproject-vs14.sln /p:PlatformToolset=v143 /p:Configuration=Release /p:Platform=win32 /p:UseEnv=true
shell: cmd

iocp:
runs-on: windows-latest
name: IOCP / pjlib
steps:
- uses: actions/checkout@master
- name: config site
run:
cd pjlib/include/pj; cp config_site_test.h config_site.h; Add-Content config_site.h "#define PJ_IOQUEUE_IMP PJ_IOQUEUE_IMP_IOCP"
shell: powershell
- name: check VsDevCmd.bat
run: dir "%PROGRAMFILES%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"
shell: cmd
- name: MSBuild
working-directory: .
run: |
call "%PROGRAMFILES%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"
msbuild pjproject-vs14.sln /p:PlatformToolset=v143 /p:Configuration=Release /p:Platform=win32 /p:UseEnv=true
shell: cmd
- name: verify ioqueue type is iocp
run: |
cd pjlib/bin
pjlib-test-i386-Win32-vc14-Release.exe -c -L | findstr /C:"ioqueue type" | findstr iocp
shell: cmd
- name: pjlib-test
run: |
cd pjlib/bin
$args = $env:CI_WIN_ARGS -split ' '
./pjlib-test-i386-Win32-vc14-Release.exe $args $env:CI_MODE
shell: powershell
2 changes: 1 addition & 1 deletion pjlib/build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export PJLIB_LDFLAGS += $(_LDFLAGS)
export TEST_SRCDIR = ../src/pjlib-test
export TEST_OBJS += activesock.o atomic.o echo_clt.o errno.o exception.o \
fifobuf.o file.o hash_test.o ioq_perf.o ioq_udp.o \
ioq_stress_test.o ioq_unreg.o ioq_tcp.o \
ioq_stress_test.o ioq_unreg.o ioq_tcp.o ioq_iocp_unreg_test.o \
list.o mutex.o os.o pool.o pool_perf.o rand.o rbtree.o \
select.o sleep.o sock.o sock_perf.o ssl_sock.o \
string.o test.o thread.o timer.o timestamp.o \
Expand Down
1 change: 1 addition & 0 deletions pjlib/build/pjlib_test.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@
<ClCompile Include="..\src\pjlib-test\fifobuf.c" />
<ClCompile Include="..\src\pjlib-test\file.c" />
<ClCompile Include="..\src\pjlib-test\hash_test.c" />
<ClCompile Include="..\src\pjlib-test\ioq_iocp_unreg_test.c" />
<ClCompile Include="..\src\pjlib-test\ioq_perf.c" />
<ClCompile Include="..\src\pjlib-test\ioq_stress_test.c" />
<ClCompile Include="..\src\pjlib-test\ioq_tcp.c" />
Expand Down
3 changes: 3 additions & 0 deletions pjlib/build/pjlib_test.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@
<ClCompile Include="..\src\pjlib-test\ioq_stress_test.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\pjlib-test\ioq_iocp_unreg_test.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\pjlib-test\test.h">
Expand Down
Loading
Loading