Patchwork libgo patch committed: Update to current version of Go library

login
register
mail settings
Submitter Uros Bizjak
Date Feb. 8, 2013, 5:42 p.m.
Message ID <CAFULd4YFKx1Y8EX175ykWi19s_x+Ltp=26kRaB4tjJVxo4rYnA@mail.gmail.com>
Download mbox | patch
Permalink /patch/219237/
State New
Headers show

Comments

Uros Bizjak - Feb. 8, 2013, 5:42 p.m.
On Fri, Feb 8, 2013 at 6:10 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Fri, Feb 8, 2013 at 5:53 PM, Ian Lance Taylor <iant@google.com> wrote:
>> On Fri, Feb 8, 2013 at 8:48 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>>>
>>> utimensat returns zero on CentOS. Following is gdb session:
>>
>> Thanks--can you do the same session but with "step" instead of "next"?
>
> I think I got the problem.

Yep.

Following patch fixes the failure:

--cut here--
                return EINVAL
--cut here--

Please note, that looking at generated libcalls.go, there are many
other possible signed/unsigned issues of the same type. Since this all
happens on x86_64 (where go int is apparently 64bit), it looks that it
is very important to distinguish int from _C_int in glue source.

Uros.
Ian Taylor - Feb. 8, 2013, 7:24 p.m.
On Fri, Feb 8, 2013 at 9:42 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>
> Please note, that looking at generated libcalls.go, there are many
> other possible signed/unsigned issues of the same type. Since this all
> happens on x86_64 (where go int is apparently 64bit), it looks that it
> is very important to distinguish int from _C_int in glue source.

Wow, thanks for tracking this down.  I see that I did a pretty bad job
of using _C_int correctly.  I committed this patch to fix the problem.
 Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.

Ian

Patch

Index: go/syscall/libcall_linux_utimesnano.go
===================================================================
--- go/syscall/libcall_linux_utimesnano.go      (revision 195879)
+++ go/syscall/libcall_linux_utimesnano.go      (working copy)
@@ -9,7 +9,7 @@ 
 import "unsafe"

 //sys  utimensat(dirfd int, path string, times *[2]Timespec, flags
int) (err error)
-//utimensat(dirfd int, path *byte, times *[2]Timespec, flags int) int
+//utimensat(dirfd _C_int, path *byte, times *[2]Timespec, flags int) _C_int
 func UtimesNano(path string, ts []Timespec) (err error) {
        if len(ts) != 2 {