16 ms·
A photo is crashing some Android phones
- chooseaname 6y agoArticle says crash, not brick. Brick is not recoverable.
- Hamuko 6y agoSoft bricks can be recovered from.
- jessriedel 6y agoI hadn't heard the term "soft brick" before, and if you Google it all the top results are about this.
- Semaphor 6y ago"soft brick" is commonly used on XDA.
- jessriedel 6y agoIs it a term that's usually only applied to androids?
- 4cao 6y agoNot really, it's used for example with OpenWRT too: site:openwrt.org "soft-brick" - 213 results
- wyldfire 6y ago'brick' in general is a sliding scale based on how many device debug/recovery tools you have access to and how much device disassembly you're willing to tolerate.
- eghad 6y agoNo, iOS devices can also soft-brick, it's just a general term. Most often people encounter the term in relation to hacking/rooting hardware, like a Nintendo DS/Switch for instance. Hitting up Wikipedia or Trends can help you dig through its usage considering how Google's search algo heavily biases current events wrt relevance.
- chooseaname 6y agoNeither the article nor the headline say soft brick. Besides, "soft brick" is just someone not wanting to admit that brick has an understood definition but they like the word brick and want to use it.
- CathedralBorrow 6y agoDoes brick have an understood definition though? I think this is the millionth time I see this exact discussion about a news story using the term differently from the one true definition. That doesn't seem very understood to me.
- parliament32 6y agoWell, yeah. "Brick", as in a paperweight, as in it's dead for good, forever. It's in the word.
- stOneskull 6y agodiscussions must be had. it's one of those sesame street stories anyway; they want to use tech lingo with the kids.
- mhh__ 6y agoIt's so rare these days I really don't understand why people fuss over the definition. It's almost impossible to brick anything with software, and even in hardware unless you damage the PCB itself you can usually recover if you tried hard enough (e.g. Even if you fry a $1500 FPGA you could technically reflow a new one and pray the bitstream is OK if you need it fixed now - although I'd rather you than me)
- OJFord 6y agoTechnically you could also lay out new components and copper trace on an actual brick, too. I've always understood it to mean 'broken beyond software or high-level firmware repair'. i.e. if not actually a blown component, something needs to be reflashed which has an inaccessible JTAG header or something, rather than something 'higher level' like recovery images over ADB & USB.
- deleted 6y ago[deleted]
- asveikau 6y agoBut the article also says if you set it as your wallpaper, you cannot get past the lock screen, which I am guessing is because it crashes again loading or rendering the wallpaper. So maybe you could boot with a key combination and reset the phone, but it's pretty close to bricking.
- gruez 6y agoSome users report that it soft-bricked their phones (ie. they had to factory reset their device). Others were able to recover it by either deleting the wallpaper from TWRP, or pressing a sequences of keys to take a picture and set that as the wallpaper (apparently for them only the display was broken, everything else worked(.
- G4E 6y agoIt's described as crashing in loop, even on restart. For people who don't know how to reflash/wipe from recovery, it render their phone useless, so as well as bricked. I'm curious to see the post-mortem on this one, i'd guess a bug in the libjpg used in android, and a malformat in the encodibg of the picture ?
- ehsankia 6y agoFrom my understanding, if it happens once, it's a crash, if it keeps rebooting it's a brick. If it can be recovered it's a soft-brick, otherwise it's a hard-brick.
- neunnech 6y agoAnother commenter agrees with you, writing: > it soft-bricked their phones (ie. they had to factory reset their device) But the whole point of coming up with the word "brick" was to describe the set of scenarios where even things like factory reset won't work. This is "literally" all over again.
- ehsankia 6y agoBut even with a hard brick (where it's "literally a brick"), you can sometimes bring it back to life by opening the device and swapping a component or soldering something. I like soft vs hard brick, because it connects to software and hardware. With a soft brick, the device is basically a brick until you reset the software. With a hard brick, it requires potentially a hardware fix.
- Polylactic_acid 6y agoThe thing is there is always more levels of bricked. Usually people refer to bricked as being unrecoverable through the usb flashing methods but there is usually a way to open up the device and flash the nand chip back to a working state. So its bricked in the perspective of a user but not for someone with electronics experience.
- dang 6y agoWe've changed the title to sidestep this. The word 'brick' is up there with 'doxx' on the list of curiously provocative words that people will strongly protest if you use them wrong, yet aren't exactly well defined. Not as high on the list as 'doxx' though. 'Troll' is on that list too.
- wheelsAndWheels 6y agoWiping, not bricking. Probably an undisclosed zero day, intended to backdoor, had been deployed to exploit the handsets of looting rioters (eh, peaceful protestors), and so this is a counter-leak by malories to disarm its effectiveness and promote wariness of possible malware.
- AdmiralAsshat 6y agoGranted we understand "brick" to mean the device cannot boot, but this comes pretty damn close on some phones, it seems. > "After setting the image in question as a wallpaper, the phone immediately crashed. It attempted to reboot, but the screen would constantly turn on and off, making it impossible to pass the security screen," he noted. > Restarting the device in safe mode (by holding down the volume button during boot-up) did not fix the issue." If restarting doesn't fix it, and not even safe mode will allow you to change the wallpaper to get around it, what method of recovery is left for the affected user? Factory reset from recovery mode?
- el_programmador 6y agoPerhaps the only way to fix it would be get into fastboot mode and enable USB debugging, then look for that arcane settings file on the file-system which your OEM decided to use for configuring wall-papers and fix that file. I see no other way.
- zozbot234 6y agoWouldn't that settings file be on the user data partition, which is encrypted and thus not normally accessible in recovery mode?
- zozbot234 6y agoIt depends. If the bootloader is unlocked, they could boot a custom recovery and alter the system image to try and insert a workaround (such as deleting the buggy library and dealing with the resulting breakage). If the data partition is fully unencrypted, they can even delete the offending file straight from recovery. On a bootloader-locked, fully encrypted device (the default nowadays) they'd be SOL and have to use the stock recovery or bootloader to force a factory reset - not only would that involve obvious data loss, but they would even have to deal with FRP afterwards.
- f1refly 6y agoYou can also delete the offending file with a fully encrypted main storage, since twrp supports decrypting and mounting the storage on demand.
- neltnerb 6y agoI'm looking at this title and totally not willing to click on it... they don't include the actual photo I would hope.
- jasona99 6y agoThe tweet that contains the image is included. You must set the photo as your phone's background for it to have any effect, so it is safe to click.
- Al-Khwarizmi 6y agoThey do, although they say the bug only happens if you set it as wallpaper. I wouldn't click from a phone just in case, though.
- bzb3 6y agoI clicked it from one of the affected phones and nothing happened. Saved it, looked at it from the gallery... Nothing. Seems like the crash is in some wallpaper-related code: https://news.ycombinator.com/item?id=23404772 https://news.ycombinator.com/item?id=23404772
- jasona99 6y agoI actually looked into this when I saw it in the original tweet. I tried with a current Android 10 emulator, crashed SystemUI. Tried with the latest build of AOSP, was a-ok. Whatever the issue was, looks like it got resolved already in either the Android color library or the ImageProcessHelper for the wallpaper (the piece of code that was initially crashing with an out of bounds error). I haven't spent much time looking into exactly when/where it was fixed, though. Quick edit to add that, despite this, I do not believe those changes have made their way into most devices. It seems the error stemmed from the possibility of returning a value over 255 when a histogram was calculated from the addition of color values. As stated in the article, this seemed to result from the use of the Skia color profile in particular. I do not know about other color profiles. The code mentioned by gruez was what I got when the emulator was crashing.
- wheelie_boy 6y agoThis could explain why it might not have shown up in testing. It's not just that the image had a non-sRGB colorspace, it's also that the pixel values in this specific image were out of the expected range.
- jfkebwjsbx 6y ago"Out of expected range" values should be the very first thing to test for...
- OJFord 6y agoAnd maybe it was; maybe the colour space aspect also was. Testing combinations of edges is not so common/obvious.
- arprocter 6y agoCould you apply the bugged profile to any image and cause the crash? GIMP sees it as a JFIF (apparently a predecessor to EXIF) with "Google/Skia/E3CADAB7BD3DE5E3436874D2A9DEE126 Copyright: Google Inc. 2016"
- panpanna 6y agoTL;DR: color profile in the metadata could not be interpreted by some phones. When you set that picture as your background it can cause your home screen to hang. Samsung fixed this with an extremely eraly June security update. I think it took less than a week.
- winter_blue 6y agoI wonder if Samsung will release this security update for phones released 3 or 4 years ago...
- panpanna 6y agoThis was not a real security issue, but in general they update even old flagship devices for critical security issue. IIRC, last time they had a really bad bug they updated some 4-5 year old Notes.
- gruez 6y agoRelevant code in AOSP: https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-10.0.0_r35/packages/SystemUI/src/com/android/systemui/glwallpaper/ImageProcessHelper.java#134 https://android.googlesource.com/platform/frameworks/base/+/...
- zelos 6y agoAnd the comment in Color.java: * @return A float value with a range defined by the specified color's color space
- jeffbee 6y agoUsing the sum of three floats to index an array?
- Zenbit_UX 6y agoWhat could go wrong!
- jeffbee 6y agoIt looks like this comment is not right. There is: public static int blue (int color) Anyway this thing has range [0, 255] and adding three of them together as an index of an int[256] doesn't seem like it would ever work regardless of the colorspace.
- mtklein 6y agoRed, green, and blue have been scaled by .2126, .7152, and .0722, which add up to 1.0 exactly (even in single-precision float), and if those values really were all in [0,255] range, the maximum value that could be produced by this math is only 254, due to rounding. I think what's happening here is that the image is in a format that's holding those original red, green, and blue values in a format that can hold values outside logical [0,1]. Update: sorry, the comment below me doesn't seem to have a 'respond' link so I'll just edit one in here. I totally agree with you it's good practice to document your invariants in code, but in practice it would result in the same thing... an unhandled failure with nothing better to do than crash the process. In a way (if you squint) indexing into an array of size 256 is itself documenting the invariant that the index is less than 256. It's just that the invariant itself is wrong.
- sp332 6y agoAccording to the linked theory from @evowizz, any photo with an unsupported colorspace would cause this issue. Seems like someone would have noticed before? Maybe in QA or at least during a beta instead of 9 months after launch?
- VWWHFSfQ 6y agobut they didn't notice
- gruez 6y ago>Seems like someone would have noticed before Apparently not, and it's not too surprising either. The only way such a photo would get on is either through the on-device camera, or downloaded from the internet. The former seems most likely, considering that most picture sharing sites probably normalize/sanitize/recompress whatever their users upload. Are there any android phones that produce HDR (ie. 10 bit color, not the effect that's commonly available) pictures?
- panpanna 6y agoWhat you see right now is the normal Google QA process. They have literally billions of beta testers, who are even paying for the privilege.
- searchableguy 6y agoPeople did - https://issuetracker.google.com/issues/76022479 https://issuetracker.google.com/issues/76022479 (2018)
- Someone 6y ago“Restarting the device in safe mode (by holding down the volume button during boot-up) did not fix the issue.” So, lesson learned: in safe mode, do not use a background image that the user set.
- organsnyder 6y agoHa. Perhaps I'm misremembering, but I think I remember this behavior (not using the user background in safe mode) back in Windows 95.
- ProAm 6y ago“The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.” - Robert Jordan
- nzgrover 6y ago"And some things that should not have been forgotten were lost. History became legend. Legend became myth. And for two and a half thousand years, the ring passed out of all knowledge." - Tolkien
- berkes 6y agoUnexpected diss to Robert Jordan for being a copycat. I love both (I'm one of the few who wrestled through the entire WoT twice and enjoyed that) but your citation shows very pointedly how Jordan was often just copying LoTR.
- ProAm 6y agoI think they both just copied the idiom that history will repeat itself.
- ry_co 6y agoI'm fairly confident that Tolkein didn't write that. It's the prologue to the Fellowship of the Ring movie, and not in the text, as far as I'm aware. So maybe Jordan is actually the one who got ripped off. Still though, pretty cliché idea, but the formulation is too close to not be influenced one way or another.
- mister_hn 6y agoBricking? I would say that a wipe can fix it.
- McDev 6y agoCuriosity (stupidity?) got the better of me and I ended up awake until 2am fixing this last night on my Pixel 3a. I was fortunate enough to have developer mode & USB debugging enabled, which allowed me to install some code to clear the wallpaper using the WallpaperManager [0]. Sadly it wasn't as simple as pushing the code to the phone and running a command to execute it. When the device boots, it would crash _almost_ instantly and reboot into recovery mode after attempting to show the wallpaper a few times. This meant I couldn't put my passcode in, which meant Android refused to run the application I made to clear the wallpaper. The ADB (Android Debug Bridge) tool [1] lets you replicate user input for the connected device, so you can basically swipe the screen / enter keys from the command line. I was able to use ADB to swipe up on the lock screen and enter my passcode. This was a start but wasn't enough, as the crash was happening before the wallpaper deleting app could be started. I figured the unlock process was taking too much time, and found out after Android 8 (Oreo) you can actually use ADB to change or remove your passcode [2], provided you know your existing passcode. After I removed my passcode I was able to reboot the device, and run a single ADB command to swipe up on the screen and delete that cursed wallpaper. And no it wasn't worth it, but I enjoyed the challenge [0]. https://developer.android.com/reference/android/app/WallpaperManager https://developer.android.com/reference/android/app/Wallpape... [1]. https://developer.android.com/studio/command-line/adb https://developer.android.com/studio/command-line/adb [2]. https://android.stackexchange.com/a/194779 https://android.stackexchange.com/a/194779
- yumraj 6y agoYou may want to write a blog post on how to recover so that others may benefit from your experience.
- parliament32 6y agoCrashing, not bricking. Can we update the title to remove the editorialization?
- deleted 6y ago[deleted]
- Grazester 6y agoI have no idea why you are being down voted
- ezequiel-garzon 6y agoMy guess: because there is no editorialization here, since the BBC title also says “bricking”. The title must be editorialized if you want to change it. Again, my guess. I used my upvote!
- klyrs 6y agoI've experienced this when suggesting headline edits: get several upvotes by others who agree, dang agrees and changes the title (and folds the thread away, I think to prevent the following...) and then within a few minutes people plink away with the downvotes until it's negative. On one hand it seems like people are downvoting it for being irrelevant... but dang's response seems like it should provide the context to avoid that. Baffling.
- dang 6y agoYes, we've de-baited it now.
- parliament32 6y agoThanks!
- mtklein 6y agoI wrote a lot of the Skia color management code involved here, and I think maybe I can clear some things up? I'd be happy to answer any questions you might have, either here or on https://bugs.chromium.org/p/skia/issues/detail?id=10301 https://bugs.chromium.org/p/skia/issues/detail?id=10301 where we've been trying to think about how much Skia's involved with the root cause of this bug. There's no "Skia color profile" per se. When Skia's asked to write a JPEG from a pixel buffer tagged with a color profile (SkColorSpace), we auto-generate an ICC profile programatically from the parameters that describe the color gamut and transfer functions we use to represent those color profiles. That's what the code in this file is up to: https://source.chromium.org/chromium/chromium/src/+/master:third_party/skia/src/core/SkICC.cpp https://source.chromium.org/chromium/chromium/src/+/master:t... So this profile is one of infinite possible profiles that'll have "Google/Skia/..big long MD5.." somewhere in them. This profile in particular looks like it's probably describing the ProPhoto color space, which is very, very large and uses imaginary colors outside visible light to increase its gamut. While the JPEG itself is always storing values in range in the ProPhoto gamut, when you convert that to another gamut (say, to match the display, or to sRGB) it's very easy to end up with logical color channel values less than zero or greater than one, which do make a kind of sense, but not to code that expects colors are always sRGB bytes. It's unclear to me what gamut the colors being read in that Java code are in, and that'd very much affect what the appropriate values for that LUMINOSITY_MATRIX should be. Those are the correct values to get the luminosity for sRGB colors (though I think what's being calculated here is subtly-different gamma-encoded "luma" instead), but they're not likely a sound way to get luminosity if the image is in any different gamut. A typical strategy is to convert any image you load to the display gamut early, since you'll need to do that eventually to display it. And it's more and more common that phone display gamuts are not sRGB, usually something wider now like Display P3.
- wereHamster 6y agoFrom the Skia bug report: > out of bounds write in Java Isn't Java supposed to be a language safe from these kinds of bugs? At the very worst it throws an exception, which should be caught and dealt with accordingly… How can that crash the whole phone?
- exabrial 6y agoFYI, it is not bricking phones, but that doesn't make a good headline. It is making some of them unusable, requiring a hard reset.
- gitgud 6y ago> It is making some of them unusable, requiring a hard reset. Well that's still a "soft brick" right?
- matchbok 6y agoThe lack of quality control in the Android SDK is pretty impressive. It is by far the worst SDK I've ever used. Hell, even simple think like hiding/showing a keyboard requires a ton of code and checks. In 2020.
- netdur 6y agoI think Android SDK was made with something else in mind, I did read it was made for digital cameras, ironically Android have very bad camera api too, the concept of activity and fragment is just weird... I can say everything there is weird, but definitely not the worst SDK.
- matchbok 6y agoYou're right. It was never designed as a mobile OS with a soft keyboard. Hell, it's 2020 and rotating the device still doesn't work as it should.
- what_ever 6y ago> rotating the device still doesn't work as it should. What exactly is the issue?! Been using Android for about a decade now and can rotate the device just fine.
- matchbok 6y agoYeah so it works, but from a developer perspective it's about 10x more complicated than iOS. It's also a source of bugs and crashes because of how Android manages the state change.
- AnssiH 6y agoFor me, a lot of apps lose various state, e.g. text written in input fields, when rotating.
- pjmlp 6y ago
- surround 6y agoAnother article, which includes the wallpaper in question and the reason why it crashes the phone. https://techxplore.com/news/2020-06-wallpaper-image-android.html https://techxplore.com/news/2020-06-wallpaper-image-android....
- hdjriro 6y agoOpening the picture in Windows Photo Viewer (the old on introduced in Windows 7) throws this error: "Windows Photo Viewer can't display this picture because there might not be enough memory available on your computer." Other Windows included apps, like Paint, Paint3D and Photos open it just fine.
- DudeInBasement 6y agoPaint is like the Notepad of Artwork apps. It can handle anything. If notepad doesn't open it, nothing will.
- deleted 6y ago[deleted]
- TazeTSchnitzel 6y agoRemember those iOS text handling bugs? Fun.
- cristaloleg 6y agoOne more argument why do we need more (and more) fuzzing on a regular basis. Basically everything where we can pass some specially encoded date (read as format or protocol) can be made with bugs and edge cases not covered by test or by intent look (how to say it properly in English? :) So yeah, fuzzing.
- dheera 6y agoI wonder whether it would be a bad idea to have a "dev" mode where exceptions are thrown and a "production" mode of compilation where every single statement is wrapped in a try-catch block with a default behavior. For example: histogram = getHistogram(); should be wrapped automatically in: try { histogram = getHistogram(); } catch(Exception e) { console.log(e.toString()); histogram = DEFAULT_HISTOGRAM; } Something like: y = a / b; should be wrapped in: try { y = a/b; } catch(Exception e) { console.log(e.toString()); y = 1e999; } Wrap every function call like this, and just don't let Java exceptions bring down an entire system in production especially when a lot of the time it's just a petty UI issue. Obviously never do it in development though. But odd UI behavior instead of crashes might make a bunch more users happy which is ultimately what matters.
- nicoburns 6y agoIt seems that all you'd need is a single try-catch around the high-level operation. I inherited a system where all the errors were swallowed and it was a nightmare. If something failed it was impossible to tell why.
- dheera 6y agoYeah, I agree that the developer shouldn't do that in the source code. I'm more thinking of a compilation mode where the system tries to consistently do something just slightly smarter than give up when there is an exception, and that is strictly only for production use. A divide by zero error on a button's width shouldn't cause a spacecraft to give up and abort its mission to the moon. That wouldn't happen, but it's just a figurative description of what I would like. It's ridiculous for an OS to go into a boot loop because of a color histogram. A better behavior would be for the background to be set to an array of NaNs, and the background renderer to fail gracefully to a plain black or white background.
- londons_explore 6y agoFloating point NaN is pretty close to what you're describing for floats only. Really we need some kind of NaN value for all java objects.
- m3at 6y agoTangentially related but that might interest fellow readers, you have multiple ways to make a valid image crash a device, one example being making a png bomb [1]. This is similar to a zip bomb, the file will by expanded to order of magnitude more bytes than its compressed size when opened, which might throw an oom error or fill up the disk quickly. [1] http://www.aerasec.de/security/advisories/decompression-bomb-vulnerability.html http://www.aerasec.de/security/advisories/decompression-bomb...
- perlpimp 6y agoa photo I took on iphone x11 pro crashes my android when trying to set it as a background, wonder if this is related.
- MaxChinni 6y agoCiting a comment I can find anymore: For everyone who tried it and wants to recover phone without clean wipe. remove these files (I did it with twrp) /data/system/users/USER_ID/wallpaper_info.xml /data/system/users/USER_ID/wallpaper_orig /data/system/users/USER_ID/wallpaper it resets your wallpaper to default one
- ganstyles 6y agoOh wow, I set this on my Pixel 3 and started immediately flashing on and off. It reset and allowed me to do a factory reset, and now it works. That’s crazy, don’t do this. To be clear, this was on my old phone not my main phone, so I didn’t mind testing it.
- dqpb 6y agoFun fact, there are also images that can cause some human beings to crash. Namely those that induce gamma oscillations such as black and white bar patterns. It would be interesting to train a generative NN on human EEG response to create images that produce novel or unusual effects on the viewer.
- unexaminedlife 6y agoAdmittedly I haven't been following this story, but now that I see it on HN, am genuinely curious whether they were able to rule out that hardware is involved? Also curious to know if perhaps there are flaws in the image format's spec that are being exploited?
- TheRealPomax 6y agoThe article title is "Android: Why this photo is bricking some phones", which more accurately reflects the experience for the overwhelming majority of affected users. Would be good to update that.
- mbostleman 6y agoIs that Squaretop Mountain in the Wind River Range?
- jonnypotty 6y agoOne of the biggest and most high profile software companies in the world can't reliably read image files on their flagship phone. People are scared of AGI. This sort of shit scares me more.
- Welaa 6y agoBbb.com