conda-forge / conda-forge/abseil-cpp-feedstock
segfault in abseil 20240126.2 with TensorFlow 2.16 and PyTorch 2.3
- Dominant language
- C++
- Stars
- 2
- Forks
- 18
- Avg merge
- 12h 55m
- Merged PRs (30d)
- 1
Description
### Comment:
In https://github.com/conda-forge/deepmd-kit-feedstock/pull/78, I am building a program linked with TensorFlow and PyTorch. When using the latest versions of them, i.e. TensorFlow 2.16 and PyTorch 2.3, there is a segmentation fault in `absl::lts_20240116::flags_internal::FlagRegistry::RegisterFlag` in either conda-forge images or the local environment, as shown below:
```
(gdb) where
#0 0x0000155541a60e09 in absl::lts_20240116::flags_internal::FlagRegistry::RegisterFlag(absl::lts_20240116::CommandLineFlag&, char const*) ()
from /home/jz748/anaconda3/envs/test-deepmd-build/bin/../lib/./python3.11/site-packages/tensorflow/../../../libabsl_flags_reflection.so.2401.0.0
#1 0x0000155541a625c1 in absl::lts_20240116::flags_internal::RegisterCommandLineFlag(absl::lts_20240116::CommandLineFlag&, char const*) ()
from /home/jz748/anaconda3/envs/test-deepmd-build/bin/../lib/./python3.11/site-packages/tensorflow/../../../libabsl_flags_reflection.so.2401.0.0
#2 0x0000155541a80079 in _GLOBAL__sub_I_flags.cc ()
from /home/jz748/anaconda3/envs/test-deepmd-build/bin/../lib/./python3.11/site-packages/tensorflow/../../../libabsl_log_flags.so.2401.0.0
#3 0x0000155555525237 in call_init (env=0x55555567dbf0, argv=0x7fffffffad58, argc=3, l=) at dl-init.c:74
#4 call_init (l=, argc=3, argv=0x7fffffffad58, env=0x55555567dbf0) at dl-init.c:26
#5 0x000015555552532d in _dl_init (main_map=0x555555780eb0, argc=3, argv=0x7fffffffad58, env=0x55555567dbf0) at dl-init.c:121
#6 0x00001555555215c2 in __GI__dl_catch_exception (exception=exception@entry=0x0, operate=operate@entry=0x15555552bf50 ,
args=args@entry=0x7fffffffa290) at dl-catch.c:211
#7 0x000015555552beec in dl_open_worker (a=a@entry=0x7fffffffa440) at dl-open.c:827
#8 0x0000155555521523 in __GI__dl_catch_exception (exception=exception@entry=0x7fffffffa420,
operate=operate@entry=0x15555552be50 , args=args@entry=0x7fffffffa440) at dl-catch.c:237
#9 0x000015555552c2e4 in _dl_open (file=0x555555780cc0 "/home/jz748/anaconda3/envs/test-deepmd-build/lib/deepmd_lmp/dpplugin.so",
mode=, caller_dlopen=0x155550f40916 , nsid=,
argc=3, argv=0x7fffffffad58, env=0x55555567dbf0) at dl-open.c:903
#10 0x000015554fcc7714 in dlopen_doit () from /lib64/libc.so.6
#11 0x0000155555521523 in __GI__dl_catch_exception (exception=exception@entry=0x7fffffffa630, operate=0x15554fcc76b0 ,
args=0x7fffffffa6f0) at dl-catch.c:237
#12 0x0000155555521679 in _dl_catch_error (objname=0x7fffffffa698, errstring=0x7fffffffa6a0, mallocedp=0x7fffffffa697, operate=,
args=) at dl-catch.c:256
#13 0x000015554fcc71f3 in _dlerror_run () from /lib64/libc.so.6
#14 0x000015554fcc77cf in dlopen@GLIBC_2.2.5 () from /lib64/libc.so.6
#15 0x0000155550f40916 in LAMMPS_NS::plugin_load(char const*, LAMMPS_NS::LAMMPS*) ()
from /home/jz748/anaconda3/envs/test-deepmd-build/bin/../lib/liblammps.so.0
#16 0x0000155550f40f66 in LAMMPS_NS::plugin_auto_load(LAMMPS_NS::LAMMPS*) ()
from /home/jz748/anaconda3/envs/test-deepmd-build/bin/../lib/liblammps.so.0
#17 0x00001555507fe6ed in LAMMPS_NS::LAMMPS::LAMMPS(int, char**, ompi_communicator_t*) ()
from /home/jz748/anaconda3/envs/test-deepmd-build/bin/../lib/liblammps.so.0
#18 0x0000555555556217 in main ()
```
However, these two things do work:
(1) Pin tensorflow to 2.15 and pytorch to 2.1;
(2) Use the same abseil version, but built against TensorFlow only, without PyTorch. (https://github.com/conda-forge/deepmd-kit-feedstock/pull/79)
I am not sure what the problem is. As a workaround, I pin tensorflow to 2.15 and pytorch to 2.1.
Contributor guide
Assessment
This issue has not been assessed yet.