Thanks for your patience, I appreciate the effort trying to solve this.

Here is the gdb log:
1561  return XSTRING (string)->u.s.data;
(gdb) n
5321    if (file_access_p (fndata, F_OK))
(gdb) step
file_access_p (
    file=file@entry=0x555555cf8838 "/usr/local/libexec/emacs/28.0.50/x86_64-pc-linux-gnu/../../../../bin/../lib/emacs/28.0.50/native-lisp/28.0.50-864bf4e5/preloaded/window-0d1b8b93-dcb2375f.eln", amode=amode@entry=0) at fileio.c:162
162  if (faccessat (AT_FDCWD, file, amode, AT_EACCESS) == 0)
(gdb) next
dump_do_dump_relocation (dump_base=<optimized out>, reloc=...) at pdumper.c:5325
5325 eln_fname = make_uninit_string (execdir_len + fn2_len);
(gdb) p (int)errno
$1 = 13

I can indeed access /usr/local/libexec/emacs/28.0.50/x86_64-pc-linux-gnu/../../../../bin/../lib/emacs/28.0.50/native-lisp/28.0.50-864bf4e5/preloaded/window-0d1b8b93-dcb2375f.eln but only as root. Which seems wrong. I can start emacs as sudo ( have not even checked this before )

Which is then probably a umask issue as this folder's permission seems wrong:
 /usr/local/lib $ sudo ls -lah emacs
total 12K
drwx------ 3 root root 4.0K Aug  3 23:00 .
drwxr-xr-x 4 root root 4.0K Aug  3 23:00 ..
drwx------ 3 root root 4.0K Aug  3 23:00 28.0.50

sudo ls -lah emacs/28.0.50
total 12K
drwx------ 3 root root 4.0K Aug  3 23:00 .
drwx------ 3 root root 4.0K Aug  3 23:00 ..
drwx------ 3 root root 4.0K Aug  3 23:00 native-lisp

Yes the file exists, but I cannot access it as a non-root ( should have checked before ). I can remove the folder and re-install and the permission is the same as above.


On Thu, Aug 5, 2021 at 4:04 PM Eli Zaretskii <eliz@gnu.org> wrote:
> Date: Thu, 05 Aug 2021 16:33:53 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 49864@debbugs.gnu.org
>
>   162       if (faccessat (AT_FDCWD, file, amode, AT_EACCESS) == 0)
>
> That shows the file name it is trying to access in the list of
> arguments of the function.  As far as I understand from the other
> information you posted, that file does exist on your system, is that
> right?  Because you said the file below does exist:
>
>   /usr/local/lib/emacs/28.0.50/native-lisp/28.0.50-864bf4e5/preloaded/window-0d1b8b93-dcb2375f.eln
>
> But for some reason, the faccessat call fails.  We need to understand
> why.
>
> > (gdb) p errno
> > 'errno' has unknown type; cast it to its declared type
>
> To work around the problem with errno's type, try this:
>
>   (gdb) p (int)errno

To clarify: please print the value of errno as above _after_ stepping
over the call to faccessat, i.e. when GDB shows this:

  162       if (faccessat (AT_FDCWD, file, amode, AT_EACCESS) == 0)
  (gdb) next
  175       return false;