autopkgtests fail with 4.9-1build1

Bug #2051695 reported by Pushkar Kulkarni
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ccache (Ubuntu)
Fix Committed
Undecided
Pushkar Kulkarni

Bug Description

An existing test started dumping a core causing autopkgtests to fail with the 4.9-1build1 which is currently in noble proposed(universe). This happens because some changes that went upstream between versions 4.8.3 and 4.9.1, specifically this commit [1], cause the test to crash with SIGABRT when a Url::build_error() exception is raised.

[1] https://github.com/ccache/ccache/commit/829f93c48f2141f4c88f094ae82f728409ecb8d7

Revision history for this message
Pushkar Kulkarni (pushkarnk) wrote :
description: updated
Revision history for this message
Pushkar Kulkarni (pushkarnk) wrote :
Download full text (5.7 KiB)

The stack causing the runtime error:

-----

#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
#1 __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3 0x00007ffff7842866 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4 0x00007ffff78268b7 in __GI_abort () at ./stdlib/abort.c:79
#5 0x00007ffff7ca4f06 in __gnu_cxx::__verbose_terminate_handler ()
    at ../../../../src/libstdc++-v3/libsupc++/vterminate.cc:95
#6 0x00007ffff7cb6e6c in __cxxabiv1::__terminate (handler=<optimized out>)
    at ../../../../src/libstdc++-v3/libsupc++/eh_terminate.cc:48
#7 0x00007ffff7cb6ed7 in std::terminate () at ../../../../src/libstdc++-v3/libsupc++/eh_terminate.cc:58
#8 0x00007ffff7cb7138 in __cxxabiv1::__cxa_throw (obj=<optimized out>,
    tinfo=0x55555587b208 <typeinfo for Url::build_error>, dest=0x55555574e094 <Url::build_error::~build_error()>)
    at ../../../../src/libstdc++-v3/libsupc++/eh_throw.cc:98
#9 0x000055555574cf62 in Url::build_url (this=0x7fffffffc870)
    at /home/pushkarnk/work/24/sprint3/+1/ccache/upstream/ccache/src/third_party/url.cpp:871
#10 0x00005555556178aa in Url::str[abi:cxx11]() const (this=0x7fffffffc870)
    at /home/pushkarnk/work/24/sprint3/+1/ccache/upstream/ccache/src/third_party/url.hpp:51
#11 0x0000555555613938 in storage::get_redacted_url_str_for_logging (url=...)
    at /home/pushkarnk/work/24/sprint3/+1/ccache/upstream/ccache/src/storage/Storage.cpp:330
#12 0x0000555555613b29 in storage::Storage::get_remote_storage_config_for_logging[abi:cxx11]() const (this=0x7fffffffd8a8)
    at /home/pushkarnk/work/24/sprint3/+1/ccache/upstream/ccache/src/storage/Storage.cpp:342
#13 0x000055555557d58d in operator() (__closure=0x7fffffffcf50, key="remote_storage", value="http://foo@",
    origin="environment") at /home/pushkarnk/work/24/sprint3/+1/ccache/upstream/ccache/src/ccache.cpp:2226
#14 0x0000555555586b4b in std::__invoke_impl<void, initialize(Context&, char const* const*, bool)::<lambda(const std::string&, const std::string&, const std::string&)>&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&>(std::__invoke_other, struct {...} &) (__f=...)
    at /usr/include/c++/13/bits/invoke.h:61
#15 0x0000555555586505 in std::__invoke_r<void, initialize(Context&, char const* const*, bool)::<lambda(const std::string&, const std::string&, const std::string&)>&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >--Type <RET> for more, q to quit, c to continue without paging--
&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&>(struct {...} &) (__fn=...) at /usr/include/c++/13/bits/invoke.h:111
#16 0x00005555555857fc in std::_Function_handler<void(const std::_...

Read more...

description: updated
Revision history for this message
Pushkar Kulkarni (pushkarnk) wrote :

The new failure path starts in get_remote_storage_config_for_logging() where storage::get_redacted_url_str_for_logging() is now invoked.

storage()::get_remote_storage_config_for_logging()
 |
 storage::get_redacted_url_str_for_logging()
  |
  Url::str()
   |
    Url::build_url()
     |
     throw Url::build_error

Though the Url::build_error is legit, whether it should be caught is a question. Or rather, is not catching it an upstream bug?

Interestingly, the autopkgtests pass, but still fail. This is because "Aborted (core dumped)" starts appearing on stderr.

---
820s PASSED <<<<<<<<<
821s autopkgtest [19:49:21]: test run-testsuites: -----------------------]
821s autopkgtest [19:49:21]: test run-testsuites: - - - - - - - - - - results - - - - - - - - - -
821s run-testsuites FAIL stderr: /tmp/autopkgtest.b0jEpT/build.bnS/src/test/suites/remote_url.bash: line 5: 23875 Aborted (core dumped) $CCACHE_COMPILE -c test.c 2> stderr.log <<<<<<<<<
---

Revision history for this message
Pushkar Kulkarni (pushkarnk) wrote :

I think we can bypass this by adding "Restrictions: allow-stderr", but the larger question is if ccache should have caught this exception. I don't have an answer to that yet.

Changed in ccache (Ubuntu):
assignee: nobody → Pushkar Kulkarni (pushkarnk)
description: updated
Revision history for this message
Pushkar Kulkarni (pushkarnk) wrote :

I am not very sure if the upstream behavior qualifies for a bug report. I hence started a discussion [1].

[1] https://github.com/ccache/ccache/discussions/1390

Revision history for this message
Dan Bungert (dbungert) wrote :

Thanks Pushkar, nice work on this so far.
Looks like upstream has a better version of the fix, I'd be more comfortable with that version.
https://github.com/ccache/ccache/commit/69def064cbf99a8987a7c7736a3d1894d3a11e2c

I suggest pulling in that fix as a patch rather than adjusting the ADT restrictions. What do you think?

Revision history for this message
Pushkar Kulkarni (pushkarnk) wrote (last edit ):

Thanks for reviewing, Dan.

Upstream did a new release 4.9.1 and so did the Debian package 4.9.1-1 (Joel Rosdahl is the maintainer for both) [1].

I guess its just the matter of a sync now. I'll probably close the MP and keep the bug open until the sync happens.

[1] https://salsa.debian.org/debian/ccache/-/blob/master/debian/changelog?ref_type=heads#L1

Revision history for this message
Dan Bungert (dbungert) wrote :

OK, a sync is a good plan. Autosync should handle that.
Removing sponsors.

Changed in ccache (Ubuntu):
status: New → Fix Committed
Revision history for this message
Dan Bungert (dbungert) wrote :

Manually synced.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.