-
Notifications
You must be signed in to change notification settings - Fork 18k
syscall, x/sys/unix: Time(), Utime(), Getrlimit() use invalid syscall number on linux/arm #14524
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
Comments
Please show a complete program which misbehaves, and the |
Actually, I found this by just reading source code. I have no accessible |
Input:
Output:
As I expected, linux return ENOSYS. is it enough info? |
For the record, root of the problem is code-generation scripts couldn't recognize |
@hirochachacha the syscall package is a mismash of incompatible implementations. The go runtime does not use syscall.Time, it uses an implementation of nanotime(2), although that depends on the platform you are calling it on. If there is a fix that needs to be made, it will be in the x/sys/unix package, the syscall package is closed for modifications. |
I see. And also runtime's
Fair enough. By the way, do you want to accept such a trivial bug report? Thank you for responses, anyway. |
Trivial or not, if it's a bug, we need to fix it.
If you think it's trivial, perhaps the best way
is to just send a CL to fix it :)
I think we need to fix x/sys/unix, and fix the syscall
package if the fix is simple. (IIUC, the syscall
package is frozen for non-bugfixes and additions
except adding of new ports, but if the implementation
of some existing functions is wrong, then we'd better
fix it.)
Reopen this issue.
|
Thanks! I'll send a CL.
Yes it's simple. For example, we can implement But corresponding syscall numbers are already declaraed by api/go*.txt. How can I treat these? |
@hirochachacha in general the |
@davecheney I'm confusing. which should I follow? |
@hirochachacha we cannot change any of the public values declared in the syscall package. You may have to declare some private constants instead. Also, please try to make as small as possible a fix. If the issue is not apparent to callers of this code, ie the rest of the standard library, the recommendation is to fix the issue in the |
Those SYS_* constants are still correct, it's just they Just fix the implementation to use the correct syscalls. For the functions in syscall package, I think if the fix |
Can you please talk to each other? I want to follow the decision. |
I am sorry for the confusion. I will let you and @minux decide what to do. On Sat, Feb 27, 2016 at 8:10 PM, hirochachacha notifications@github.com
|
No worries. Thanks! I will follow @minux 's decision here. |
To make my suggestions more concrete:
|
I investigated it. according to this, EABI is supported since 2.6.16. Here is related source code: include/asm-arm/unistd.h
kernel/time.c
arch/arm/kernel/calls.S
syscall table is defined by calls.S . So syscall numbers are defined, but functions are not.
I see.
I guess you mean Thank you. |
I'm really sorry. I didn't understand it. what "agrees with" exactly mean? |
CL https://golang.org/cl/19945 mentions this issue. |
On Sat, Feb 27, 2016 at 6:24 AM, hirochachacha notifications@github.com
|
Is this preferable to |
I was talking about the 1-second granularity Time() syscall.
|
Some system calls are obsolete and no longer available for EABI. This CL replace such system call usages. Updates golang/go#14524 Change-Id: Ib99b239455ca677e46d7097911904c45119051bd Reviewed-on: https://go-review.googlesource.com/19945 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
I sent a CL for syscall package. Thank you. |
CL https://golang.org/cl/20004 mentions this issue. |
The CL wasn't approved. But I suppose no one wants to continue this. |
Please answer these questions before submitting your issue. Thanks!
go version
)?any
go env
)?linux/arm
(Use play.golang.org to provide a runnable example, if possible.)
nothing
invalid syscall numbers are not used
invalid syscall numbers are used
As far as is known, linux/arm sycalls are slightly limited.
Here is the list taken from kernel header:
I confirmed
time
,utime
andgetrlimit
are used, others are not used in both syscall package and x/sys/unix package.I also suggest such syscall numbers should be removed from these packages on linux/arm.
(except syscall package? because of compatibility promise)
Thank you.
The text was updated successfully, but these errors were encountered: