Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New version is broken! #3

Closed
alkino opened this issue Jun 25, 2012 · 10 comments
Closed

New version is broken! #3

alkino opened this issue Jun 25, 2012 · 10 comments
Assignees

Comments

@alkino
Copy link
Contributor

alkino commented Jun 25, 2012

Hi!
When I want to start proot on my usual arm-rootfs it crashed:

proot -q qemu-arm ./rootfs/
Registering `cpu' which already exists
And it doesn't proot in the directory.

But it can be funnier:

proot -Q qemu-arm ./something-wrong
Segmentation fault

GDB

60 status = snprintf(result, PATH_MAX, "/proc/%d", tracee->pid);
(gdb) bt
#0 readlink_proc (tracee=tracee@entry=0x0, result=result@entry=0x7fffffff6310 "/proc/self",

base=base@entry=0x6180d8 "/proc", component=<optimized out>, component@entry=0x7fffffff6210 "self", 
comparison=PATHS_ARE_EQUAL) at ./path/proc.c:60

#1 0x00000000004061b1 in canonicalize (tracee=tracee@entry=0x0,

fake_path=fake_path@entry=0x7fffffff84f0 "/proc/self/mounts", deref_final=deref_final@entry=true, 
result=result@entry=0x6180d8 "/proc", nb_readlink=nb_readlink@entry=1) at ./path/canon.c:166

#2 0x000000000040623d in canonicalize (tracee=tracee@entry=0x0,

fake_path=fake_path@entry=0x7fffffffa6d0 "/etc/mtab", deref_final=deref_final@entry=true, 
result=result@entry=0x6180d8 "/proc", nb_readlink=1, nb_readlink@entry=0) at ./path/canon.c:195

#3 0x0000000000405c0a in init_bindings () at ./path/binding.c:571
#4 0x000000000040681a in init_module_path () at ./path/path.c:202
#5 0x0000000000401958 in main (argc=4, argv=0x7fffffffe8d8) at ./cli.c:449

(gdb) p tracee
0x0

@ghost ghost assigned cedric-vincent Jun 25, 2012
@cedric-vincent
Copy link
Contributor

Hi Alkino,

Thanks for this bug report, however I'm not able to reproduce this problem. Please, could you specify:

  • the version of PRoot (I suppose this is v2.0)
  • the version of QEMU
  • the host distro
  • the guest distro in rootfs
  • the type of "./something-wrong" (file, directory, pipe, ...)

Thanks in advance,
Cédric.

@cedric-vincent
Copy link
Contributor

OK, I'm able to reproduce the problem:

ln -s  /proc/self/mounts mtab
./proot -b mtab
Segmentation fault

Thanks.

@cedric-vincent
Copy link
Contributor

Please, could you check the patch I pushed in the "next" branch fixes this problem?

Thanks in advance.
Cédric.

@cedric-vincent
Copy link
Contributor

The following error is due to another problem in PRoot v2.0 when using QEMU v1.1:

Registering `cpu' which already exists

I'm investigating.

@cedric-vincent
Copy link
Contributor

Actually, the problem is reproducible without PRoot:

/lib64/ld-linux-x86-64.so.2 arm-linux-user/qemu-arm
Registering `arm-cpu' which already exists
Aborted

We just have to ask PRoot to not use the dynamic linker as a loader:

env PROOT_IGNORE_ELF_INTERPRETER=1 proot -q qemu-arm ./rootfs/

I will submit a patch for PRoot today.

@cedric-vincent
Copy link
Contributor

Hi Alkino,

Please, could you confirm PRoot v2.0.1 solves these problems?

@alkino
Copy link
Contributor Author

alkino commented Jun 26, 2012

proot -Q qemu-arm ./media/rootfs/
proot warning: can't create the guest path (binding) "/proc/self/mounts": you can still access it directly, without seeing it though

I got this. Is it normal?

@cedric-vincent
Copy link
Contributor

Well, this is not unexpected. I could confirm that only if you specify what the guest and host distros are.

@alkino
Copy link
Contributor Author

alkino commented Jun 26, 2012

Both are archlinux.

@cedric-vincent
Copy link
Contributor

In your guest rootfs, "/etc/mtab" points to "/proc/self/mounts" but PRoot fails at creating "/proc/self". However this shouldn't create any trouble.

For information, these kind of warnings will disappear in the next release of PRoot (thanks to a new feature).

AkihiroSuda pushed a commit to rootless-containers/runrootless that referenced this issue Jan 8, 2018
The problem was due to the new module that emulates symlinks in
"/proc": it is used to initialize bindings that point to "/proc/self",
when no tracee can be associated to "self".  In this case "self" must
be PRoot.

Reported-by: Alkino (proot-me/proot#3)
AkihiroSuda pushed a commit to rootless-containers/runrootless that referenced this issue Jan 8, 2018
Moreover this makes QEMU v1.1 bug:

    /lib64/ld-linux-x86-64.so.2 arm-linux-user/qemu-arm
    Registering `arm-cpu' which already exists
    Aborted

Change-Id: I5e30d97560d6f196c55a2bee02e1e40e30069f5c
Reported-by: Alkino (proot-me/proot#3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants