[SERVER-61023] Have setup_spawnhost_coredump reorganize where files live to support running the executables Created: 27/Oct/21  Updated: 29/Oct/23  Resolved: 27/Oct/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.2.0

Type: Improvement Priority: Major - P3
Reporter: Daniel Gottlieb (Inactive) Assignee: Daniel Gottlieb (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 Description   

The script already creates a .profile that runs when a user logs in. We can have that script set the LD_LIBRARY_PATH to $HOME/debug/lib along with the existing modification to the PATH.

Have the binaries extract into the intended bin directory and symlink them into the top-level debug directory.



 Comments   
Comment by Githook User [ 27/Oct/21 ]

Author:

{'name': 'Daniel Gottlieb', 'email': 'daniel.gottlieb@mongodb.com', 'username': 'dgottlieb'}

Message: SERVER-61023: Have setup_spawnhost_coredump extract executables such that they can be run.

Executables and .debug files are now extracted into the bin directory. The contents of
the bin directory are symlinked into the parent debug directory.
Branch: master
https://github.com/mongodb/mongo/commit/6a481e9253d252e2f5bcd3c9126598534fac13d1

Comment by Daniel Gottlieb (Inactive) [ 27/Oct/21 ]

Having done some research on the current version of gdb in our toolchain, changing the LD_LIBRARY_PATH is not necessary.

Historically, gdb would not follow soft links and properly resolve where all of the debug symbols lived. But it seems that's no longer true. What I've demonstrated now works is:

  • Extract the binaries and .debug files into the intended bin directory
  • Then sym-link those files into the parent directory where the core dump files live such that a user can still simply type

    gdb ./mongod ./dump_example_mongod.core
    

Comment by Andrew Morrow (Inactive) [ 27/Oct/21 ]

Can I get some context on what you are trying to accomplish? Setting LD_LIBRARY_PATH should almost never be necessary. The shared libraries associated with a dynamically linked mongod are properly configured with ORIGIN based RPATH entries, so LD_LIBRARY_PATH should particularly not be required for them.

Generated at Thu Feb 08 05:51:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.