kwprocessor icon indicating copy to clipboard operation
kwprocessor copied to clipboard

"routes" have a 4095 bytes limit under Linux

Open corsch opened this issue 4 years ago • 2 comments

The builtin routes "2-to-16-max-4-direction-changes.route" and "2-to-32-max-5-direction-changes.route" are to big, and cause a freeze under Linux.

A workaround is to split the routes into smaller pieces. (< 4096 bytes)

split routes/2-to-16-max-4-direction-changes.route -l 810 This creates four files of 3223, 4050, 4050 and 395 bytes.

I've also tested a file with 4095 bytes, which will work. As soon as a file reaches 4096 bytes, kwp will get stuck.

corsch avatar Oct 08 '21 11:10 corsch

Ive just want to report same issue ls -al 2-to-16-max-4-direction-changes-part1.route -rw-r--r-- 1 root root 4095 Mar 13 16:37 2-to-16-max-4-direction-changes-part1.route

That 4k files (4096 b) would fail, 4095b is fine.

xsoft avatar Mar 13 '23 15:03 xsoft

A simple fix for this issue is to close the file after count_lines of the routes file, and then reopen it. I.e., replace the rewind (fp); on line 906 with fclose(fp); fp = fopen (routes_file, "r");

I believe the issue is caused by mixing fgets() and fgetws() on a single file instance, since count_lines uses the former, and fgetl uses the latter.

anrieff avatar Apr 11 '23 21:04 anrieff