drogon icon indicating copy to clipboard operation
drogon copied to clipboard

Serving swagger on windows causes exception and crash

Open ProVival opened this issue 3 months ago • 1 comments

Describe the bug When i am trying to serve my swagger file using static file serving at localhost:8000/swagger with the following files in the swagger folder on root:

index.html
swagger-ui-bundle.js
swagger-ui-standalone-preset.js
swagger-ui.css
swagger.yaml

I have tried the same thing on macOs but there was no issue. In windows when i run it in debugging i am getting the following stack trace

ntdll.dll!ntdll!RtlGetFullPathName_UstrEx (Unknown Source:0)
ntdll.dll!ntdll!RtlGetFullPathName_UstrEx (Unknown Source:0)
ntdll.dll!ntdll!RtlAllocateHeap (Unknown Source:0)
ntdll.dll!ntdll!RtlAllocateHeap (Unknown Source:0)
ntdll.dll!ntdll!RtlRegisterSecureMemoryCacheCallback (Unknown Source:0)
ntdll.dll!ntdll!RtlAllocateHeap (Unknown Source:0)
ntdll.dll!ntdll!RtlAllocateHeap (Unknown Source:0)
msvcrt.dll!msvcrt!malloc (Unknown Source:0)
libstdc++-6.dll![Unknown/Just-In-Time compiled code] (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)
libtrantor.dll!trantor::TcpConnectionImpl::sendFile(char const*, long long, long long) (Unknown Source:0)

Anyone having this issue?

Edit: If i set: drogon::app().enableSendfile(false); It works but i don't know if this is the correct approach to fix it. In documentation it says use_sendfile option is for linux but somehow it worked here and i don't know if this would cause a problem in the long run. Any help is appreciated :D

ProVival avatar Oct 16 '25 08:10 ProVival

@ProVival Thanks for your feedback, I think this may be some side effects of the sendFile option on Windows, I'll figure it out.

an-tao avatar Oct 17 '25 05:10 an-tao