10

I am working on a CentOS 7 workstation. I had installed Rstudio and it was working fine until recently. But now, if I try to launch it at http://localhost:8787/ I get an error that says Unable to connect to service

I checked if R is working properly in terminal and I got following error.

/usr/lib64/R/bin/exec/R: error while loading shared libraries: /lib/libgcc_s.so.1: file too short

If I try to install R again using following command, sudo yum install R -y I get following reply

Package R-3.5.2-2.el7.x86_64 already installed and latest version
Nothing to do

What do I have to do?

9
  • I know this message and it is typically true: The so is truncanted or empty because of some prior problem. What does objdump /lib/libgcc_s.so.1 say (if you have the GNU tools installed)?
    – Philippos
    Commented Jun 7, 2019 at 8:28
  • I don't get the output. It asks for more details. It says At least one of the following switches must be given and then there are options --archive-headers --file-headers etc. And the output is blank if I select these two options. Commented Jun 7, 2019 at 8:32
  • You are right. Just choose some random option like objdump -a
    – Philippos
    Commented Jun 7, 2019 at 8:35
  • I updated my post a bit late. There is no output with any option I try. Commented Jun 7, 2019 at 8:38
  • 1
    Looks like an empty file. 0 /lib/libgcc_s.so.1 Commented Jun 7, 2019 at 9:06

2 Answers 2

7

You have a damaged .so.

In general, you issue the following command to find the package it belongs to:

yum provides \*/<so_file>

In your case:

$ yum provides \*/libgcc_s.so.1
[...]
libgcc-4.4.6-4.el6.i686 : GCC version 4.4 shared support library
Repo : base
Matched from:
Filename : /lib/libgcc_s.so.1
[...]

In this case, we want libgcc-4.4.6-4.el6.i686, you will get another version.

You need to reinstall that package.

yum reinstall libgcc-<version>.i686
4
  • I tried doing that but got an error. Loaded plugins: fastestmirror, langpacks No Match for argument: libgcc-4.4.6-4.el6.i686 Loading mirror speeds from cached hostfile * base: mirror.nbrc.ac.in * epel: kartolo.sby.datautama.net.id * extras: mirror.nbrc.ac.in * updates: mirror.nbrc.ac.in Error: Nothing to do . No package libgcc-4.4.6-4.el6.i686 available. Commented Jun 7, 2019 at 9:07
  • Yeah, hm, I should have removed version info! Will edit my answer ... I do not have CentOS 7 here ... ;-) What does yum provides \*/libgcc_s.so.1 report for /lib/libgcc_s.so.1 ?
    – thecarpy
    Commented Jun 7, 2019 at 9:38
  • Multiple lines but mostly this libgcc-4.8.5-36.el7_6.2.i686 : GCC version 4.8 shared support library Commented Jun 7, 2019 at 11:44
  • Oh, I see! Thanks :) Commented Jun 7, 2019 at 11:56
0

In my case I was getting ld : error : myfile: file too short, or sometimes:

ld: warning: myfile has a section extending past end of file
ld : error : myfile: ELF section name out of range

because I was patching for Nix a folder containing both source code and binary blob… and since the number of files to patch was high I used a script to patch them all at the same time (using find and sed -i). Unfortunately, sed was also applied on binary files, which completely corrupted them.

I realized that by printing objdump -a myfile before and after the patching (I would get an error in the second case).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .