On Sun, Oct 9, 2022 at 12:03 PM Vitor Ramos ramos.v89@gmail.com wrote:
Hello,
I am not sure if this is the appropriate channel but here we go.
The right channel for bugs is to report them at https://bugs.winehq.org/ ...
I am trying to port a windows c++ application using winelib and I found an issue while using some c++ STL containers.
Here is a minimal example:
# winelib.dll.so
#include <windows.h> #include <unordered_map> #include <string> extern "C" int f1(long z) { std::unordered_map<int, std::string> y; return 10; } spec file ```c++ 2 stdcall f1(long)
# Building winelib.dll.so winemaker --console --dll . winebuild --implib -E winedll.spec -o libwinedll.a winebuild --fake-module --dll -E winedll.spec -o winedll.dll make
cp libwinedll.a winedll.dll.so /usr/local/lib/wine/x86_64-unix cp winedll.dll /home/$USER/.wine/drive_c/windows/system32
win64 app
#include <iostream> extern "C"{ int f1(long z); } int main(){ int ret = f1(2); std::cout << ret << std::endl; }
# Building win64 app winemaker . -iwinedll make
# Running wine64 win64app.exe.so
# Output 0110:err:virtual:virtual_setup_exception stack overflow 2128 bytes in thread 0110 addr 0x17008c804 stack 0x207b0 (0x20000-0x21000-0x120000)
I see this error every once in a while and most of the time it doesn't seem to affect the working of the program. Does it affect the working of your program in this particular case?
If I remove the "std::unordered_map<int, std::string> y" from the custom lib it runs normally.
I suspect that wine uses too much of the stack to construct the object, but it's just a wild guess.
Does anybody know what the issue could be? Is it possible to increase the stack size?
Thanks.