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

test 345 fails on AppVeyor #13458

Closed
bagder opened this issue Apr 24, 2024 · 2 comments
Closed

test 345 fails on AppVeyor #13458

bagder opened this issue Apr 24, 2024 · 2 comments
Labels
tests Windows Windows-specific

Comments

@bagder
Copy link
Member

bagder commented Apr 24, 2024

After 00bef95 (came via #13432) it seems test 345 permafails on some (?) appveyor builds.

example log

curl/libcurl version

git master

operating system

Windows

@bagder bagder added tests Windows Windows-specific labels Apr 24, 2024
@bagder
Copy link
Member Author

bagder commented Apr 24, 2024

Possibly related to the ftruncate replacement function we use for Windows?

curl/src/tool_cb_see.c

Lines 108 to 119 in f33ee2e

int tool_ftruncate64(int fd, curl_off_t where)
{
intptr_t handle = _get_osfhandle(fd);
if(_lseeki64(fd, where, SEEK_SET) < 0)
return -1;
if(!SetEndOfFile((HANDLE)handle))
return -1;
return 0;
}

It seems Windows has a _chsize_s function we could perhaps rather use there?

bagder added a commit that referenced this issue Apr 24, 2024
... and the prototype to tool_setup.h, to make them both available more
widely and accurately.

Fixes #13458 ?
@vszakats
Copy link
Member

vszakats commented Apr 24, 2024

I wonder if the manual override of HAVE_FTRUNCATE in src/tool_cb_see.h plays a role in this:

curl/src/tool_cb_see.h

Lines 28 to 38 in f33ee2e

#if defined(_WIN32) && !defined(HAVE_FTRUNCATE)
int tool_ftruncate64(int fd, curl_off_t where);
#undef ftruncate
#define ftruncate(fd,where) tool_ftruncate64(fd,where)
#define HAVE_FTRUNCATE 1
#define USE_TOOL_FTRUNCATE 1
#endif /* _WIN32 && ! HAVE_FTRUNCATE */

In any case such override should be done in curl_setup.h to apply for all code in unity mode.

Haven't confirmed, but the problem could be that the replacement function isn't used in src/tool_operate.c.

bagder added a commit that referenced this issue Apr 24, 2024
... and the prototype to tool_setup.h, to make them both available more
widely and accurately.

Fixes #13458 ?
@bagder bagder closed this as completed in 9fc4b2c Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Windows Windows-specific
Development

Successfully merging a pull request may close this issue.

2 participants