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
Fix issue 19797 - Ungraceful termination in File.seek() on Windows #6948
Conversation
Thanks for your pull request and interest in making D better, @veelo! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + phobos#6948" |
I think this is a sensible approach to the problem, but I don't know how it stacks up to the cost of the added code, considering that std.stdio is unashamed about being a D-ish wrapper around
I understand |
Thanks for chiming in.
I don't really like it either. An alternative is to basically keep the code as is, but add I've tried to do the check at CT, since they are CT constants, but I couldn't make that work. |
We can always do that.
Not sure what this would achieve, does the C runtime you used not return an error if a bad value was specified? If std.stdio does not check the return value of some C function, then that is an obvious bug fixing which would solve this. |
The process just terminated without any message whatsoever.
I'll take a closer look, thanks. |
That should never happen. Something must have went terribly wrong. If you don't want to dig into that but can create a reproducible example, please post it on Bugzilla. |
Could there be a difference in behaviour between https://issues.dlang.org/show_bug.cgi?id=19797 import std.experimental.all;
void main()
{
auto deleteme = "deleteme";
auto f = File(deleteme, "wb+");
scope(exit) { f.close(); std.file.remove(deleteme); }
f.seek(0, 3); // Should throw.
writeln("Ending gracefully."); // Never seen.
} I'll have to let this rest for a moment. |
I'm done. The one failure seems to be a random hickup?
The previous build went through, and this last one is just a documentation fix. Can someone just restart the auto-tester or something? Thanks. |
Marked the build as deprecated. It will take a bit for it to rerun, but once it has the auto-merge tag the Auto-Tester will actually constantly rerun its tests until it can merge. |
@veelo could you please clean up the commit history, as soon as you do this can be merged. |
0998563
to
a2aa3d3
Compare
@thewilsonator I had to learn how to do that first, I think I've got it. :-) |
This caused some problems for porting to Musl. Value |
Context: https://forum.dlang.org/post/mqzblhbrweydjlcjdppj@forum.dlang.org
CRuntime_Microsoft
to prevent ungraceful process termination. Fixes issue 19797. This is a workaround for what looks like a bug in Microsoft's_fseeki64
.