Comments (2)
Think I found the issue.
From the kernel, in open.c line 1255:
/* Now handle the creative implementation of O_TMPFILE. */
if (flags & __O_TMPFILE) {
/*
* In order to ensure programs get explicit errors when trying
* to use O_TMPFILE on old kernels we enforce that O_DIRECTORY
* is raised alongside __O_TMPFILE.
*/
if (!(flags & O_DIRECTORY))
return -EINVAL;
if (!(acc_mode & MAY_WRITE))
return -EINVAL;
}
Adding .DIRECTORY = true to the flags indeed "solves" the problem, as that makes the call succeed.
I'm not sure what the "correct" behavior of zig should be in this case. The documentation of open(3) does not say that O_DIRECTORY should be supplied when O_TMPFILE is supplied and the c++ version apparently silently adds the flag, as it works without it. The options I guess would be to either also silently add that flag if the TMPFILE flag is set or to return an error if it is set, but missing the DIRECTORY flag.
from zig.
Btw. I think that there might be two more cases that also would result in .INVAL being returned and thus crash.
- .TMPFILE=true and .ACCMODE= .RDONLY
- .DIRECT and missing fs support
from zig.
Related Issues (20)
- fuzz testing: support macOS
- fuzz testing: support Windows
- fuzzing: support more than one executable at once
- debug info audit - many virtual memory addresses have strange source locations
- `-OReleaseSafe` breaks fuzzing entry points feature; incorrect already-sorted assumption
- unreachable code paths need to be excluded from having coverage instrumentation
- more optimized and correct management of 8-bit PC counters
- fuzzer web interface: play a little jingle when it finds a bug!
- fuzzer web interface: ability to scroll to source locations that newly gain coverage HOT 1
- Ability to determine the file a module is in without complete knowledge of the compilations module dependency graph HOT 5
- --verbose-llvm-bc= compile option does not work when providing a file name
- ICE involving empty slice of anonymous struct type
- --unresolved-symbols seems not work for zig cc
- [Feature Request/Bug] Make MultiArrayList behave like normal ArrayList HOT 5
- compiler: remove unused struct fields HOT 7
- std.json: parsing: possibility for missing optional fields to not trigger an error HOT 2
- @alignOf() returns incorrect alignment for structs containing multiple SIMD vectors HOT 2
- Crash (likely undefined behavior) of `std.process.Child.run` in `ReleaseFast` mode only
- ICE: self-hosted generating an atom for an extern declaration
- translate-c misses an alignment cast in translated C code HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zig.