Skip to content

Conversation

@ktf
Copy link
Contributor

@ktf ktf commented Oct 3, 2025

One cannot simply ship libc and ld-linux.so and hope they will be picked up correctly. In particular, ld-linux will always be the one of the system, because it gets loaded first by the kernel, when the executable is not yet around. This means that the current approach fails when the shipped libc is not compatible with the system ld-linux. It's much safer to simply not ship libc at all and pickup the system version.

@ktf
Copy link
Contributor Author

ktf commented Oct 3, 2025

To believe me:

tar xzvf /cvmfs/alice.cern.ch/el9-x86_64/Packages/DDS/3.13-10/bin/wn_bins/dds-wrk-bin-3.13-Linux-x86_64.tar.gz
cd dds-wrk-bin
cat foo.cxx << \EOF
#include <cstdio>
int main(int, char**) {
  printf("Hello world\n");
  return 0;
}
EOF
c++ foo.cc

LD_DEBUG=symbols LD_LIBRARY_PATH=. ./a.out

will happily show that /lib64/ld-linux-x86-64.so.2 is used for symbol resolution, not the one in dds-wrk-bin:

→ LD_DEBUG=symbols LD_LIBRARY_PATH=. ./a.out
   3146853:     symbol=__vdso_clock_gettime;  lookup in file=linux-vdso.so.1 [0]
   3146853:     symbol=__vdso_gettimeofday;  lookup in file=linux-vdso.so.1 [0]
   3146853:     symbol=__vdso_time;  lookup in file=linux-vdso.so.1 [0]
   3146853:     symbol=__vdso_getcpu;  lookup in file=linux-vdso.so.1 [0]
   3146853:     symbol=__vdso_clock_getres;  lookup in file=linux-vdso.so.1 [0]
   3146853:     symbol=_res;  lookup in file=./a.out [0]
   3146853:     symbol=_res;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=svc_max_pollfd;  lookup in file=./a.out [0]
   3146853:     symbol=svc_max_pollfd;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=obstack_alloc_failed_handler;  lookup in file=./a.out [0]
   3146853:     symbol=obstack_alloc_failed_handler;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__ctype_toupper;  lookup in file=./a.out [0]
   3146853:     symbol=__ctype_toupper;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=loc1;  lookup in file=./a.out [0]
   3146853:     symbol=loc1;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_dl_argv;  lookup in file=./a.out [0]
   3146853:     symbol=_dl_argv;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_dl_argv;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
   3146853:     symbol=__libc_single_threaded;  lookup in file=./a.out [0]
   3146853:     symbol=__libc_single_threaded;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=free;  lookup in file=./a.out [0]
   3146853:     symbol=free;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=re_syntax_options;  lookup in file=./a.out [0]
   3146853:     symbol=re_syntax_options;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=rpc_createerr;  lookup in file=./a.out [0]
   3146853:     symbol=rpc_createerr;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=stdout;  lookup in file=./a.out [0]
   3146853:     symbol=stdout;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__ctype32_toupper;  lookup in file=./a.out [0]
   3146853:     symbol=__ctype32_toupper;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=opterr;  lookup in file=./a.out [0]
   3146853:     symbol=opterr;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=getdate_err;  lookup in file=./a.out [0]
   3146853:     symbol=getdate_err;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__curbrk;  lookup in file=./a.out [0]
   3146853:     symbol=__curbrk;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=loc2;  lookup in file=./a.out [0]
   3146853:     symbol=loc2;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=program_invocation_name;  lookup in file=./a.out [0]
   3146853:     symbol=program_invocation_name;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__fpu_control;  lookup in file=./a.out [0]
   3146853:     symbol=__fpu_control;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__libc_enable_secure;  lookup in file=./a.out [0]
   3146853:     symbol=__libc_enable_secure;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__libc_enable_secure;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
   3146853:     symbol=_IO_2_1_stderr_;  lookup in file=./a.out [0]
   3146853:     symbol=_IO_2_1_stderr_;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_IO_2_1_stderr_;  lookup in file=./a.out [0]
   3146853:     symbol=_IO_2_1_stderr_;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__rcmd_errstr;  lookup in file=./a.out [0]
   3146853:     symbol=__rcmd_errstr;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__ctype_b;  lookup in file=./a.out [0]
   3146853:     symbol=__ctype_b;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=error_print_progname;  lookup in file=./a.out [0]
   3146853:     symbol=error_print_progname;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=stderr;  lookup in file=./a.out [0]
   3146853:     symbol=stderr;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=obstack_exit_failure;  lookup in file=./a.out [0]
   3146853:     symbol=obstack_exit_failure;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__libc_stack_end;  lookup in file=./a.out [0]
   3146853:     symbol=__libc_stack_end;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__libc_stack_end;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
   3146853:     symbol=__key_encryptsession_pk_LOCAL;  lookup in file=./a.out [0]
   3146853:     symbol=__key_encryptsession_pk_LOCAL;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_rtld_global_ro;  lookup in file=./a.out [0]
   3146853:     symbol=_rtld_global_ro;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_rtld_global_ro;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
   3146853:     symbol=argp_program_version;  lookup in file=./a.out [0]
   3146853:     symbol=argp_program_version;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=svcauthdes_stats;  lookup in file=./a.out [0]
   3146853:     symbol=svcauthdes_stats;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__check_rhosts_file;  lookup in file=./a.out [0]
   3146853:     symbol=__check_rhosts_file;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=optind;  lookup in file=./a.out [0]
   3146853:     symbol=optind;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_IO_2_1_stdin_;  lookup in file=./a.out [0]
   3146853:     symbol=_IO_2_1_stdin_;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_IO_2_1_stdin_;  lookup in file=./a.out [0]
   3146853:     symbol=_IO_2_1_stdin_;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=program_invocation_short_name;  lookup in file=./a.out [0]
   3146853:     symbol=program_invocation_short_name;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__ctype32_tolower;  lookup in file=./a.out [0]
   3146853:     symbol=__ctype32_tolower;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=error_message_count;  lookup in file=./a.out [0]
   3146853:     symbol=error_message_count;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=optopt;  lookup in file=./a.out [0]
   3146853:     symbol=optopt;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__ctype32_b;  lookup in file=./a.out [0]
   3146853:     symbol=__ctype32_b;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_nl_msg_cat_cntr;  lookup in file=./a.out [0]
   3146853:     symbol=_nl_msg_cat_cntr;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__daylight;  lookup in file=./a.out [0]
   3146853:     symbol=__daylight;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_nl_domain_bindings;  lookup in file=./a.out [0]
   3146853:     symbol=_nl_domain_bindings;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=argp_program_bug_address;  lookup in file=./a.out [0]
   3146853:     symbol=argp_program_bug_address;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_IO_funlockfile;  lookup in file=./a.out [0]
   3146853:     symbol=_IO_funlockfile;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=svc_fdset;  lookup in file=./a.out [0]
   3146853:     symbol=svc_fdset;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__rseq_size;  lookup in file=./a.out [0]
   3146853:     symbol=__rseq_size;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__rseq_size;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
   3146853:     symbol=__libc_dlerror_result;  lookup in file=./a.out [0]
   3146853:     symbol=__libc_dlerror_result;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=stdin;  lookup in file=./a.out [0]
   3146853:     symbol=stdin;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__timezone;  lookup in file=./a.out [0]
   3146853:     symbol=__timezone;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__ctype_tolower;  lookup in file=./a.out [0]
   3146853:     symbol=__ctype_tolower;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_IO_2_1_stdout_;  lookup in file=./a.out [0]
   3146853:     symbol=_IO_2_1_stdout_;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_IO_2_1_stdout_;  lookup in file=./a.out [0]
   3146853:     symbol=_IO_2_1_stdout_;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__tzname;  lookup in file=./a.out [0]
   3146853:     symbol=__tzname;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=error_one_per_line;  lookup in file=./a.out [0]
   3146853:     symbol=error_one_per_line;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_res_hconf;  lookup in file=./a.out [0]
   3146853:     symbol=_res_hconf;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__key_decryptsession_pk_LOCAL;  lookup in file=./a.out [0]
   3146853:     symbol=__key_decryptsession_pk_LOCAL;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_rtld_global;  lookup in file=./a.out [0]
   3146853:     symbol=_rtld_global;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_rtld_global;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
   3146853:     symbol=_rtld_global;  lookup in file=./a.out [0]
   3146853:     symbol=_rtld_global;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_rtld_global;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
   3146853:     symbol=__progname;  lookup in file=./a.out [0]
   3146853:     symbol=__progname;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=h_errlist;  lookup in file=./a.out [0]
   3146853:     symbol=h_errlist;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__environ;  lookup in file=./a.out [0]
   3146853:     symbol=__environ;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=argp_err_exit_status;  lookup in file=./a.out [0]
   3146853:     symbol=argp_err_exit_status;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=svc_pollfd;  lookup in file=./a.out [0]
   3146853:     symbol=svc_pollfd;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__progname_full;  lookup in file=./a.out [0]
   3146853:     symbol=__progname_full;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=argp_program_version_hook;  lookup in file=./a.out [0]
   3146853:     symbol=argp_program_version_hook;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=optarg;  lookup in file=./a.out [0]
   3146853:     symbol=optarg;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=malloc;  lookup in file=./a.out [0]
   3146853:     symbol=malloc;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=realloc;  lookup in file=./a.out [0]
   3146853:     symbol=realloc;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=calloc;  lookup in file=./a.out [0]
   3146853:     symbol=calloc;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=free;  lookup in file=./a.out [0]
   3146853:     symbol=free;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_dl_find_dso_for_object;  lookup in file=./a.out [0]
   3146853:     symbol=_dl_find_dso_for_object;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_dl_find_dso_for_object;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
   3146853:     symbol=_dl_deallocate_tls;  lookup in file=./a.out [0]
   3146853:     symbol=_dl_deallocate_tls;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_dl_deallocate_tls;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
   3146853:     symbol=__tls_get_addr;  lookup in file=./a.out [0]
   3146853:     symbol=__tls_get_addr;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=__tls_get_addr;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
   3146853:     symbol=_dl_signal_error;  lookup in file=./a.out [0]
   3146853:     symbol=_dl_signal_error;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_dl_signal_error;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
   3146853:     symbol=_dl_signal_exception;  lookup in file=./a.out [0]
   3146853:     symbol=_dl_signal_exception;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_dl_signal_exception;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
   3146853:     symbol=_dl_audit_symbind_alt;  lookup in file=./a.out [0]
   3146853:     symbol=_dl_audit_symbind_alt;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_dl_audit_symbind_alt;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
   3146853:     symbol=_dl_readonly_area;  lookup in file=./a.out [0]
   3146853:     symbol=_dl_readonly_area;  lookup in file=./libc.so.6 [0]
   3146853:     symbol=_dl_readonly_area;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
   3146853:     ./libc.so.6: error: symbol lookup error: undefined symbol: _dl_readonly_area, version GLIBC_PRIVATE (fatal)
./a.out: symbol lookup error: ./libc.so.6: undefined symbol: _dl_readonly_area, version GLIBC_PRIVATE

@lkrcal
Copy link

lkrcal commented Oct 3, 2025

When I build DDS with this, then the agent fails to start with:

Failed to create a DDS session: Failed to start a new session. Error code 1; error: dds-session: error: Precompiled bins check failed.

And if I run it in lightweight mode, then not even the DDSWorker.sh gets shipped to the node and nothing can start.

bash: line 1: ./DDSWorker.sh: No such file or directory

@AnarManafov
Copy link
Contributor

@ktf , @lkrcal , apologies for a delayed response. I was away. I will check your messages asap.

@ktf
Copy link
Contributor Author

ktf commented Oct 4, 2025

@lkrcal Is this on top of master or 3.13?

@ktf
Copy link
Contributor Author

ktf commented Oct 4, 2025

On my box I get:

# eulisse in ~/src/dds-wrk-bin [11:51:15]
→ LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH ../sw/ubuntu2204_x86-64/DDS/latest/bin/dds-session start
DDS session ID: cc3869ef-1d60-4c2a-8d2d-e9d078782c9d
Checking precompiled binaries for the local system only:
        dds-wrk-bin-3.13.1.gb21ca3e-Linux-x86_64.tar.gz - OK
