9 ms·
Malloc broke Serenity's JPGLoader, or: how to win the lottery (2021)
- userbinator 2y agoI got Deja Vu upon seeing "Alien Lenna" and sure enough... I've seen and commented on this before: https://news.ycombinator.com/item?id=27374942 https://news.ycombinator.com/item?id=27374942 (2021)
- riedel 2y ago[flagged]
- userbinator 2y ago[flagged]
- leononame 2y agoAfaik, Lena herself said she'd like her image to stop being used as a test image. And IEEE already retired its use. Even if you think it's woke, there's good reason to respect the model's wish
- userbinator 2y agohttps://www.wired.com/story/finding-lena-the-patron-saint-of-jpegs/ https://www.wired.com/story/finding-lena-the-patron-saint-of... Lena doesn’t harbor any resentment toward Sawchuk and his imitators for how they appropriated her image; the only note of regret she expressed was that she wasn’t better compensated. In her view, the photograph is an immense accomplishment that just happened to take on a life of its own. “I’m really proud of that picture,” she said.
- hhh 2y agohttps://www.sfgate.com/news/article/How-a-Nude-Playboy-Photo-Became-a-Fixture-14878319.php https://www.sfgate.com/news/article/How-a-Nude-Playboy-Photo... This is what’s cited on Wikipedia about the cessation of use.
- g15jv2dp 2y agoShe later said she wanted people to stop using the picture. https://finchcompany.com/projects/losing-lena-trailer/ https://finchcompany.com/projects/losing-lena-trailer/ https://www.theguardian.com/technology/2024/mar/31/tech-publisher-bans-playboy-centrefold-test-image-from-its-journals https://www.theguardian.com/technology/2024/mar/31/tech-publ... > Forsén herself has also suggested that the photo should be retired. In 2019, she said she was “really proud” of the picture and she re-created the shot for Wired magazine, which called her “the patron saint of JPEGs”. But later that year, the documentary Losing Lena spearheaded the latest effort to encourage computer science to move on. “I retired from modelling a long time ago,” Forsén said on its release. “It’s time I retired from tech, too. We can make a simple change today that creates a lasting change for tomorrow. Let’s commit to losing me.”
- AlexandrB 2y agoDoesn't it seem weird that she was proud of the picture when interviewed in a neutral context (Wired), but wanted it removed (not very strongly might I add) when interviewed by documentarians making a film with the express purpose of trying to get her picture removed? In the movie quote she even alludes to the title of the film: "Let's commit to losing me". It basically sounds like she gave them the soundbite they wanted.
- g15jv2dp 2y agoWhat's weird here? She can be proud about the picture and think it's a thing of the past that needs to stopped being used.
- Jamie9912 2y agoNot really, if she understood well what the photograph was being used for at the time, you can't retrospectively wish against it. That's like saying Oh I don't want to be a pornstar anymore, take down all my content thanks.
- biorach 2y ago> you can't retrospectively wish against it She absolutely can. And we, collectively, can choose to respect that wish by using a different test image in future. And why not? It's no real burden to make the change.
- petee 2y agoI agree, being a decent person is an active choice we should all strive for. The burden here is that a number of people are so afraid of being "woke" that they'd rather double down being scummy than just find a different jpeg. If it was their daughter I'm sure they'd have a different opinion
- josefx 2y ago> If it was their daughter I'm sure they'd have a different opinion Are we back in the 60s where a father has to sign off on the daughters job application? We are talking about a woman who willingly signed up for a playboy photoshoot, had been aware of the image being used and circulated for decades with no issues.
- biorach 2y ago> Are we back in the 60s where a father has to sign off on the daughters job application Strawnan bs. No one advocated anything like that. > We are talking about a woman who willingly signed up for a playboy photoshoo Yep. And decades later asked it to not be used anymore. You can waste as much time with long winded arguments as you want. Or you could just be decent and not use the image. Your call.
- FeepingCreature 2y agoThe anti-woke, respectful move would be to find another Playboy centerfold.
- account42 2y agoWhy?
- FeepingCreature 2y agoBecause the legitimate argument "it is against the wishes of the model" masks the underlying, foundational but hidden reason, which is "it appeals to the prurient interest of men in women, which I find detestable". Thus, finding another model who both consents to having her picture used but still appeals to the prurient male interest fulfills the stated claim while frustrating the unstated one. I'm sure Naomi Wu would be up for it.
- bowsamic 2y agoWhat do you mean by that word? Does it mean insincere? EDIT: Why the downvotes? I'm genuinely curious. I see the word thrown around a lot but I can't get a grasp on what it means
- tzot 2y agoI assume you were downvoted because downvoters would not believe your question was genuine. It is a fact that in the past groups of people have been ostracized, ignored, paid less, acknowledged less, respected less than today based on their race, gender, sexuality, country, profession etc. This has been raised as an issue and for some years —perhaps decades— a counter-motion has been going on: openly promote/respect/acknowledge people that were previously demoted/non-respected/unacknowledged. The exaggerated examples of these counter-motions are called “woke”. Imagine that we would like to promote the role of ants in the environment because they were largely ignored in the past, so someone makes a movie where an ant beats by sheer physical strength a lion; that would definitely be “woke“. There are cases where people can disagree whether something is “woke”; for example, think a woman who travels in time to a patriarchal society centuries ago where women were considered property and part of the background and yet she acts in an independent, outspoken, audacious way to men around her without anyone punishing her. That could be called “woke”, but it depends on one's sense of exaggeration. Reactions against such exaggerations is called “anti-woke”. A great example IMO of a humorous “anti-woke” statement is the image included in the following link, which is a poster for an imaginary documentary: https://knowyourmeme.com/photos/2440971-netflix https://knowyourmeme.com/photos/2440971-netflix
- amake 2y ago> The exaggerated examples of these counter-motions are called “woke”. This is your definition. I doubt you will find any agreement on what "woke" means, because right-wingers use it to refer to anything and everything that they dislike.
- petee 2y ago[flagged]
- wwoovvo 2y ago[flagged]
- petee 2y ago[flagged]
- amake 2y ago[flagged]
- smcl 2y agoPetee has simply said that we should respect someone’s pretty reasonable preferences. You’ve popped up out of nowhere utterly furious for seemingly very little reason. If this is how you behave I think most of us would far prefer to have Petee as a coworker than you. If you’re having a lot of conflicts with your colleagues about this, the problem might not lie with your colleagues…
- account42 2y ago> Petee has simply said that we should respect someone’s pretty reasonable preferences. That's not an accurate reading of the Petee's post. > I think most of us would far prefer to have Petee as a coworker than you. Speak for yourself.
- cinntaile 2y agoIt's an image used within imaging since the 70s. It's used because everybody uses it. It being part of an old Playboy centerfold isn't the relevant bit here.
- panzi 2y agoWe do it because we always did it is such a great argument.
- ck45 2y agoLena said “Once upon a time, I was the centerfold of Playboy,” says the former model in the new documentary Losing Lena. “But I retired from modeling a long time ago. It’s time I retired from tech, too.” See https://www.sfgate.com/news/article/How-a-Nude-Playboy-Photo-Became-a-Fixture-14878319.php https://www.sfgate.com/news/article/How-a-Nude-Playboy-Photo...
- viraptor 2y agoSometimes we keep doing things because we don't stop and think, but it's good to stop and consider if we should continue or change. "Because we've always done it that way" / "because everyone's doing it" can mask many nasty things we wouldn't start doing if given a completely fresh context.
- cinntaile 2y agoThat's very true, but when looking at all the source materials I don't consider this to be one of those nasty things that absolutely need changing. If I was releasing imaging research or any other kind of publicly accessible data I would not use the image just to avoid the angry mob, but I think this is blown out of proportion.
- timschumi 2y agoApart from the fact that this probably isn't common knowledge, this article is from 2021 (which the OP failed to disclose). Why not be mad at IEEE for a change? They apparently only managed to ban use of the image in April of 2024.
- f33d5173 2y agoWhy kill whimsy? Do malloc bugs need especially serious images, like concrete walls or men in business suits?
- kmeisthax 2y agoThe Lenna image isn't whimsical, it's a cropped nude photo. The people against it don't want image processing to be boring, they want it to be more inclusive. There are hundreds of other whimsical examples that would not be alienating to a good chunk of women.
- cxvx 2y agoMost women don't care about this at all. It's way, way down the bottom of the list of sexist bullshit in this industry. Complaining about it is more performative than anything. It's a way to pretend you're doing something for women.
- userbinator 2y agoCan confirm, I know a woman who works on image and video compression and she doesn't think Lena is a problem. "It's a pretty woman. What's not to like?" Note that video compression has "foreman", of the opposite gender, and the angry mob hasn't gone after that one.
- deleted 2y ago[deleted]
- dale_glass 2y agoThis is one of the reasons why many hashtable implementations introduce a random component into the algorithm. The order of elements changes on every run, so if you accidentally rely on the order, it's going to go wrong sooner rather than later. It also very nicely prevents security issues, since if the hashing algorithm is fixed, it can be exploited for denial of service by coming up with keys that all fall into the same bucket.
- zarzavat 2y agoMany implementations these days also go the opposite way, guaranteeing that hash tables always iterate in insertion order. I prefer this because it means I don’t have to decide whether I need an ordered map or an unordered map. Often if I think I need an unordered map it turns out to be wrong for some subtle reason.
- mort96 2y agoJavaScript is probably the most notable example of that. It used to not have a guaranteed iteration order, but browsers implemented it in such a way that the iteration order was the insertion order, and then that eventually got standardized because websites started depending on it. For general purpose hash maps in standard libraries, I think you ought to either randomize the iteration order so that it's different every time, or guarantee an iteration order. Leaving it unspecified but predictable in practice is a recipe to fall victim to Hyrum's Law (https://www.hyrumslaw.com/ https://www.hyrumslaw.com/).
- aranke 2y agoPython also, similar story.
- pimeys 2y agoRust has HashMap with random order and BTreeMap which is ordered by the key. Additionally one can use IndexMap crate if wanting to keep the order of insertion in the map. The issue with the latter is how much memory it can waste in the worst cases. A good example is the serde_json library, if enabling the ordering of the maps. If you deserialize JSON into its dynamic Value enum, the resulting object can be many times bigger than the original string. For immutable data that can fit to the CPU cache, utilizing a sorted vector can be many times faster and uses less memory compared to the maps.
- jcelerier 2y ago> I had to build SerenityOS from scratch about 4-5 times on a 2011 laptop with Sandy Bridge Mobile. I mean, this is like trying to do Windows Vista development with a computer released in the timeframe between Windows 3.1 and Windows 95
- elteto 2y agoMaybe in terms of time, but not in terms of actual performance. CPUs haven’t changed that much since 2011 (relatively speaking), but between Windows 3.1 and Vista we got x64 and multicore CPUs everywhere became the norm.
- nicoburns 2y ago> CPUs haven’t changed that much since 2011 (relatively speaking) Perhaps not relatively speaking, but my 2021 CPU is 10x faster than my 2015 CPU on workload which parallelise (which compiling generally does).
- mort96 2y agoGood, let's look at hard numbers! Windows 3.1 came out in 1992. One of the highlights in the CPU world in 1992 was the launch of the Intel DX2 (https://en.wikipedia.org/wiki/Intel_DX2 https://en.wikipedia.org/wiki/Intel_DX2). It used an 800nm process node, ran at up to 66MHz, had 8k of cache, and was usually coupled with either 4 or 8 MB of RAM. Windows Vista came out in 2007. That's the year Intel released their Core 2 Quad (https://en.wikipedia.org/wiki/Intel_Core_2 https://en.wikipedia.org/wiki/Intel_Core_2). It was a quad core, manufactured on a 45nm process node, running at up to 3.5GHz, with 256k of L1 cache and 8M of L2 cache. In this era, computers often had around 2 GB of RAM. So we're talking 4x the number of cores, 50x the clock speed, 256x the RAM, 1024x the cache. Benchmarks comparing the two are extremely difficult to find, because they're from completely different eras of computing; but I think it's pretty safe to say that your 10x is completely insignificant in comparison.
- SSLy 2y ago
- Ygg2 2y agoNeeds [2021] in title
- Zardoz84 2y ago[flagged]
- zogrodea 2y agoThis is very fair, to respect someone's wishes with regards to how their image is used. I'm sad to see this comment (at the time of posting) be downvoted. It doesn't imply guilt on the author of this interesting article or others who used this image without knowing her wishes or anything. I don't understand the response.
- xyst 2y agoIt’s probably downvoted because it doesn’t add anything to the debugging story. At some point, I’ll probably watch the “Losing Lena” documentary. But I wasted a few minutes to determine the comment was not related to the story
- mort96 2y ago[flagged]
- bowsamic 2y agoYeah that's kind of their thing, right? The brand of the SerenityOS community is a safe haven for developers who don't want to worry about ethical or code of conduct issues. And for the most part it seems to work okay. It's like the stupid line about "keep politics out of x" which is of course impossible, but in the case of SerenityOS it kind of works for them.
- mort96 2y agoWell the issue is that they seemingly want to be a safe haven for moderate bigots and regressive types as long as they're polite about it, exactly in line with the "keep politics out of x" thing. Their definition of something "political" and deserving of scorn seems to include something as minor as using gender-neutral pronouns in documentation, while assuming that the reader is male is "apolitical" because that's how things used to be. It seems to be a space designed to avoid anything which the typical 90s white male geek type wouldn't perceive as political. Which in itself is a highly political goal. "Using Lenna is on-brand for SerenityOS" is not meant as a compliment.
- elteto 2y agoKudos on the debugging but also on that commit message. It managed to condense the cause and the fix into a couple of paragraphs.
- russfink 2y agoThis isn’t Gunnar’s fault. The problem was whomever stored ordered data in a hash file. I have been in this business for decades and I have run into the situation where changing the shape of memory uncovers bugs. Every time it causes many hours and days of debugging. If programming weren’t hard, they wouldn’t need us to do it. (I’m not sure how much longer that phrase will hold up under large language models.)
- chrisjj 2y agoIndeed. And contrary to the title, the fault isn't malloc()'s either.
- caboteria 2y agoAs long as LLMs are trained on code that has bugs, they'll suggest code that has bugs.
- powercf 2y ago> This isn’t Gunnar’s fault. The problem was whomever stored ordered data in a hash file. Yes. Even if it were, I don't think it needs to be mentioned in the commit message. Gunnar improved something, which triggered problems with old broken code. For his efforts he gets: > Gunnar, I like you, but please don't make me go through this again. :^)
- shiomiru 2y agoIf the smiley face and the commit message's tone didn't make it clear that it's a joke, TFA explicitly ends with this: > Gunnar in particular was the one who uncovered this bug, and despite my satirical jab in the commit message helped uncover this very interesting bug, so he’s the one who made this post possible. Gunnar is also credited right in the same commit message for help: > Credits to Andrew Kaster, bgianf, CxByte and Gunnar for the debugging help. And judging from how the author of the actually broken code in question is (reasonably) not investigated or publicized, it seems quite obvious to me that the article's author is not trying to play the blame game.
- avidphantasm 2y ago[flagged]
- joshstrange 2y agoThis [0] is probably what you’re thinking of. I thought the same thing when I saw the image but I wasn’t remembering it quite right. That said, it’s clear the model herself would prefer not to be used anymore and there isn’t anything special about the image so I don’t see why we shouldn’t respect her wishes. EDIT: Someone else in the thread said this is from 2021 but I can’t tell since neither the URL nor the page itself give a date. I’ll never understand people hiding/not showing the publish date on blog posts. [0] https://news.ycombinator.com/item?id=39885977 https://news.ycombinator.com/item?id=39885977
- layer8 2y ago> Someone else in the thread said this is from 2021 but I can’t tell since neither the URL nor the page itself give a date. The Git commits in the article indicate the date.
- joshstrange 2y agoAhhh, duh. Thank you for pointing that out. My eyes jumped right over that and I was looking for metadata at the top/bottom of the post.
- layer8 2y agoI often Ctrl+F for 20[012] or 19[9] when looking for a date. :)
- joshstrange 2y agoThat’s a good trick, I might have considered that if I wasn’t on mobile. On desktop “Find in page” is second nature to me but is such a slog on mobile.
- deleted 2y ago[deleted]
- jeffrallen 2y ago[flagged]
- tedunangst 2y agoThis seems like a case where a little more debugging would have saved time over brute force bisection. The logging to print component orders had to be done eventually anyway.
- ddtaylor 2y ago> As a result, during the 1000 commits I ended up bisecting for, I had to build SerenityOS from scratch about 4-5 times on a 2011 laptop with Sandy Bridge Mobile. While this isn’t the fault of the project, I’m still mad. I think SerenityOS has some folks that help each other out with resources and PCs for testing purposes.
- deleted 2y ago[deleted]
- Umayanga 2y ago[flagged]
- Umayanga 2y ago[flagged]
- jeffbee 2y agoFor whatever its worth, if we wait long enough C++ will include the equivalent of `malloc_good_size`. https://github.com/cplusplus/papers/issues/18 https://github.com/cplusplus/papers/issues/18
- AgentOrange1234 2y ago[flagged]
- TowerTall 2y agoThe Lenna (or Lena) picture is one of the most widely used standard test images used for compression algorithms. http://lenna.org/ http://lenna.org/
- bleuarff 2y agoYes, but the model has asked that the community stops using this image. It should be pretty easy to find an image that can serve as a standard, and that no one objects to.
- ashleyn 2y agoThis is the thing that makes it pretty open and shut to me. Image library devs can still choose to put the whole political thing aside to respect the wishes of the photo's subject. Does anyone have to, well, not really, but it'd be the nice thing to do.
- vfclists 2y agoAny sources on this?
- kchr 2y agoYes, for example the interview with her in this video: https://youtu.be/yCdwm2vo09I https://youtu.be/yCdwm2vo09I
- treesknees 2y agoTo be fair, the article using this image is from 2021 - before the linked interview was even recorded.
- amelius 2y agoTL;DR: > Someone used a HashTable to store objects that should be ordered, then iterated over it using the basic HashTable iterator