You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered a very subtle issue. It is about Poco::Exception in PocoFoundation64.dll. In Visual Studio 2019/2022 release_shared x64.
It is very hard to reproduce. Due to the large amount of code, I can't paste it all here, so I’ve only extracted a small portion.
// This is a small portion I extracted from a large amount of code.intmain() {
std::uint64_t val = 0x1122334455667788;
try {
throwPoco::Exception("error");
// If I do not use Poco::XXXXXXException, everything works fine.// throw std::exception("error"); // It's OK !!!
} catch (const Poco::Exception& e) {
}
std::cout << val; // Now the val is 0x1122334400000000 !!!// It's Very Strange !!! It lost low 32 bit.return0;
}
It took me two days to find the real reason.
auto m = sizeof(Poco::Exception);
auto n = sizeof(std::exception);
// m=72, n=24: In PocoFoundation64.dll// m=64, n=16: In my EXE
It was all caused by _HAS_EXCEPTIONS=0 in my EXE compile options. This macro will change the class size and implementation of std::exception.
Hi @obiltschnig
I encountered a very subtle issue. It is about
Poco::Exception
inPocoFoundation64.dll
. In Visual Studio 2019/2022 release_shared x64.It is very hard to reproduce. Due to the large amount of code, I can't paste it all here, so I’ve only extracted a small portion.
It took me two days to find the real reason.
It was all caused by
_HAS_EXCEPTIONS=0
in my EXE compile options. This macro will change the class size and implementation of std::exception.I think it's necessary to add some tips in POCO documentation to avoid users wasting unnecessary time on this issue.
See alse: nodejs/node-addon-api#85
The text was updated successfully, but these errors were encountered: