FS#79847 - [android-tools] Fastboot terminating with an std::out_of_range exception
Attached to Project:
Arch Linux
Opened by Nathaniel Barragan (NateDogg1232) - Wednesday, 04 October 2023, 00:26 GMT
Last edited by Toolybird (Toolybird) - Wednesday, 04 October 2023, 06:00 GMT
Opened by Nathaniel Barragan (NateDogg1232) - Wednesday, 04 October 2023, 00:26 GMT
Last edited by Toolybird (Toolybird) - Wednesday, 04 October 2023, 06:00 GMT
|
Details
Description:
When flashing using fastboot this error occurs: ``` terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::compare: __pos (which is 464) > this->size() (which is 0) Aborted (core dumped) ``` After looking into the backtrace, this seems to happen at `copy_avb_footer` in fastboot.cpp:1214 This bug does NOT happen with platform tools downloaded straight from the Android SDK (I got it using Android Studio). Additional info: * package version(s): 34.0.4-2 * config and/or log files etc.: N/A. * link to upstream bug report, if any: There *seems* to be one here, but it's dead. https://issuetracker.google.com/issues/284335462 Steps to reproduce: Get any sort of fastboot image Flash that to a specific partition In my case, this was: $ adb reboot bootloader $ fastboot flash userdata asteroid-image-bass.ext4 $ # Error here |
This task depends upon
Closed by Toolybird (Toolybird)
Wednesday, 04 October 2023, 06:00 GMT
Reason for closing: Duplicate
Additional comments about closing: Merged into FS#79685
Wednesday, 04 October 2023, 06:00 GMT
Reason for closing: Duplicate
Additional comments about closing: Merged into
Please post a backtrace containing debug information [1][2]. It's usually as simple as:
$ coredumpctl gdb (then answer y when it asks "Enable debuginfod for this session?")
(gdb) set logging enabled
(gdb) bt (or bt full)
Then post gdb.txt
See also
FS#79685. A comment there mentions possible cause as -Wp,-D_GLIBCXX_ASSERTIONS. Please try recompiling the pkg with that removed from CFLAGS and see if it still crashes?[1] https://wiki.archlinux.org/title/Debugging/Getting_traces
[2] https://blogs.gnome.org/mcatanzaro/2021/09/18/creating-quality-backtraces-for-crash-reports/
I set CXXFLAGS to be my default CXXFLAGS without those two, and that worked perfectly.
The CXX flags that were set are as follows:
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection"
It likely explains why the Android SDK version doesn't crash, but it still suggests the upstream code is buggy and needs to be fixed. Just papering over asserts is no proper solution. Please report it upstream. I'll merge this into the other ticket because it seems to be the same root cause.