Bug 46647 - Aborted
Summary: Aborted
Status: NEW
Alias: None
Product: Sisyphus
Classification: Development
Component: fakechroot (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: Vitaly Chikunov
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-26 09:17 MSK by Anton Zhukharev
Modified: 2023-11-03 00:13 MSK (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Zhukharev 2023-06-26 09:17:59 MSK
Packages:
=========

* fakechroot-2.20.1-alt3.x86_64



Steps to reproduce:
===================

# apt-get install fakechroot gcc
# adduser user && su - user

$ for pkg_filename in $(rpm -ql bash); do
      install -D "$pkg_filename" "chrootdir/$pkg_filename"
  done

$ cat << EOF > sample.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main(int argc, char **argv) {
  ssize_t len, blen = 256;
  char *s = malloc(blen);

  while (1) {
    printf("get\n");
    len = readlink("/proc/self/exe", s, blen-1);
    printf("got\n");
    if (len == (blen-1)) {
      free(s);
      blen *= 2;
      s = malloc(blen);
    } else
      abort();
  }
  s[len] = 0;

  free(s);

  return 0;
}
EOF

$ gcc sample.c -o sample
$ cp sample chrootdir/usr/bin/
$ fakechroot chroot chrootdir /bin/bash
$ sample



Actual result:
==============

$ sample
get
got
Aborted



Expected result:
================

abort() isn't called



Extra info:
===========

* The bug is actual for p10 (fakechroot-2.20.1-alt2.x86_64).
* The bug reproduces in openSUSE Tumbleweed too (at least in a docker container).



See also:
=========
https://github.com/racket/racket/issues/4673#issue-1762310224