Ludovic Courtès <[email protected]> writes:

> Hi!
>
> Tomas Volf <[email protected]> skribis:
>
>> However, if we contrast it with the wrapped version, we can see that the
>> symbolic link was converted into a binary, which is probably not
>> correct.
>>
>> --8<---------------cut here---------------start------------->8---
>> # for x in mas0k6vcpn0zj5qpxn5d19nqmgblvyd7-gcc-toolchain-16.1.0 
>> a0njfslzh2l7jn334fh0shaspiq7prin-gcc-toolchain-16.1.0R; do ls -al 
>> /gnu/store/$x/libexec; done
>> total 8
>> dr-xr-xr-x    1 root     root            20 Aug  9 20:21 .
>> dr-xr-xr-x    1 root     root           118 Aug  9 20:21 ..
>> lrwxrwxrwx    1 root     root            66 Aug  9 20:21 gcc -> 
>> /gnu/store/3lj8xxr8p8lgsyrd7fd7x42a836wfbap-gcc-16.1.0/libexec/gcc
>> lrwxrwxrwx    1 root     root            70 Aug  9 20:21 getconf -> 
>> /gnu/store/m31vlvwm79m89fk3xk0z4h7snk61y510-glibc-2.41/libexec/getconf
>> total 1408
>> dr-xr-xr-x    1 root     root            20 Aug  9 20:21 .
>> dr-xr-xr-x    1 root     root           118 Aug  9 20:21 ..
>> -r-xr-xr-x    1 root     root        717184 Jan  1  1970 gcc
>> -r-xr-xr-x    1 root     root        717184 Jan  1  1970 getconf
>> --8<---------------cut here---------------end--------------->8---
>>
>> (The second one is the wrapped version.)
>
> And what does this ‘gcc’ wrap?  What does it try to execve(2)?

--8<---------------cut here---------------start------------->8---
$ guix shell strace -- strace 
/gnu/store/a0njfslzh2l7jn334fh0shaspiq7prin-gcc-toolchain-16.1.0R/libexec/gcc
execve("/gnu/store/a0njfslzh2l7jn334fh0shaspiq7prin-gcc-toolchain-16.1.0R/libexec/gcc",
 ["/gnu/store/a0njfslzh2l7jn334fh0s"...], 0x7ffda8b94a10 /* 86 vars */) = 0
brk(NULL)                               = 0x3013a000
brk(0x3013ad40)                         = 0x3013ad40
arch_prctl(ARCH_SET_FS, 0x3013a3c0)     = 0
set_tid_address(0x3013a690)             = 28841
set_robust_list(0x3013a6a0, 24)         = 0
rseq({cpu_id_start=0, cpu_id=RSEQ_CPU_ID_UNINITIALIZED, rseq_cs=NULL, flags=0, 
node_id=0, mm_cid=0, slice_ctrl={request=0, granted=0, __reserved=0}, 
__reserved=0}, 32, 0, 0x53053053) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, 
rlim_max=RLIM64_INFINITY}) = 0
readlinkat(AT_FDCWD, "/proc/self/exe", "/gnu/store/a0njfslzh2l7jn334fh0s"..., 
4096) = 77
getrandom("\xf3\xa2\xe6\xe5\xac\x55\xcc\x03", 8, GRND_NONBLOCK) = 8
brk(NULL)                               = 0x3013ad40
brk(0x3015bd40)                         = 0x3015bd40
brk(0x3015c000)                         = 0x3015c000
mprotect(0x4a9000, 20480, PROT_READ)    = 0
readlink("/proc/self/exe", "/gnu/store/a0njfslzh2l7jn334fh0s"..., 4095) = 77
execve("/gnu/store/mas0k6vcpn0zj5qpxn5d19nqmgblvyd7-gcc-toolchain-16.1.0/libexec//gcc",
 ["/gnu/store/a0njfslzh2l7jn334fh0s"...], 0x7ffd018c32e8 /* 86 vars */) = -1 
EACCES (Permission denied)
write(2, "gcc: run.c:729: main: Unexpected"..., 59gcc: run.c:729: main: 
Unexpected error: Permission denied.
) = 59
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f72ead27000
gettid()                                = 28841
getpid()                                = 28841
tgkill(28841, 28841, SIGABRT)           = 0
--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=28841, si_uid=1000} ---
+++ killed by SIGABRT +++
--8<---------------cut here---------------end--------------->8---

It tries to execute a symbolic link to a directory, which does not seem
to work.

> Looks like you found a bug!

Agree :)

Tomas
-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

Attachment: signature.asc
Description: PGP signature

Reply via email to