Skip to content

Commit

Permalink
iocp: fix crash, GetQueuedCompletionStatus() write freed WSAOVERLAPPE…
Browse files Browse the repository at this point in the history
…D memory (#4136)
  • Loading branch information
jimying authored Feb 5, 2025
1 parent 205baf0 commit cbfbbc4
Show file tree
Hide file tree
Showing 10 changed files with 674 additions and 246 deletions.
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

0 comments on commit cbfbbc4

Please sign in to comment.