NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/58809: stat(2) fails for freshly created directory



>Number:         58809
>Category:       kern
>Synopsis:       stat(2) fails for freshly created directory
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 03 17:50:01 +0000 2024
>Originator:     Martin Husemann
>Release:        NetBSD 10.99.12
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD martins.aprisoft.de 10.99.12 NetBSD 10.99.12 (GENERIC) #250: Sat Nov 2 11:23:49 CET 2024 martin%martins.aprisoft.de@localhost:/home/martin/current/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:

I am trying to run a script that populates a directory with pkg stuff.
I get strange failures from pkg-add -P ...

pkg_add: var_set: can't open temp file for 'root//usr/pkg/pkgdb/libcbor-0.11.0/+INSTALLED_INFO' for writing: No such file or directory

This fails in lib/var.c::var_set in mkstemp() because the stat testing
for the existance of the target directory fails. This is strange, because
pkg_add created it a few seconds before and it is still there after
the failure (and no unlink calls for it in ktrace output).

  8742   8742 pkg_add  CALL  mkdir(0x782bc5837f80,0x1ff)
  8742   8742 pkg_add  NAMI  "root//usr/pkg/pkgdb/libcbor-0.11.0"
  8742   8742 pkg_add  RET   mkdir 0
[..]
  8742   8742 pkg_add  CALL  __stat50(0x782bc5834500,0x7f7fff7510f0)
  8742   8742 pkg_add  NAMI  "root//usr/pkg/pkgdb/libcbor-0.11.0"
  8742   8742 pkg_add  RET   __stat50 -1 errno 2 No such file or directory

 > ls -l root//usr/pkg/pkgdb/libcbor-0.11.0
total 28
-r--r--r--  1 root  users  2732 Nov  3 18:29 +BUILD_INFO
-r--r--r--  1 root  users   444 Nov  3 18:29 +BUILD_VERSION
-r--r--r--  1 root  users    52 Nov  3 18:29 +COMMENT
-rw-r--r--  1 root  users  2355 Nov  3 18:29 +CONTENTS
-r--r--r--  1 root  users   440 Nov  3 18:29 +DESC
-r--r--r--  1 root  users     7 Nov  3 18:29 +SIZE_ALL
-r--r--r--  1 root  users     7 Nov  3 18:29 +SIZE_PKG


This is on ffs  (FFSv2):
	/dev/dk6 on / type ffs (local)

I am pretty sure I used a very simmilar invocation of pkg_add -P a few
days ago against an empty pkgdb and it worked. Only thing (AFAICT) I changed
is updated kernel + userland today.

>How-To-Repeat:

cd /tmp && mkdir root && pkg_add -P root ${pkgs}/fidocrypt-0.0nb20241023.tgz

(not sure what exactly are the relevant things to reproduce)

>Fix:
n/a



Home | Main Index | Thread Index | Old Index