Subject: bug#21958: 'guix environment --container' fails upon exiting

From: [email-masked] (Ludovic Courtès)
Date: Thu, 19 Nov 2015 10:22:46 +0100

Here’s the transcript:

--8<---------------cut here---------------start------------->8---
$ guix environment --container --ad-hoc r gdb -- R

[...]

> M <- 50                                     
> N <- 500                                    
> eigen(crossprod(matrix(rnorm(M * N), M, N)))

 *** caught segfault ***
address 0xfb0, cause 'memory not mapped'

Traceback:
 1: eigen(crossprod(matrix(rnorm(M * N), M, N)))

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection: 1
aborting ...
sh: rm: command not found
Backtrace:
In ice-9/boot-9.scm:
 155: 18 [catch #t #<catch-closure ab89a0> ...]
In unknown file:
   ?: 17 [apply-smob/1 #<catch-closure ab89a0>]
In ice-9/boot-9.scm:
  61: 16 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 15 [eval # #]
In ice-9/boot-9.scm:
2401: 14 [save-module-excursion #<procedure ad6980 at ice-9/boot-9.scm:4045:3 ()>]
4050: 13 [#<procedure ad6980 at ice-9/boot-9.scm:4045:3 ()>]
1724: 12 [%start-stack load-stack #<procedure ae9cc0 at ice-9/boot-9.scm:4041:10 ()>]
1729: 11 [#<procedure aece70 ()>]
In unknown file:
   ?: 10 [primitive-load "/home/ludo/soft/bin/guix"]
In guix/ui.scm:
1173: 9 [run-guix-command environment "--container" "--ad-hoc" "r" "gdb" "--" "R"]
In ice-9/boot-9.scm:
 155: 8 [catch srfi-34 #<procedure 1c05400 at guix/ui.scm:411:2 ()> ...]
 155: 7 [catch system-error ...]
In guix/scripts/environment.scm:
 495: 6 [#<procedure 1c05440 at guix/scripts/environment.scm:457:2 ()>]
In guix/store.scm:
1029: 5 [run-with-store # ...]
In guix/scripts/environment.scm:
 374: 4 [#<procedure 40b7910 at guix/scripts/environment.scm:339:2 (state)> #]
In guix/utils.scm:
 624: 3 [call-with-temporary-directory #<procedure 4818340 at gnu/build/linux-container.scm:251:3 (root)>]
In gnu/build/linux-container.scm:
 252: 2 [#<procedure 4818340 at gnu/build/linux-container.scm:251:3 (root)> "/tmp/guix-directory.ftGLfF"]
  60: 1 [call-with-clean-exit #<procedure 40b78c0 at gnu/build/linux-container.scm:214:11 ()>]
In unknown file:
   ?: 0 [primitive-exit #f]

ERROR: In procedure primitive-exit:
ERROR: Wrong type (expecting exact integer): #f
--8<---------------cut here---------------end--------------->8---

Ludo’.