Skip to content

lib2302: fix crash due to stack overflow on MSVC and clang Windows - #16630

Closed
vszakats wants to merge 5 commits into
curl:masterfrom
vszakats:lib2302-crash-fix
Closed

vszakats wants to merge 5 commits into
curl:masterfrom
vszakats:lib2302-crash-fix

Conversation

@vszakats

@vszakats vszakats commented Mar 9, 2025 •

Copy link
Copy Markdown
Member

It fixes test 2302, 2303, 2307 with MSVC and clang on Windows.
GCC Windows builds were not affected.

Failure was caused by stack overflow due to a 1MB+ sized test struct on
stack. Replace it with dynamic allocation.

Also unignore affected tests in GHA/windows.

As seen under WINE with llvm-mingw:

$ wine64 libtests.exe lib2302 ws://127.0.0.1:59964/2302 > stdout2302 2> stderr2302
Test: lib2302
URL: ws://127.0.0.1:59964/2302
wine: Unhandled stack overflow at address 000000014007486A (thread 0024), starting debugger...
Unhandled exception: stack overflow in 64-bit code (0x000000014007486a).

Ref: #16629 (discovery)
Ref: 1bd5ac9 #16570


@vszakats vszakats added tests Windows Windows-specific CI Continuous Integration WebSocket labels Mar 9, 2025
@vszakats vszakats changed the title lib2302: fix crash due to large stack buffer on MSVC and clang Windows lib2302: fix crash due to stack overflow on MSVC and clang Windows Mar 9, 2025
@testclutch

This comment was marked as resolved.

@vszakats
vszakats force-pushed the lib2302-crash-fix branch from 218c4e9 to 2e57cd8 Compare March 9, 2025 02:32
@vszakats vszakats closed this in 7e282e1 Mar 9, 2025
@vszakats
vszakats deleted the lib2302-crash-fix branch March 9, 2025 10:58
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
It fixes test 2302, 2303, 2307 with MSVC and clang on Windows.
GCC Windows builds were not affected.

Failure was caused by stack overflow due to a 1MB+ sized test struct on
stack. Replace it with dynamic allocation.

Also unignore affected tests in GHA/windows.

As seen under WINE with llvm-mingw:
```
$ wine64 libtests.exe lib2302 ws://127.0.0.1:59964/2302 > stdout2302 2> stderr2302
Test: lib2302
URL: ws://127.0.0.1:59964/2302
wine: Unhandled stack overflow at address 000000014007486A (thread 0024), starting debugger...
Unhandled exception: stack overflow in 64-bit code (0x000000014007486a).
```

Ref: curl#16629 (discovery)
Ref: 1bd5ac9 curl#16570

Closes curl#16630
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous Integration tests WebSocket Windows Windows-specific

Development

Successfully merging this pull request may close these issues.

2 participants