Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"routes" have a 4095 bytes limit under Linux #25

Open
corsch opened this issue Oct 8, 2021 · 2 comments
Open

"routes" have a 4095 bytes limit under Linux #25

corsch opened this issue Oct 8, 2021 · 2 comments

Comments

@corsch
Copy link

corsch commented Oct 8, 2021

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.

@xsoft
Copy link

xsoft commented Mar 13, 2023

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.

@anrieff
Copy link

anrieff commented Apr 11, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants