summary refs log tree commit diff stats
path: root/results/classifier/zero-shot-user-mode/output/instruction/1813307
blob: 0c84edfc45c9c0334921d5862d2195cad74ad07f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
instruction: 0.498
syscall: 0.294
runtime: 0.208



util/path.c/follow_path() does not handle "/" well

Hello,

I noticed that qemu does not handle "/" very well in follow_path().

Specifically, I was trying to run gdbserver under qemu, and it failed inside its implementation of __getcwd.

Indeed it does something like
  if (__lstat ("/", &st) < 0)
.....
and then loops from current dir toward the top using lstat("..")

On qemu side, lstat forwards the request to follow_path() in util/path.c, and when passed "/", it returns the path in QEMU_LD_PREFIX (which was the top of my sysroot).
OTHT, the series of lstat("..") finally reaches the real device root because it's not recognized as "/" in follow_path(), so this is inconsistent and __getcwd fails.

I suppose there's a good reason for returning QEMU_LD_PREFIX when asking for "/", but why is it so?

If there's no good reason, maybe the behaviour could be changed to map "/" to "/" ?

Thanks