bugManeage - Bugs: bug #65677, Conflicting /bin/sh causes crash...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #65677: Conflicting /bin/sh causes crash in high-level sofware

Submitter:  Mohammad Akhlaghi <makhlaghi>
Submitted:  Fri 03 May 2024 11:19:10 AM UTC
   
 
Category:  Software Severity:  3 - Normal
Item Group:  Crash Status:  Ready For Test
Privacy:  Public Assigned to:  makhlaghi
Open/Closed:  Open

Fri 03 May 2024 07:37:24 PM UTC, comment #4: 

In the previous comment I forgot to mention that I added Commit eabf1354d6 over the branch to fix the first point below about TeXLive.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Fri 03 May 2024 07:36:19 PM UTC, comment #3: 

Two other updates:

  • TeXLive also confronts problem with '/bin/sh' and after a fast look, I couldn't find how the parts in the tarball can be changed: unfortunately we do not build TeXLive packages from sources and things are downloaded, so unfortunately we do not control that part.
  • Bug: On the laptop of Sepideh Eskandarlou (Lenovo P15s) with an ArchLinux that has been similarly updated to my Dell desktop; we noticed that when building "libtoolize", Libtool does not add its necessary internal functions (like 'func_add_hook'). As a result, when Maneage was trying build libpaper, in the 'autoreconf -fi' step, libtoolize would crash with errors of un-known functions. The strange thing is that while the operating systems are almost identical, it happens on one of them! For the time being, I just added '/usr/lib' to 'LD_LIBRARY_PATH' in the Libtool
Mohammad Akhlaghi <makhlaghi>
Group administrator
Fri 03 May 2024 02:55:23 PM UTC, comment #2: 

Two missing shebangs were also corrected in Commit 9e3ea4a5a9 (on the same 'no-bin-sh' branch).

Mohammad Akhlaghi <makhlaghi>
Group administrator
Fri 03 May 2024 11:49:44 AM UTC, comment #1: 

Some extra comments:

  • As mentioned before, I will only actively develop software that are used in the default branch of Maneage (with Gnuastro as the only high-level software). So it would be good if you can check this commit after adding the other software that you commonly build/use.
  • For the edit in Python's source, I fixed it by adding '/usr/lib' to 'LD_LIBRARY_PATH' (also see P.S.). I wonder if this is generic or not? In other words, do all '/bin/sh's link with libraries in '/usr/lib'? I am thinking of adding a check in 'reproduce/software/shell/configure.sh' to read the libraries that '/bin/sh' links to, find their locations and keep them in a variable that is passed to high-level.mk for such cases. For this, I will need help for macOS systems. Raul, can you send me the command to do this on your macOS? The current thing I have in mind on GNU based operating systems is this command. On macOS, probably only the first two 'ldd' and 'awk' need to be modified.



$ ldd /bin/sh \
      | awk '{if($3!="") print $3}' \
      | sed 's#/[^/]*$##' \
      | sort \
      | uniq \
      | awk '{printf "%s:", $1}END{printf "\b"}'


P.S. On the second point: Unfortunately until we build the C library within Maneage, we cannot remove this dependency because Python's 'setup.py' uses 'os.system', which uses C's 'system()' function which will always use '/bin/sh' until we build it ourselves and correct this.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Fri 03 May 2024 11:19:10 AM UTC, original submission:  

Until now, Maneage had a major undetected leak: all low-level software default to '/bin/sh' (which is hard-coded in their sources!). So far this was not noticed because the Maneage shell and the '/bin/sh' of the operating systems we had tested on were compatible. But after trying to re-build a Maneage'd project with 2021 software on a computer with 2024 software, '/bin/sh' (and thus Maneage) crashed!

This lead me into a deep rabbit hole which initially looked bottom-less, but fortunately I finally reached the bottom and was able to fully build that Maneage'd project on that system :-).

The 'no-bin-sh' branch of https://gitlab.com/maneage/project-dev now has the fixes (in particular see Commit 847aa3bbf8d for all the changes so far in one commit; see the commit description and comments in the newly added script for more details on the problem and how it was solved).

I will hopefully be merging this into the main 'maneage' branch in a couple of weeks (along with all the other remaining commits to be merged). In case you have time, it would be good if you can check this build on your operating systems and/or share feedback about this problem/solution.

Mohammad Akhlaghi <makhlaghi>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by makhlaghi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code