Closed Wicpar closed 6 months ago
Same here. tilemaker just terminates after logging configured layers.
I have just installed Windows on my Mac laptop and will see what I can work out. It won’t be quick as I’ll have to get VS Code, MSVC++ etc. up and running even before the debugging. But it’s on the radar.
same problem on v3.0.0
@systemd: Thanks for your quick response! Meanwhile I manged to fix the issue.
source file: src/pbf_processor.cpp method: PbfHasOptionalFeature bool PbfHasOptionalFeature(const std::string& inputFile, const std::string& feature) { std::ifstream infile(inputFile, std::ifstream::in); auto header = reader.readHeaderFromFile(infile); infile.close(); return header.optionalFeatures.find(feature) != header.optionalFeatures.end(); }
change: replace std::ifstream infile(inputFile, std::ifstream::in); with fstream infile(inputFile, ios::in | ios::binary);
Excellent, thanks. I'll have a play around adding that and put a patch together in the next few days.
Were there any problems with:
The application crashes because accesses an index outside the array limit.
https://github.com/systemed/tilemaker/blob/6e335efdd13d876f4ddacd0368ee04811337c8ac/src/sorted_node_store.cpp#L380 https://github.com/systemed/tilemaker/blob/6e335efdd13d876f4ddacd0368ee04811337c8ac/src/sorted_node_store.cpp#L426
Were there any problems with:
The application crashes because accesses an index outside the array limit.
I haven't seen this - what are you encountering it with? (OS, command line, source data etc.)
Windows (MSVC)
On any given data, it accesses elements equal to the size of the array. Another thing is that in the release build, if there is an error, the thread is silently terminated. The error becomes clear if you do a debug build.
I agree that's undefined behaviour due to an out of bounds read. The loop is dangerous; it uses <= on purpose for other reasons, but it's a footgun, as seen here.
I think the correct fix is to skip the last 3 lines in the loop when i == nodes.size(), as no one actually consumes them. I'm running some experiments now to confirm and will send a PR if it looks good.
it just stops after one secons. 2.4.0 seems to work