On 2/4/25 22:17, Orion Poplawski wrote:
I'm working on updating libmamba to 2.0.X [1] but hitting the following error:

cd /home/orion/fedora/libmamba/libmamba-2.0.6-build/mamba-2.0.6/redhat- linux-build/libmambapy && /usr/lib64/ccache/g++ -DFMT_SHARED - DMAMBA_USE_INSTALL_PREFIX_AS_BASE -DSPDLOG_FMT_EXTERNAL - DSPDLOG_FWRITE_UNLOCKED -Dbindings_EXPORTS -I/home/orion/fedora/ libmamba/libmamba-2.0.6-build/mamba-2.0.6/libmambapy/src/libmambapy/ bindings -I/home/orion/fedora/libmamba/libmamba-2.0.6-build/mamba-2.0.6/ libmamba/include -isystem /usr/include/python3.13 -isystem /usr/share - O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches - pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,- D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/ redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/ redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous- unwind-tables -fstack-clash-protection -fcf-protection -mtls- dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -O2 -g -DNDEBUG -fPIC -fvisibility=hidden -Wall -Wextra -Wshadow -Wnon-virtual- dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual - Wpedantic -Wconversion -Wsign-conversion -Wnull-dereference -Wdouble- promotion -Wformat=2 -Wunreachable-code -Wuninitialized -Werror - Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches - Wlogical-op -Wuseless-cast -Wno-error=deprecated-declarations -MD -MT libmambapy/CMakeFiles/bindings.dir/src/libmambapy/bindings/legacy.cpp.o -MF CMakeFiles/bindings.dir/src/libmambapy/bindings/legacy.cpp.o.d -o CMakeFiles/bindings.dir/src/libmambapy/bindings/legacy.cpp.o -c /home/ orion/fedora/libmamba/libmamba-2.0.6-build/mamba-2.0.6/libmambapy/src/ libmambapy/bindings/legacy.cpp

/home/orion/fedora/libmamba/libmamba-2.0.6-build/mamba-2.0.6/libmambapy/ src/libmambapy/bindings/legacy.cpp: In lambda function: /home/orion/fedora/libmamba/libmamba-2.0.6-build/mamba-2.0.6/libmambapy/ src/libmambapy/bindings/legacy.cpp:557:47: warning: ‘mamba::expected_t<std::__cxx11::basic_string<char> > mamba::SubdirData::cache_path() const’ is deprecated: since version 2.0 use ``valid_solv_cache`` or ``valid_json_cache`` instead [-Wdeprecated- declarations]
   557 |                 return extract(self.cache_path());
       |                                ~~~~~~~~~~~~~~~^~
In file included from /home/orion/fedora/libmamba/libmamba-2.0.6-build/ mamba-2.0.6/libmambapy/src/libmambapy/bindings/legacy.cpp:30: /home/orion/fedora/libmamba/libmamba-2.0.6-build/mamba-2.0.6/libmamba/ include/mamba/core/subdirdata.hpp:135:33: note: declared here
   135 |         expected_t<std::string> cache_path() const;
       |                                 ^~~~~~~~~~
In file included from /usr/include/pybind11/attr.h:14,
                  from /usr/include/pybind11/detail/class.h:12,
                  from /usr/include/pybind11/pybind11.h:12,
                  from /usr/include/pybind11/functional.h:14,
                 from /home/orion/fedora/libmamba/libmamba-2.0.6-build/ mamba-2.0.6/libmambapy/src/libmambapy/bindings/legacy.cpp:11: In function ‘pybind11::detail::collect_arguments<(pybind11::return_value_policy)1, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, pybind11::detail::accessor<pybind11::detail::accessor_policies::str_attr>, pybind11::arg_v, void>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, pybind11::detail::accessor<pybind11::detail::accessor_policies::str_attr>&&, pybind11::arg_v&&)pybind11::detail::unpacking_collector<(pybind11::return_value_policy)1>’,     inlined from ‘pybind11::detail::object_api<pybind11::detail::accessor<pybind11::detail::accessor_policies::str_attr> >::operator()<(pybind11::return_value_policy)1, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, pybind11::detail::accessor<pybind11::detail::accessor_policies::str_attr>, pybind11::arg_v>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, pybind11::detail::accessor<pybind11::detail::accessor_policies::str_attr>&&, pybind11::arg_v&&) constpybind11::object’ at /usr/include/pybind11/cast.h:1823:45,     inlined from ‘deprecated(std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)’ at /home/orion/fedora/libmamba/ libmamba-2.0.6-build/mamba-2.0.6/libmambapy/src/libmambapy/bindings/ legacy.cpp:52:26: /usr/include/pybind11/cast.h:1812:67: error: ‘SR.32262’ may be used uninitialized [-Werror=maybe-uninitialized]  1812 |     return unpacking_collector<policy>(std::forward<Args>(args)...);       |                                                                    ^ /usr/include/pybind11/cast.h: In function ‘deprecated(std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >)’:
/usr/include/pybind11/cast.h:1823:45: note: ‘SR.32262’ was declared here
 1823 |     return detail::collect_arguments<policy>(std::forward<Args>(args)...).call(derived().ptr());
       | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
gmake[2]: *** [libmambapy/CMakeFiles/bindings.dir/build.make:96: libmambapy/CMakeFiles/bindings.dir/src/libmambapy/bindings/legacy.cpp.o] Error 1

I'm guessing 'SR.32262' is some kind of temporary variable.  libmamba has taken the (perhaps admirable?) step of compiling with -Werror so it fails.

The pybind11/cast.h function is:

/// Collect all arguments, including keywords and unpacking (only instantiated when needed)
template <return_value_policy policy,
           typename... Args,
           typename = enable_if_t<!args_are_all_positional<Args...>()>>
unpacking_collector<policy> collect_arguments(Args &&...args) {
    // Following argument order rules for generalized unpacking according to PEP 448
     static_assert(constexpr_last<is_positional, Args...>()
                           < constexpr_first<is_keyword_or_ds, Args...>()
                       && constexpr_last<is_s_unpacking, Args...>()
                             < constexpr_first<is_ds_unpacking, Args...>(),                   "Invalid function call: positional args must precede keywords and ** unpacking; "
                   "* unpacking must precede ** unpacking");
     return unpacking_collector<policy>(std::forward<Args>(args)...);
}

and it error on the return line.

libmambapy/bindings/legacy.cpp:52:26: is

    warnings.attr("warn")(total_message, builtins.attr("DeprecationWarning"), py::arg("stacklevel") = 2);

This is all way above me - hopefully some C++ expert can chime in here.


[1] - https://src.fedoraproject.org/rpms/libmamba/pull-request/2


I think we definitely have something strange going on here, though wether it is in pybind11, or libmamba I cannot tell. If I disable -Werror and go on to build the deps, I start to see python abort() in one of the tests for conda.

The stack strace starts with:

tests/core/test_solve.py::test_force_remove_1[libmamba] Fatal Python error: Aborted

Thread 0x00007fc1cd12e6c0 (most recent call first):
  File "/usr/lib64/python3.13/socket.py", line 295 in accept
File "/usr/lib/python3.13/site-packages/pytest_rerunfailures.py", line 440 in run_server
  File "/usr/lib64/python3.13/threading.py", line 992 in run
  File "/usr/lib64/python3.13/threading.py", line 1041 in _bootstrap_inner
  File "/usr/lib64/python3.13/threading.py", line 1012 in _bootstrap

Current thread 0x00007fc2374bfbc0 (most recent call first):
File "/usr/lib/python3.13/site-packages/conda_libmamba_solver/solver.py", line 891 in _conda_spec_to_libmamba_spec File "/usr/lib/python3.13/site-packages/conda_libmamba_solver/solver.py", line 409 in _specs_to_request_jobs File "/usr/lib/python3.13/site-packages/conda_libmamba_solver/solver.py", line 356 in _solve_attempt File "/usr/lib/python3.13/site-packages/conda_libmamba_solver/solver.py", line 307 in _solving_loop
...

So I added a print to that:

def _conda_spec_to_libmamba_spec(self, spec: MatchSpec) -> LibmambaMatchSpec: print(f'_conda_spec_to_libmamba_spec: parsing {str(spec)}', file=sys.stderr)
        return LibmambaMatchSpec.parse(str(spec))

and I see:

