junest icon indicating copy to clipboard operation
junest copied to clipboard

segfault with latest glibc

Open KingDuckZ opened this issue 5 years ago • 11 comments

I have just updated with pacman -Syu and I'm getting lots of random crashes. The first one is in install-info, which runs as part of the pacman command. I also have a crash in my own c++ program which wasn't happening before. It seems to be memory related, in my code I'm just appending strings in a loop and sometimes it works, sometimes it crashes. If I reserve enough memory for the destination string so that it never needs to reallocate to accomodate for the appended substrings then the crashe disappears completely.

If I downgraded to glibc-2.28-5 all goes back to normal, but I obviously end up with non-working packages, eg vim won't start anymore as it doesn't find the right version of glibc, plus some other system packages. As soon as I re-install glibc-2.29-1 the crashes are back. Is there a solution for this?

KingDuckZ avatar May 06 '19 17:05 KingDuckZ

I have the same issue. Chromium, Firefox and Thunderbird continue to work, but Pidgin and pacman itself keep crashing. Indeed more packages have to be downgraded to allow them to work again.

I'm using a RHEL6 system with kernel version 2.6.32-642.11.1.el6 on AMD64.

jschwartzenberg avatar May 14 '19 09:05 jschwartzenberg

I tried building the junest image myself with junest -i -n, and using this image to build junest on the other system. pacman -Syyu and vim installation works. This problem is when using the pre-built junest image when you do junest -f that it uses the outdated version of Arch, and causes problems.

srgk26 avatar Jun 08 '19 23:06 srgk26

How did you build a new image? Do you know which files in your new image are different from the ones in the provided image?

jschwartzenberg avatar Jun 11 '19 13:06 jschwartzenberg

How did you build a new image? Do you know which files in your new image are different from the ones in the provided image?

This is in my system running Arch Linux:

## Downloading Junest
[user@pc ~]$ sudo pacman -Syu ## Perform system update first to build junest using the latest system image
[user@pc ~]$ sudo pacman -S arch-install-scripts
[user@pc ~]$ git clone git://github.com/fsquillace/junest ~/.local/share/junest

## Add this line to ~/.bashrc
export PATH=~/.local/share/junest/bin:$PATH

## Build system image
[user@pc ~]$ junest -b -n

This will give my own junest image with the same name, 'junest-x86_64.tar.gz'.

I will then export this image to my unprivileged Linux system by SCP or whatever. Then I did this:

## Downloading Junest
[guest@pc ~]$ git clone git://github.com/fsquillace/junest ~/.local/share/junest

## Add this line to ~/.bashrc
export PATH=~/.local/share/junest/bin:$PATH

## Installing Junest
[guest@pc ~]$ junest -i junest-x86_64.tar.gz ## This junest-x86_64.tar.gz is the system image you built

This is different from the default junest image provided in the sense that this is the more updated version, and is based on my system image on my computer. It still wouldn't have the additional programmes that I would have on my current Arch Linux system though.

It's very likely that the default junest image being outdated is the only reason there're these conflicting packages. And Arch being a rolling release distro, all the more likely it's just not compatible anymore.

srgk26 avatar Jun 11 '19 15:06 srgk26

Thanks for the instructions. Maybe I'll set up an Arch VM to try them.

But what I'm curious about is, as the image will be extracted on the unprivileged system, there are apparently some parts in it that are not updated by pacman. If we'd know which parts those are, then we could also copy those manually into an existing tree based on an old image.

jschwartzenberg avatar Jun 11 '19 15:06 jschwartzenberg

Thanks for the instructions. Maybe I'll set up an Arch VM to try them. But what I'm curious about is, as the image will be extracted on the unprivileged system, there are apparently some parts in it that are not updated by pacman. If we'd know which parts those are, then we could also copy those manually into an existing tree based on an old image.

Well, I'm not sure about that either. Would need to know quite deep into how the junest image is being built in the first place. for example, the 'yogurt' package is not in my Arch system. But it is included by default in the junest image building process anyway. Unless we check the source code, probably the developer for junest, Filppo, would be the one able to answer that.

srgk26 avatar Jun 11 '19 16:06 srgk26

I tried @srgk26 solution but it doesn't fix my problem. However I'm starting to think it's genuinely a bug in the individual programs that are crashing. For some reason, running them in Junest makes memory violation errors more likely to crash the program.

The best to reproduce it is to just run install-info (for example). I'm posting the full command I'm running as soon as I can.

KingDuckZ avatar Aug 09 '19 00:08 KingDuckZ

Hi all,

So, this is related to a very old issue: https://github.com/fsquillace/junest/issues/161

When updating glibc there are multiple problems with proot. If by any chance you can use Linux user namespace on your host OS, I reccommend to use junest -u instead.

Proot will be eventually deprecated in JuNest in favor of Linux user Namespace as soon as it will be enabled by default by the major Linux distributions.

In the latest kernel versions I have seen that ArchLinux and Ubuntu have the unprivileged User NS enabled by default.

fsquillace avatar Aug 10 '19 00:08 fsquillace

BTW I have updated the JuNest image with the latest version. I will try to make sure to update it every 3 months from now.

fsquillace avatar Aug 10 '19 01:08 fsquillace

I have an environment where I'm stuck with RHEL6, I do not expect namespaces to be an option anytime soon. I will see if the new image will work.

jschwartzenberg avatar Aug 10 '19 09:08 jschwartzenberg

I am having this issue, @srgk26 solution does not work for me and namespaces is disabled. I am wondering if I could still try something, e.g. recompiling anything might help? Particularly R from the Arch repo segfaults immediatley after printing its greeting message. Do you think recompiling R or maybe proot might help?

deeenes avatar Sep 18 '19 00:09 deeenes