Bug 2162662

Summary: dnf5 builddep crashed when downloading packages: libdnf::cli::progressbar::ProgressWidget::to_string() caused length_error exception
Product: [Fedora] Fedora Reporter: Petr Pisar <ppisar>
Component: dnf5Assignee: rpm-software-management
Status: NEW --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 38CC: amatej, jkolarik, jpazdziora, nsella, pkratoch, rpm-software-management
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Pisar 2023-01-20 12:33:27 UTC
I performed with dnf5-5.0.4-2.fc38.x86_64:

# dnf5 --disablerepo=rawhide --enablerepo=f38-build builddep /home/test/fedora/perl-WWW-Curl/perl-WWW-Curl.spec

and when downloading a 3rd package, it crashed. I retried the command and it succeeded. Maybe related to bug #2149379.

This is a backtrace from a core captured by coredumpctl:

(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007fd3826b0363 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007fd38265e056 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007fd38264787c in __GI_abort () at abort.c:79
#4  0x00007fd3828a4d39 in __gnu_cxx::__verbose_terminate_handler() [clone .cold] () at /lib64/libstdc++.so.6
#5  0x00007fd3828b4fec in __cxxabiv1::__terminate(void (*)()) () at /lib64/libstdc++.so.6
#6  0x00007fd3828b5057 in  () at /lib64/libstdc++.so.6
#7  0x00007fd3828b52b8 in  () at /lib64/libstdc++.so.6
#8  0x00007fd3828a7755 in std::__throw_length_error(char const*) () at /lib64/libstdc++.so.6
#9  0x00007fd38302c6a9 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)
    (this=0x7fffcc4090b0, __old_capacity=0, __capacity=<synthetic pointer>: <optimized out>) at /usr/include/c++/13/bits/basic_string.tcc:140
#10 std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct(unsigned long, char) (this=0x7fffcc4090b0, __n=18446744073709551615, __c=61 '=')
    at /usr/include/c++/13/bits/basic_string.tcc:258
#11 0x00007fd383032ef2 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string<std::allocator<char> >(unsigned long, char, std::allocator<char> const&)
    (__a=<optimized out>, __c=61 '=', __n=<optimized out>, this=0x7fffcc4090b0, this=<optimized out>, __n=<optimized out>, __c=<optimized out>, __a=<optimized out>)
    at /usr/include/c++/13/bits/basic_string.h:659
#12 libdnf::cli::progressbar::ProgressWidget::to_string[abi:cxx11]() const (this=<optimized out>) at /usr/src/debug/dnf5-5.0.4-2.fc38.x86_64/libdnf-cli/progressbar/widgets/progress.cpp:51
#13 0x00007fd38303589e in libdnf::cli::progressbar::DownloadProgressBar::to_stream(std::ostream&) (this=0x7fffcc409df8, stream=...)
    at /usr/src/debug/dnf5-5.0.4-2.fc38.x86_64/libdnf-cli/progressbar/download_progress_bar.cpp:173
#14 0x00007fd38302e6dc in libdnf::cli::progressbar::operator<<(std::ostream&, libdnf::cli::progressbar::DownloadProgressBar&) (stream=..., bar=<optimized out>)
    at /usr/src/debug/dnf5-5.0.4-2.fc38.x86_64/libdnf-cli/progressbar/download_progress_bar.cpp:64
#15 0x00007fd383039134 in libdnf::cli::progressbar::operator<<(std::ostream&, libdnf::cli::progressbar::MultiProgressBar&) (stream=..., mbar=...)
    at /usr/src/debug/dnf5-5.0.4-2.fc38.x86_64/libdnf-cli/progressbar/multi_progress_bar.cpp:162
#16 0x000055caea1c70b4 in libdnf::cli::progressbar::MultiProgressBar::print() (this=<optimized out>) at /usr/src/debug/dnf5-5.0.4-2.fc38.x86_64/include/libdnf-cli/progressbar/multi_progress_bar.hpp:43
#17 dnf5::(anonymous namespace)::DownloadCB::progress(double, double) (this=<optimized out>, total_to_download=<optimized out>, downloaded=<optimized out>)
    at /usr/src/debug/dnf5-5.0.4-2.fc38.x86_64/dnf5/context.cpp:306
#18 0x00007fd3822e7da6 in lr_progresscb (ptr=0x55caeaf27170, total_to_download=<optimized out>, now_downloaded=<optimized out>, total_to_upload=<optimized out>, now_uploaded=<optimized out>)
    at /usr/src/debug/librepo-1.15.1-1.fc38.x86_64/librepo/downloader.c:444
#19 0x00007fd381e8b4f8 in Curl_pgrsUpdate (data=data@entry=0x55caeb1f7560) at ../../lib/progress.c:603
#20 0x00007fd381e8bc04 in multi_runsingle (multi=multi@entry=0x55caeae7ac40, nowp=nowp@entry=0x7fffcc4096b0, data=data@entry=0x55caeb1f7560) at ../../lib/multi.c:2633
#21 0x00007fd381e8f08e in curl_multi_perform (multi=0x55caeae7ac40, running_handles=running_handles@entry=0x7fffcc409830) at ../../lib/multi.c:2690
#22 0x00007fd3822ede62 in lr_perform (err=0x7fffcc409838, dd=0x7fffcc409880) at /usr/src/debug/librepo-1.15.1-1.fc38.x86_64/librepo/downloader.c:2568
#23 lr_download (targets=<optimized out>, failfast=<optimized out>, err=0x7fffcc409b88) at /usr/src/debug/librepo-1.15.1-1.fc38.x86_64/librepo/downloader.c:2743
#24 0x00007fd3822fd91c in lr_download_packages (targets=<optimized out>, flags=LR_PACKAGEDOWNLOAD_FAILFAST, err=0x7fffcc409b88) at /usr/src/debug/librepo-1.15.1-1.fc38.x86_64/librepo/package_downloader.c:422
#25 0x00007fd382d27128 in libdnf::repo::PackageDownloader::download(bool, bool) (this=this@entry=0x7fffcc409d60, fail_fast=fail_fast@entry=true, resume=resume@entry=true)
    at /usr/src/debug/dnf5-5.0.4-2.fc38.x86_64/libdnf/repo/package_downloader.cpp:149
#26 0x000055caea1cac69 in dnf5::download_packages(std::vector<libdnf::rpm::Package, std::allocator<libdnf::rpm::Package> > const&, char const*) (packages=<optimized out>, dest_dir=<optimized out>)
    at /usr/src/debug/dnf5-5.0.4-2.fc38.x86_64/dnf5/context.cpp:433
#27 0x000055caea1cdec9 in dnf5::download_packages(libdnf::base::Transaction&, char const*) (transaction=<optimized out>, dest_dir=0x0) at /usr/src/debug/dnf5-5.0.4-2.fc38.x86_64/dnf5/context.cpp:453
#28 0x000055caea1d22ce in dnf5::Context::download_and_run(libdnf::base::Transaction&) (this=0x7fffcc40a5c0, transaction=...) at /usr/src/debug/dnf5-5.0.4-2.fc38.x86_64/dnf5/context.cpp:799
#29 0x000055caea175b73 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/include/c++/13/bits/unique_ptr.h:200

Comment 1 Ben Cotton 2023-02-07 15:06:01 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.

Comment 2 Jan Pazdziora 2023-06-27 14:19:12 UTC
How did you even manage to get builddep to do something (albeit then crash)? On current rawhide it seems to be completely missing or broken: bug 2217933.

Comment 3 Petr Pisar 2023-06-27 14:29:10 UTC
You need to install dnf5-plugins package.