_conda_spec_to_libmamba_spec: parsing numpy 1.7.1 py27_0

which seems pretty innocuous.  If I then run in gdb I see:

#4 0x00007ffff440b0c2 in std::__glibcxx_assert_fail (file=file@entry=0x7fff87946368 "/usr/include/c++/15/string_view", line=line@entry=260, function=function@entry=0x7fff87946f80 "constexpr const std::basic_string_view<_CharT, _Traits>::value_type& std::basic_string_view<_CharT, _Traits>::operator[](size_type) const [with _CharT = char; _Traits = std::char_traits<char>; const_r"..., condition=condition@entry=0x7fff8793d827 "__pos < this->_M_len")
    at ../../../../../libstdc++-v3/src/c++11/assert_fail.cc:41
41          abort();
(gdb) up
#5 0x00007fff87615b75 in std::basic_string_view<char, std::char_traits<char> >::operator[](unsigned long) const [clone .part.0] [clone .lto_priv.0] [clone .lto_priv.0] (__pos=<optimized out>, this=<optimized out>, this=<optimized out>, __pos=<optimized out>) at /usr/include/c++/15/string_view:260
260             __glibcxx_assert(__pos < this->_M_len);
(gdb) up
#6 0x00007fff876198fe in std::basic_string_view<char, std::char_traits<char> >::operator[] (this=<optimized out>, __pos=<optimized out>, this=<optimized out>,
    __pos=<optimized out>) at /usr/include/c++/15/bits/basic_string.h:410
410               __throw_length_error(__N(__s));
(gdb) up
#7  mamba::specs::MatchSpec::parse (
str='\000' <repeats 112 times>, "\360\266\377\377\377\177\000\000\001\000\000\000\000\000\000\000*", '\000' <repeats 15 times>, "\020\267\377\377\377\177\000\000\001\000\000\000\000\000\000\000*", '\000' <repeats 39 times>...) at /usr/src/debug/libmamba-2.0.6-2.fc43.x86_64/libmamba/src/specs/match_spec.cpp:508 508 if (const auto idx = str.find('#'); idx != std::string::npos && str[idx - 1] == ' ')

at which point I seem to have garbage.

505 auto MatchSpec::parse(std::string_view str) -> expected_parse_t<MatchSpec>
506         {
507 // Remove comments, i.e. everything after ` #` (space included) 508 if (const auto idx = str.find('#'); idx != std::string::npos && str[idx - 1] == ' ')
509             {
510                 str = str.substr(0, idx);
511             }


(gdb) up
#8 0x00007fff87b2e57b in pybind11::detail::argument_loader<std::basic_string_view<char, std::char_traits<char> > >::call_impl<tl::expected<mamba::specs::MatchSpec, mamba::specs::ParseError>, tl::expected<mamba::specs::MatchSpec, mamba::specs::ParseError> (*&)(std::basic_string_view<char, std::char_traits<char> >), 0ul, pybind11::detail::void_type>(tl::expected<mamba::specs::MatchSpec, mamba::specs::ParseError> (*&)(std::basic_string_view<char, std::char_traits<char> >), std::integer_sequence<unsigned long, 0ul>, pybind11::detail::void_type&&) && (this=0x7fffffffb910, f=<optimized out>) at /usr/include/pybind11/cast.h:1631 1631 return std::forward<Func>(f)(cast_op<Args>(std::move(std::get<Is>(argcasters)))...);
(gdb) print *this
$5 = {static kwargs_pos = -1, static args_pos = -1, static arg_names = {text = "{str}"}, argcasters = std::tuple containing = { [0] = {<pybind11::detail::string_caster<std::basic_string_view<char, std::char_traits<char> >, true>> = {value = "numpy 1.7.1 py27_0"}, <No data fields>}}}




valgrind doesn't show any issues that I can see.


Well, it doesn't appear to gcc 15 related as I can reproduce the same issue in F41.



--
Orion Poplawski
he/him/his  - surely the least important thing about me
IT Systems Manager                         720-772-5637
NWRA, Boulder/CoRA Office             FAX: 303-415-9702
3380 Mitchell Lane                       or...@nwra.com
Boulder, CO 80301                 https://www.nwra.com/
--
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to