Starting DDS commander...
Waiting for DDS Commander to appear online...
DDS commander appears online. Testing connection...
DDS commander is up and running.
------------------------
DDS commander server: 4079652
------------------------
Startup time: 40.6345 ms
Default DDS session is set to cc3869ef-1d60-4c2a-8d2d-e9d078782c9d
Currently running DDS sessions:
 * cc3869ef-1d60-4c2a-8d2d-e9d078782c9d          [2025-10-04T11:51:21Z]          RUNNING
Performing Data Retention sanitization. Session older than 2025-09-27 11:51:21 will be deleted...

Which I think it's what's expected no? ldd also report what I would expect as libraries:

       linux-vdso.so.1 (0x00007ffc277bc000)
        libdds_tools_lib.so.3.13.1.gb21ca3e => /home/eulisse/src/sw/ubuntu2204_x86-64/DDS/3.13-local1/lib/libdds_tools_lib.so.3.13.1.gb21ca3e (0x00007f1aa2485000)
        libdds_intercom_lib.so.3.13.1.gb21ca3e => ./libdds_intercom_lib.so.3.13.1.gb21ca3e (0x00007f1aa22ff000)
        libdds_protocol_lib.so.3.13.1.gb21ca3e => ./libdds_protocol_lib.so.3.13.1.gb21ca3e (0x00007f1aa22d4000)
        libdds-user-defaults.so.3.13.1.gb21ca3e => ./libdds-user-defaults.so.3.13.1.gb21ca3e (0x00007f1aa229d000)
        libdds_misc_lib.so.3.13.1.gb21ca3e => ./libdds_misc_lib.so.3.13.1.gb21ca3e (0x00007f1aa2287000)
        libboost_program_options.so.1.83.0 => ./libboost_program_options.so.1.83.0 (0x00007f1aa221b000)
        libboost_log_setup.so.1.83.0 => ./libboost_log_setup.so.1.83.0 (0x00007f1aa212c000)
        libboost_log.so.1.83.0 => ./libboost_log.so.1.83.0 (0x00007f1aa2052000)
        libboost_chrono.so.1.83.0 => ./libboost_chrono.so.1.83.0 (0x00007f1aa2048000)
        libboost_thread.so.1.83.0 => ./libboost_thread.so.1.83.0 (0x00007f1aa2026000)
        libboost_filesystem.so.1.83.0 => ./libboost_filesystem.so.1.83.0 (0x00007f1aa1ffe000)
        libboost_atomic.so.1.83.0 => ./libboost_atomic.so.1.83.0 (0x00007f1aa1ff4000)
        libboost_system.so.1.83.0 => ./libboost_system.so.1.83.0 (0x00007f1aa1fef000)
        libboost_regex.so.1.83.0 => ./libboost_regex.so.1.83.0 (0x00007f1aa1f99000)
        libstdc++.so.6 => /home/eulisse/src/sw/ubuntu2204_x86-64/GCC-Toolchain/v14.2.0-alice2-1/lib64/libstdc++.so.6 (0x00007f1aa1d27000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1aa1c31000)
        libgcc_s.so.1 => ./libgcc_s.so.1 (0x00007f1aa1c11000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1aa19e8000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f1aa25b0000)

@AnarManafov
Copy link
Contributor

To me the patch makes perfect sense. What Lubos is getting is something else. I will check that too.
Give time to test the patch on different hosts and I will merge it if all good.

@AnarManafov AnarManafov merged commit 6c730cb into FairRootGroup:master Oct 8, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants