From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#28212: Grafting crashes when replacement lies near the end of buffer Date: Thu, 24 Aug 2017 08:56:07 +0200 Message-ID: <87bmn5ihdk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkm4g-0006IB-Dn for bug-guix@gnu.org; Thu, 24 Aug 2017 02:57:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkm4c-0004K9-9J for bug-guix@gnu.org; Thu, 24 Aug 2017 02:57:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:43346) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dkm4c-0004K5-5o for bug-guix@gnu.org; Thu, 24 Aug 2017 02:57:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dkm4b-00041S-Ua for bug-guix@gnu.org; Thu, 24 Aug 2017 02:57:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkm3q-0005vF-8F for bug-guix@gnu.org; Thu, 24 Aug 2017 02:56:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkm3o-0003pK-TV for bug-guix@gnu.org; Thu, 24 Aug 2017 02:56:14 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkm3o-0003pG-Of for bug-guix@gnu.org; Thu, 24 Aug 2017 02:56:12 -0400 Received: from [2a01:e0a:1d:7270:6a6c:dc17:fc02:cfda] (port=57488 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dkm3o-0006ra-7l for bug-guix@gnu.org; Thu, 24 Aug 2017 02:56:12 -0400 List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 28212@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable As reported by Leo and then analyzed by Mark, grafting crashes when the replacement string lies near the end of buffer: https://lists.gnu.org/archive/html/guix-devel/2017-07/msg00445.html With the attached patch on top of commit 7d14082d56462f7bef4254d65a21fd265fbce471, I get this backtrace: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix build go@1.9 [...] @ build-started /gnu/store/n420a0qs7vwnbaj4j3knhfy9j7zqwvs4-go-1.9rc1.drv -= x86_64-linux /var/log/guix/drvs/n4//20a0qs7vwnbaj4j3knhfy9j7zqwvs4-go-1.9r= c1.drv.bz2 grafting '/gnu/store/8zbi5rr5q2pxksfgpxq37m60nsa21d3v-go-1.9rc1-doc' -> '/g= nu/store/djdi6b1bvbrp5fgkkrvk80jndg6gifrh-go-1.9rc1-doc'... grafting '/gnu/store/73fvsx0qizcrbajgjwn8mkzkpxa6abx4-go-1.9rc1' -> '/gnu/s= tore/8bjpc7wxdxsxbf45qvwsd6jbn7zgi871-go-1.9rc1'... Backtrace: In ice-9/boot-9.scm: 160: 17 [catch #t # ...] In unknown file: ?: 16 [apply-smob/1 #] In ice-9/boot-9.scm: 66: 15 [call-with-prompt prompt0 ...] In ice-9/eval.scm: 432: 14 [eval # #] In ice-9/boot-9.scm: 2412: 13 [save-module-excursion #] 4089: 12 [#] 1734: 11 [%start-stack load-stack #] 1739: 10 [#] In unknown file: ?: 9 [primitive-load "/gnu/store/zslsp0k0m06ab7a2vzf2wp3cv6s5zwxn-go-1.9= rc1-guile-builder"] In ice-9/eval.scm: 387: 8 [eval # ()] In ice-9/boot-9.scm: 806: 7 [for-each # # #] In /gnu/store/hnwfmnrb1r7dzajn744dafx19ps290d8-module-import/guix/build/gra= ft.scm: 313: 6 [rewrite-directory "/gnu/store/73fvsx0qizcrbajgjwn8mkzkpxa6abx4-go-= 1.9rc1" ...] In srfi/srfi-1.scm: 616: 5 [for-each # #] In ice-9/boot-9.scm: 877: 4 [call-with-input-file "/gnu/store/73fvsx0qizcrbajgjwn8mkzkpxa6abx4-= go-1.9rc1/pkg/tool/linux_amd64/link" ...] 895: 3 [call-with-output-file "/gnu/store/8bjpc7wxdxsxbf45qvwsd6jbn7zgi871= -go-1.9rc1/pkg/tool/linux_amd64/link" ...] In /gnu/store/hnwfmnrb1r7dzajn744dafx19ps290d8-module-import/guix/build/gra= ft.scm: 302: 2 [# #] 173: 1 [replace-store-references # ...] In unknown file: ?: 0 [put-bytevector # ...] ERROR: In procedure put-bytevector: ERROR: In procedure put-bytevector: Value out of range: 0 builder for `/gnu/store/n420a0qs7vwnbaj4j3knhfy9j7zqwvs4-go-1.9rc1.drv' fai= led with exit code 1 @ build-failed /gnu/store/n420a0qs7vwnbaj4j3knhfy9j7zqwvs4-go-1.9rc1.drv - = 1 builder for `/gnu/store/n420a0qs7vwnbaj4j3knhfy9j7zqwvs4-go-1.9rc1.drv' f= ailed with exit code 1 --8<---------------cut here---------------end--------------->8--- Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index 70cae6d87..7ed9cc750 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -199,11 +199,11 @@ garbage collection, various safety features and in the style of communicating sequential processes (CSP) concurrent programming features added.") (license license:bsd-3))) -(define-public go-1.8 +(define-public go-1.9 (package (inherit go-1.4) (name "go") - (version "1.8.3") + (version "1.9rc1") (source (origin (method url-fetch) @@ -211,7 +211,7 @@ sequential processes (CSP) concurrent programming features added.") name version ".src.tar.gz")) (sha256 (base32 - "19lzv4lqixj3v2gjaff0fdbbmgsq5r8lrfd61z2zvp778wjflpaz")))) + "0bj5dcvhz48bf6704qhqnybf220kgqgi93x4mx1n3k30xac7awc7")))) (arguments (substitute-keyword-arguments (package-arguments go-1.4) ((#:phases phases) @@ -242,7 +242,7 @@ sequential processes (CSP) concurrent programming features added.") ;; Add libgcc to runpath (substitute* "cmd/link/internal/ld/lib.go" (("!rpath.set") "true")) - (substitute* "cmd/go/build.go" + (substitute* "cmd/go/internal/work/build.go" (("cgoldflags := \\[\\]string\\{\\}") (string-append "cgoldflags := []string{" "\"-rpath=" gcclib "\"" @@ -265,7 +265,9 @@ sequential processes (CSP) concurrent programming features added.") (substitute* file ((regex all before test_name) (string-append before "Disabled" test_name))))) - '(("net/net_test.go" "(.+)(TestShutdownUnix.+)") + '(;; See https://github.com/golang/go/commit/81ed9ca1d411f0bd8738ea60b3a8045446ad85fc + ("cmd/go/go_test.go" "(.+)(TestExecutableGOROOT.+)") + ("net/net_test.go" "(.+)(TestShutdownUnix.+)") ("net/dial_test.go" "(.+)(TestDialTimeout.+)") ("os/os_test.go" "(.+)(TestHostname.+)") ("time/format_test.go" "(.+)(TestParseInSydney.+)") @@ -366,4 +368,4 @@ sequential processes (CSP) concurrent programming features added.") `(("go" ,go-1.4) ,@(package-native-inputs go-1.4))))) -(define-public go go-1.8) +(define-public go go-1.9) diff --git a/guix/build/graft.scm b/guix/build/graft.scm index 16df169ec..83d797130 100644 --- a/guix/build/graft.scm +++ b/guix/build/graft.scm @@ -310,8 +310,7 @@ file name pairs." ;; Use 'exit-on-exception' to force an exit upon I/O errors, given that ;; 'n-par-for-each' silently swallows exceptions. ;; See . - (n-par-for-each (parallel-job-count) - (exit-on-exception rewrite-leaf) + (for-each rewrite-leaf (find-files directory (const #t) #:directories? #t)) (rename-matching-files output mapping)) --=-=-=--