Due to an influx of spam, we have had to temporarily disable account registrations. Please write an email to accountsupport@archlinux.org, with your desired username, if you want to get access. Sorry for the inconvenience.
After upgrading android-tools from 34.0.1-3 to 34.0.4-1, "fastboot flash super super.img" doesn't work anymore.
$ fastboot flash super images/super.img
terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::compare: __pos (which is 464) > this->size() (which is 0)
fish: Job 1, 'fastboot flash super images/sup…' terminated by signal SIGABRT (Abort)
This is reproducible every time. Downgrading to the previous version makes it work again.
This doesn't appear to be an Arch packaging issue. You'll likely have better luck reporting the problem upstream. Please let us know what you find out.
Added 2023-10-03 09:38:51 UTC - Commented by q rty (q234rty)
I believe this particular error is enabled by -Wp,-D_GLIBCXX_ASSERTIONS in the devtools makepkg.conf, I guess that flag is not there in google's build system?
This is still present with android-tools-34.0.4-3. I must say my technical skills are very limited. Nevertheless, if downgrading to previous android-tools-33.0.3-3, it fixes my problem. (I don't know at what expense, but for the moment it seems that I can use fastboot as usual).
Can anyone of acknowledge that this issue is still there?
Added 2023-11-10 14:46:51 UTC - Commented by loqs (loqs)
Perhaps upstream might be more interested if a fix was provided. A backtrace would help locating where in the code the assertion is triggered.
Please provide a backtrace that includes debugging information. Please read the following links 13. It's usually as simple as (with gdb installed):
$ coredumpctl gdb (then answer y when it asks "Enable debuginfod for this session?")
(gdb) set logging enabled
(gdb) bt (or bt full)
I encountered this exact issue while running Fairphone's fastboot flash script for my FP5. Attached is the backtrace: fastboot-trace.log
Currently on 6.7.1-zen1-1-zen and using android-tools 34.0.4-3.
Wish I was aware of this bug before trying to flash my phone because now it's bricked... Fairphone doesn't provide its firehose file either so RIP
terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::compare: __pos (which is 496) > this->size() (which is 0)
./flash_new_all.sh: line 54: 246859 Aborted (core dumped) fastboot -S 200M flash rootfs debian/rootfs.img
fastboot --version
fastboot version 34.0.4-android-tools
Installed as /usr/bin/fastboot
When the android-tools package is compiled without the extra flags from makepkg.conf (presumably somewhat similar to how the official platform-tools is built) then flashing continues with the following output:
$ fastboot --verbose flash super super.imgfastboot: verbose: Do flash super super.imgfastboot: verbose: target reported max-download-size of 805306368 bytesWarning: skip copying super image avb footer (super partition size: 6442450944, super image size: 140723775805952).Sending sparse 'super' 1/6 (722560 KB)
diff --git a/PKGBUILD b/PKGBUILDindex 2f17f93..0768c06 100644--- a/PKGBUILD+++ b/PKGBUILD@@ -5,7 +5,7 @@ pkgname=android-tools pkgver=34.0.4 _tag=${pkgver} # https://github.com/nmeum/android-tools sometimes carries extra patch version on top of the upstream versioning-pkgrel=3+pkgrel=4 pkgdesc='Android platform tools' arch=(x86_64) url='http://tools.android.com/'@@ -21,8 +21,8 @@ build() { cmake \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Release \- -DCMAKE_CXX_FLAGS="$CXXFLAGS" \- -DCMAKE_C_FLAGS="$CFLAGS" \+ -DCMAKE_CXX_FLAGS="" \+ -DCMAKE_C_FLAGS="" \ -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON \ -Dprotobuf_MODULE_COMPATIBLE=ON \ -G Ninja -S . -B build
If we look closer at the output, the 140723775805952 cannot be a real size, that's ~127 TiB.
And every time we run it, we get a different "super image size"...
Warning: skip copying super image avb footer (super partition size: 6442450944, super image size: 140725918572192).
Warning: skip copying super image avb footer (super partition size: 6442450944, super image size: 140737306734848).
Warning: skip copying super image avb footer (super partition size: 6442450944, super image size: 140723648418544).
For now it feels like it's more of an accident it works normally due to the code hitting some sort of memory management issue?
But official built android-tools (r34.0.4) don't have this output at all?
Will try to find out more and update this comment.
When one sees random used values in a C/C++ program it is almost always due-to uninitialized memory area. I am looking at the code you shared I see it due to randomness of
@anatolik Yep, seems it's that variable that causes the issue. Opened !2 (closed) with a patch to fix it (tested with the file where it broke for me)
For reference, when built with AOSP tooling, it seems the struct does get initialized automatically (probably some compiler flags)
fastboot: verbose: Do flash super super.imgbuf->sz=0fastboot: verbose: target reported max-download-size of 805306368 bytessz=0 is_logical=0Sending sparse 'super' 1/6 (722560 KB)
So with this =0 the first if in copy_avb_footer is taken and we return from the function without running the rest of the code - which would then crash.
From the upstream ticket it appears Android builds it with -ftrivial-auto-var-init=zero which explains the anomaly. Therefore, we should probably follow suit.