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:
1bd5ac998bbc943dbf812b2824ad0f532201734c #16570
Closes #16630
if [ '${{ matrix.sys }}' != 'msys' ]; then
TFLAGS+=' ~612' # SFTP
fi
- if [ '${{ matrix.sys }}' = 'clang64' ]; then
- TFLAGS+=' ~2302 ~2303 ~2307' # permafail with clang (and also MSVC) (but works with mingw64 and ucrt64)
- fi
if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
fi
timeout-minutes: 10
run: |
export CURL_DIRSUFFIX='${{ matrix.type }}'
- export TFLAGS='-j8 ${{ matrix.tflags }} ~2302 ~2303 ~2307'
+ export TFLAGS='-j8 ${{ matrix.tflags }}'
TFLAGS+=' ~2310' # flaky
PATH="$PWD/bld/lib/${{ matrix.type }}:$PATH:/c/Program Files (x86)/stunnel/bin:/c/Program Files/OpenSSH-Win64"
PATH="/c/msys64/usr/bin:$PATH"
struct ws_data {
CURL *easy;
- char buf[1024*1024];
+ char *buf;
size_t blen;
size_t nwrites;
int has_meta;
int meta_flags;
};
+#define LIB2302_BUFSIZE (1024 * 1024)
+
static void flush_data(struct ws_data *wd)
{
size_t i;
wd->meta_flags = meta ? meta->flags : 0;
}
- if(wd->blen + blen > sizeof(wd->buf)) {
+ if(wd->blen + blen > LIB2302_BUFSIZE) {
return 0;
}
memcpy(wd->buf + wd->blen, buf, blen);
CURL *curl;
CURLcode res = CURLE_OK;
struct ws_data ws_data;
+ memset(&ws_data, 0, sizeof(ws_data));
+ ws_data.buf = (char *)calloc(LIB2302_BUFSIZE, 1);
+ if(!ws_data.buf)
+ return res;
global_init(CURL_GLOBAL_ALL);
curl = curl_easy_init();
if(curl) {
- memset(&ws_data, 0, sizeof(ws_data));
ws_data.easy = curl;
curl_easy_setopt(curl, CURLOPT_URL, URL);
flush_data(&ws_data);
}
curl_global_cleanup();
+ free(ws_data.buf);
return res;
}