Closed reder2000 closed 1 year ago
I have not heard of this symptom before.
One possibility to track this down is to try a pure C++ program on the same system and see if it hangs. Here is a possible test:
#include "date/tz.h"
#include <iostream>
int
main()
{
std::cout << date::get_tzdb().version << '\n';
}
Built with this command line on macOS:
clang++ test.cpp -std=c++17 -I../date/include ../date/src/tz.cpp -lcurl
which for me just output:
2022g
Thanks for the advice, I have a full-featured library using date (thanks, so useful and much faster than msvc's version) and executable working perfectly (on windows msvc, mingw, and linux) with autoload. I've just started building a python interface for it as well and ran into problems (not a surprise given pybind11 has 421 issues and 119 PRs, but it looked lighter and more modern than boost.python that I used long time ago).
If I were to take a wild guess, it would be that one object file that involves a date source or header (tz.cpp, tz.h, date.h) is built with different configuration flags than another. With Make files that is all too easy to do.
Doubt it, it's a big cmakefile and I bring date by source. I'll try to find out something once I have time to test.
I have the same lockup in linux.
#0 0x00007ffff7d667ed in __GI___select (nfds=7, readfds=0x7fffffffb460, writefds=0x7fffffffb4e0, exceptfds=0x7fffffffb560, timeout=0x7fffffffb3d0)
at ../sysdeps/unix/sysv/linux/select.c:69
[...]
#8 0x00007ffff6ac6d56 in date::download_to_string (url="https://www.iana.org/time-zones", str="")
at /home/reder/vcpkg/buildtrees/date/src/v3.0.1-1676a5f906.clean/src/tz.cpp:2907
Closing as this is definitely pybind11 specific.
Note: I resolved this "issue" as managing to get static initialization at another place.
Using date in a python c++ module (pybind11), date hangs in init_tzdb while it is checking version against remote. curl hangs (more precisely: it is stuck in winnt waitforsingleobject) I tried to add a timeout but curl resume after timeout and hangs again.
Any idea / former experience ? (I use USE_SYSTEM_TZ_DB to resolve this, but it is not ideal). I tried digging around with no result. Not tried linux yet.