-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fall back to slower stat filesize if optimized filesize fails #55641
fall back to slower stat filesize if optimized filesize fails #55641
Conversation
@ronisbr would you be able to test this? |
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
I have the RPI behind me.
What is the best way to update my iostream.jl file to test it?
Jake
|
Go to the build page, select the build aarch64-Linux-gnu job, open the Artifacts tab, and download the tarball. Open it and you'll have the Julia build on your disk. Maybe there's a way to access the build with juliaup, but I'm not up to date with that. |
Or copy paste the new function in a |
I used giordano's method. The command that has been causing problems in BaremetalPi is gpio_init(), in which the following commands are executed and then stored in a structure.
With Julia 1.10.0 it all works. On the development version that I just downloaded
Awaiting instructions. |
This is a bit cryptic for me. |
Seems like you need to set |
Still not working
|
I don't think filesize() is the source of the BaremetalPi problem. I compared the working and not working versions of the function filesize and they don't correspond to when the problem occurs. See the comments below for what is working and what is not working. I also took at look Mmap.map and it has changed from 1.10.0 to 1.10.1 and is different again for 1.12.0. I will report back to the BaremetalPi issue tracker.
|
The problem is the |
Filesize(io) returns 0 with this patch so it is working. I see what you mean about Mmap,mmap having been changed from 1.10.0 to 1.10.1. This may have introduced another problem? |
I think we just need a check for
|
(in addition to this PR or after this PR) |
It is failing on line 91 of grow! in the Mmap.jl file where the systemcall on line 90 returns failure = -1. Complete error message shown above. |
@vtjnash I gave that a go here. Could be separated into another PR, but for testing purposes here for now. I couldn't see a tidy way to reuse the |
…the ftruncate syscall Co-Authored-By: Jameson Nash <vtjnash+github@gmail.com>
0c0f9bf
to
bc0c3d9
Compare
if I change your line to
I no longer get an error. I am in process of testing this with BaremetalPi. It seems that @ronisbr prevented Mmap from using grow! by setting the option grow=false when mmap was called. With the current proposed fix I need to set grow=true, but then grow! returns before performing any function, which seems counterintuitive. I am wondering if the following logic in mmap (lines 220 to 231) should be reviewed and the case of !isfile(io) with grow=false included in the logic there?
|
Yes, I agree. However, I can change BaremetalPi.jl to use |
With the fix shown two posts up and a dev version of BaremetalPi with grow set to true, my application that uses BaremetalPi is working. |
by "needs a test", Ian means it needs a test in CI, but it's somewhat unclear how we can do that. IMO since this is a bugfix we should merge without a test if we don't have one. |
I was imagining that we could either use some address on a linux system to mimic the gpio output, or mock it. |
From https://github.com/ronisbr/BaremetalPi.jl/blob/master/src/gpio.jl the commands that errored are:
If we change grow = true the proposed changes work. If we leave grow = false then we need the additional change on line 222 that I proposed above. This code segment should work as a test. |
The problem is that this scenario only works in a Raspberry Pi, which cannot be emulated by CI here in GitHub. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given there are ongoing questions here about what is needed to fix Mmap, I will reduce this to just the issue in the title so it can be merged, then another PR opened to fix the remaining issues.
Also, seems we don't have a good idea for a test here, so I'll remove that needs label. |
Is it really necessary? I thought everything was fine with that suggestion. The current state does not fix #54203. Since this is an important regression (nobody is able to use Julia in the current state to access Raspberry Pi's GPIO), can't we try to implement the solution to #54203 in this PR to fix the problem faster? |
By the way, the problem is that this PR: https://github.com/JuliaLang/julia/pull/44354/files now perform checks that were not performed before (like throwing an error in some conditions). |
The Mmap fixes have been opened here #55849 @JakeZw opening PRs isn't as complicated as the guide at #55641 (comment) makes out. @ronisbr there's just been a lot of noise in this PR and the title fix should get in. See #55849 for the remainder. Please review & approve that if it is correct. |
Perfect @IanButterworth ! You were very fast :) I just tested both modifications and, from my side, everything is working perfectly (Raspberry Pi Zero 2). However, I think it will be important if @JakeZw test it too. |
(cherry picked from commit fc9f147)
Fixes #54203 Requires #55641 Based on #55641 (comment) cc. @JakeZw @ronisbr --------- Co-authored-by: Jameson Nash <vtjnash@gmail.com>
Backported PRs: - [x] #55773 <!-- Add compat entry for `Base.donotdelete` --> - [x] #41244 <!-- Fix shell `cd` error when working dir has been deleted --> - [x] #55795 <!-- fix #52986, regression in `@doc` of macro without REPL loaded --> - [x] #55829 <!-- [Dates] Make test more robust against non-UTC timezones --> - [x] #55641 <!-- fall back to slower stat filesize if optimized filesize fails --> - [x] #55744 <!-- fix #45494, error in ssa conversion with complex type decl --> - [x] #55783 <!-- use `inferencebarrier` instead of `invokelatest` for 1-arg `@assert` --> - [x] #55739 <!-- Add `invokelatest` barrier to `string(...)` in `@assert` --> Need manual backport: - [ ] #55798 <!-- Broadcast binary ops involving strided triangular --> Contains multiple commits, manual intervention needed: - [ ] #55509 <!-- Fix cong implementation to be properly random and not just cycling. --> - [ ] #55569 <!-- Add a docs section about loading/precomp/ttfx time tuning --> - [ ] #55824 <!-- Replace regex package module checks with actual code checks --> Non-merged PRs with backport label: - [ ] #55845 <!-- privatize annotated string API, take two --> - [ ] #55828 <!-- Fix some corner cases of `isapprox` with unsigned integers --> - [ ] #55813 <!-- Check for conflicting `@ccallable` name before JIT registration --> - [ ] #55743 <!-- doc: heap snapshot viewing --> - [ ] #55741 <!-- Change annotations to use a NamedTuple --> - [ ] #55534 <!-- Set stdlib sources as read-only during installation --> - [ ] #55499 <!-- propagate the terminal's `displaysize` to the `IOContext` used by the REPL --> - [ ] #55458 <!-- Allow for generically extracting unannotated string --> - [ ] #55457 <!-- Make AnnotateChar equality consider annotations --> - [ ] #55453 <!-- Privatise the annotations API, for StyledStrings --> - [ ] #55355 <!-- relocation: account for trailing path separator in depot paths --> - [ ] #55220 <!-- `isfile_casesensitive` fixes on Windows --> - [ ] #55169 <!-- `propertynames` for SVD respects private argument --> - [ ] #54457 <!-- Make `String(::Memory)` copy --> - [ ] #53957 <!-- tweak how filtering is done for what packages should be precompiled --> - [ ] #51479 <!-- prevent code loading from lookin in the versioned environment when building Julia --> - [ ] #50813 <!-- More doctests for Sockets and capitalization fix --> - [ ] #50157 <!-- improve docs for `@inbounds` and `Base.@propagate_inbounds` -->
Based on the triage suggestion #54203 (comment)