Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to fix a glibc update (Sanity check ...save your system)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
jamapii
Guru
Guru


Joined: 16 Sep 2004
Posts: 559

PostPosted: Fri Jun 23, 2017 7:21 pm    Post subject: How to fix a glibc update (Sanity check ...save your system) Reply with quote

Hello,

glibc has some hardwired code (VERY hardwired) in its eclass to prevent undoing upgrades.

This means:

- quickpkg glibc
- emerge glibc
- (see if it is ok)
- emerge --usepkg (old glibc)

is blocked.

How can I work around this?

thanks


Last edited by jamapii on Fri Jun 23, 2017 7:37 pm; edited 1 time in total
Back to top
View user's profile Send private message
jamapii
Guru
Guru


Joined: 16 Sep 2004
Posts: 559

PostPosted: Fri Jun 23, 2017 7:36 pm    Post subject: Reply with quote

The thread "Downgrading glibc" really does not seem a good way to do it. It is extremely complex and looks dangerous, possibly worse than a brute force hack like untarring the saved binary package somewhere.

I tried commenting the die in the eclass, but it seems the saved eclass in the package is used.

Would setting CBUILD=nothing, just for installing the saved binary package, be safe and effective?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43192
Location: 56N 3W

PostPosted: Fri Jun 23, 2017 8:01 pm    Post subject: Reply with quote

jamapii,

Its worse than that. glibc itself has some hardwired things in it.
However you manage to downgrade glibc, you will break your system.

If you really want to downgrade glibc, its complex and dangerous.

Why do you want to downgrade glibc?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7090
Location: Saint Amant, Acadiana

PostPosted: Fri Jun 23, 2017 8:25 pm    Post subject: Reply with quote

I just upgraded glibc in one of my boxes and before I built anything against it tried to downgrade it with -k and met no resistance.
Code:
emerge -avk1 =glibc-2.24-r2

These are the packages that would be merged, in order:

Calculating dependencies... done!
[binary     UD ] sys-libs/glibc-2.24-r2:2.2::gentoo [2.24-r3:2.2::gentoo] USE="rpc -audit -caps -debug -gd (-hardened) (-multilib) -nscd -profile (-selinux) -suid -systemtap -vanilla" 0 KiB

Total: 1 package (1 downgrade, 1 binary), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No]

_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
jamapii
Guru
Guru


Joined: 16 Sep 2004
Posts: 559

PostPosted: Fri Jun 23, 2017 8:29 pm    Post subject: Reply with quote

I updated glibc to 2.23 from 2.21. This always says "FATAL: kernel too old" when running on the target system (kernel 3.8).

On the build system with kernel 4.4, it works fine. The target system is NFS mounted, inside chroot everything is built. NPTL_KERN_VER is 3.8, but maybe glibc picks something up from the running kernel, or cannot work on 3.8 at all.

I tried more:

CBUILD=nothing has no effect

ROOT=// or --root=// or anything else has no effect, the check ROOT = / cannot be cheated

What is so "complex" about it? Last time I tried, very long ago, it was no problem at all - just don't reinstall anything with the new glibc before the downgrade.

[Moderator edit: checked Disable Smilies in this post so that OP's ancient kernel version is presented correctly. -Hu]
Back to top
View user's profile Send private message
jamapii
Guru
Guru


Joined: 16 Sep 2004
Posts: 559

PostPosted: Fri Jun 23, 2017 8:31 pm    Post subject: Reply with quote

A -rN to -r(N-1) downgrade never was a problem, I guess you can even reinstall other packages just before the downgrade.

The case is explicitly exempted in the eclass code.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43192
Location: 56N 3W

PostPosted: Fri Jun 23, 2017 8:35 pm    Post subject: Reply with quote

Jaglover,

Portage used to issue dire warnings abut that downgrade.

Ah ... -rx chages don't count but it seems the dire warnings have gone.

Code:
$ emerge =sys-libs/glibc-2.23-r3 -pv

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     UD ] sys-libs/glibc-2.23-r3:2.2::gentoo [2.24-r3:2.2::gentoo] USE="caps rpc -audit -debug -gd (-hardened) (-multilib) -nscd -profile (-selinux) -suid -systemtap -vanilla" 0 KiB

Total: 1 package (1 downgrade), Size of downloads: 0 KiB

 * IMPORTANT: 30 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
jamapii
Guru
Guru


Joined: 16 Sep 2004
Posts: 559

PostPosted: Fri Jun 23, 2017 9:05 pm    Post subject: Reply with quote

I managed to downgrade it.

The next best way seemed to be to leave the chroot where the to-be-fixed system is located, and use "emerge --root=... " to fix it "from outside".

This has some unexpected obstacles. It seems portage does not pick up the correct CHOST and /etc/portage from supplying the --root= parameter. (I wonder if it will install in the correct tree...)

So I unmasked the old glibc in the "outside" host, not just in the to-be-fixed system, and set environment variables CHOST, CBUILD, and, for added safety (overkill), ROOT. ROOT the variable gets the same value as --root= the parameter. Adding --nodeps to be a little faster.

With this emerge command, with -pv, the output looks right.

Then, execute the downgrade. With this new^Wold glibc, everything seems to work again.

What could possibly go wrong?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13842

PostPosted: Sat Jun 24, 2017 12:02 am    Post subject: Reply with quote

For one, you are running a kernel which has not been maintained in a long time. Unless you are very lucky in what you have configured off, there are likely unfixed security bugs in that kernel. Why did you choose to downgrade glibc instead of upgrading the kernel? It looks to me like the last v3.8.x release was v3.8.13 released 2013-05-11 13:57:46.
Back to top
View user's profile Send private message
jamapii
Guru
Guru


Joined: 16 Sep 2004
Posts: 559

PostPosted: Sat Jun 24, 2017 11:41 am    Post subject: Reply with quote

Hu wrote:
Why did you choose to downgrade glibc instead of upgrading the kernel?


A kernel update takes more time, and I prefer to do it locally, not over NFS.

I tried to upgrade glibc locally with the old kernel running. Same error (detected before installation). This glibc-2.23 does not run on my kernel 3.8. I wonder what it is. glibc did not have that kind of issues in the past.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13842

PostPosted: Sat Jun 24, 2017 4:38 pm    Post subject: Reply with quote

The maintainers probably decided that some feature that is exclusive to newer kernel versions would substantially help glibc, so they added a use of it. Since kernel 3.8 is out of support and has been for a long time, they did not include a fallback for kernels that predate the feature.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum