-
Notifications
You must be signed in to change notification settings - Fork 260
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
Some CRTs don't support 200 open files, resulting at least in failing tests. #288
Comments
Embarcadero C++Builder doesn't support more than 50 files open at the same time for legacy 32 Bit apps, which makes a test fail trying to open more than that many files. This changes the number of open files for that test to far less to make the test succeed. Alternatively one could reduce the hard coded number of 200 in QPDF itself, which I didn't do currently because it needs adoption of manuals etc. and is something which needs to be discussed with the author of QPDF. I guess chances are better to get the test changed upstream. This fixes qpdf#288: qpdf#288
Just for reference the code I'm currently using to decide how many open files to support in my own app:
|
Embarcadero C++Builder doesn't support more than 50 files open at the same time for legacy 32 Bit apps, which makes a test fail trying to open more than that many files. This changes the number of open files for that test to far less to make the test succeed. Alternatively one could reduce the hard coded number of 200 in QPDF itself, which I didn't do currently because it needs adoption of manuals etc. and is something which needs to be discussed with the author of QPDF. I guess chances are better to get the test changed upstream. This fixes qpdf#288: qpdf#288
I can definitely add a flag to set the threshold. I probably should have done that to begin with. Somehow I managed to not know about FOPEN_MAX. Thanks for pointing that out. I'll take care of this for my next update to qpdf. It should be a small change. I will change the default to be based on FOPEN_MAX with a cap and will add a command-line flag to change the threshold. I'll look at the test suite and see if I can make it work on systems with smaller maxes than 200 without breaking the intended functionality of the test. A PR is welcome but not required. I doubt it would take me more than a few minutes to address this, though I won't be able to get to it for a bit since I don't have time to work on qpdf most of the time and just take reserved blocks of time for it every few months. |
Just don't hurry using |
Embarcadero C++Builder doesn't support more than 50 files open at the same time for legacy 32 Bit apps, which makes a test fail trying to open more than that many files. This changes the number of open files for that test to far less to make the test succeed. Alternatively one could reduce the hard coded number of 200 in QPDF itself, which I didn't do currently because it needs adoption of manuals etc. and is something which needs to be discussed with the author of QPDF. I guess chances are better to get the test changed upstream. This fixes #288: #288
I see no real downside to your test change, but I think a better fix is required, such as adding a numeric option to --keep-files-open as you suggested and possibly seeing if |
By the way @ams-tschoening thanks for all your pull requests! |
Thanks for merging! I'm the one still sitting on the broken compiler. :-) |
My solution is to add a |
Note for myself: I had expected tests to fail with 50 open files at the same time, because from my understanding the C-lib only supported 47 file handles, because of STDIN, *OUT and *ERR being already open. Doesn't seem so for this case currently, but if things fail in future, simply suggest reducing the number to 45 or such again.
|
I'm updating QPDF from 6.0 to 8.4 and one of the new features is that it automatically decides if to keep files open or not. The currently hard coded limit is 200, but my Embarcadero C++Builder only supports 50 files open at the same time for legacy 32 Bit apps. I came across that issue in my own app merging PDFs already and simply fixed it by only opening 35 files at a time at most, so don't run into actual problems with using QPDF itself.
But you have added tests based on the knowledge of the 200 open files and the following fails in my case:
The reason simply is that the used file name expands to more than 50 files and after file 47 they can't be opened anymore. This can easily be seen in the logs:
It's 50 files minus STD* and stuff, so breaking on file
147-kfo.pdf
makes sense to me. If I simply change the files to11*kfo.pdf
instead, reducing the number to 10, and after adopting the expected output as well, the test passes. I'll additionally provide a PR implementing this later as well.I would be very thankful if you could address this issue somehow. I currently preferred changing the test simply because in your two other tests you are only using a subset of those 200 possible files as well and I need to get things going.
But because your chosen limit of 200 is some arbitrary value anyway, how about reducing it to a safer value like 25 or 35 like I use? That would need adoption of manuals etc. as well.
Checking things for the current runtime wouldn't help me solve this problem necessarily as well, because like can be read in my link to SO, my compiler lacks lots of functions suggested for this purpose. And I'm not sure what of the things my compiler provides is usable for others.
So I guess it's either changing the tests only or simply reducing the hard coded value. Thanks!
The text was updated successfully, but these errors were encountered: