From patchwork Fri Feb 8 15:23:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 219206 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 049C82C0089 for ; Sat, 9 Feb 2013 02:23:36 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1360941817; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:In-Reply-To:References:Date:Message-ID: Subject:From:To:Cc:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=Icpp61sniAq1Mh0IyGAJja41rsk=; b=KGkjblTCOBIK3Gv tWTWlBwP2akfYqb1ebKxL/NHwWZNR94S1Z93644owsgw7OgGRaoIVu727cFWORAr /D7AGq2vSD3ifYBSfJpk2SOnq6DLghKV9bdNmI1F3VeBjxKLjGVjAcgVL/joCYHA bLl02Urc7mM4GBYQIxs2GIfkCd8s= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:X-Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=nwDIeXzDEV1FfZYjs6sKWD6uYOL9AejWPZ9R3BknUYWsU5NVSpGcaHj9EL+SgZ fAUU/hBc24RTuyTOpTmDGJQfCugFSo2uY7XMbSkL9p47hlTQriOL1lUJ+CHKuZjU NWsrNk46ZsGzC0MwV4c1Cb3FBocaFM/6eigOmtAnx9n/c=; Received: (qmail 28180 invoked by alias); 8 Feb 2013 15:23:27 -0000 Received: (qmail 28153 invoked by uid 22791); 8 Feb 2013 15:23:26 -0000 X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-oa0-f46.google.com (HELO mail-oa0-f46.google.com) (209.85.219.46) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 Feb 2013 15:23:17 +0000 Received: by mail-oa0-f46.google.com with SMTP id k1so4162680oag.33 for ; Fri, 08 Feb 2013 07:23:17 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.182.95.133 with SMTP id dk5mr4468541obb.14.1360336997039; Fri, 08 Feb 2013 07:23:17 -0800 (PST) Received: by 10.182.49.68 with HTTP; Fri, 8 Feb 2013 07:23:16 -0800 (PST) In-Reply-To: References: Date: Fri, 8 Feb 2013 16:23:16 +0100 Message-ID: Subject: Re: libgo patch committed: Update to current version of Go library From: Uros Bizjak To: Ian Lance Taylor Cc: gcc-patches@gcc.gnu.org Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Fri, Feb 8, 2013 at 4:02 PM, Ian Lance Taylor wrote: >>>> I did hit one new error that seems related: >>>> >>>> --- FAIL: TestChtimes (0.00 seconds) >>>> os_test.go:681: AccessTime didn't go backwards; >>>> was={63495872497 0 47130825733376}, after={63495872497 0 >>>> 47130825733376} >>>> os_test.go:685: ModTime didn't go backwards; was={63495872497 >>>> 0 47130825733376}, after={63495872497 0 47130825733376} >>>> FAIL >>>> FAIL: os >>> >>> Something has gone wrong in the file >>> libgo/go/syscall/libcall_linux_utimesnano.go. The function in that >>> file will try utimensat. On your system that should return ENOSYS. >>> In that case the function should convert the times and call utimes. >>> The code looks OK to me but there may be something wrong with it. It >>> looks like the file times didn't change at all. >> >> From the strace -f, it looks that utimes is not called at all in >> between two relevant stats: > > Strange. What I would expect to happen is that the function in > libcall_linux_utimesnano.go will call utimensat. Since your system > does not have that function, that will call the stub routine in > libgo/runtime/go-nosys.c, which will return -1 with errno set to > ENOSYS. The code in libcall_linux_utimensnano.go will see the ENOSYS > error and continue on to call utime. Clearly something is going wrong > in that sequence, but I don't know what. Somwhow expected, following "patch" makes test to pass: --cut here-- added to Linux // in 2.6.22, Released, 8 July 2007) then fall back to utimes var tv [2]Timeval --cut here-- 11491 stat("/tmp/_Go_TestChtimes581938713", {st_mode=S_IFREG|0600, st_size=13, ...}) = 0 11491 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 11491 utimes("/tmp/_Go_TestChtimes581938713", {{1360336212, 0}, {1360336212, 0}}) = 0 11491 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 11491 stat("/tmp/_Go_TestChtimes581938713", {st_mode=S_IFREG|0600, st_size=13, ...}) = 0 It looks to me that gcc miscompiles this part for some reason...? Uros. Index: go/syscall/libcall_linux_utimesnano.go =================================================================== --- go/syscall/libcall_linux_utimesnano.go (revision 195879) +++ go/syscall/libcall_linux_utimesnano.go (working copy) @@ -14,10 +14,10 @@ if len(ts) != 2 { return EINVAL } - err = utimensat(_AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) - if err != ENOSYS { - return err - } +// err = utimensat(_AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) +// if err != ENOSYS { +// return err +// } // If the utimensat syscall isn't available (utimensat was