• 4 Posts
  • 514 Comments
Joined 1 year ago
cake
Cake day: October 4th, 2023

help-circle

  • investigates

    Hmm. Apparently, yeah, some Tesla vehicles do and some do not.

    reads further

    It sounds like autos in general are shifting away from tempered glass side windows to laminated glass, so those window breakers may not be effective on a number of newer cars. Hmm. Well, that’s interesting.

    https://info.glass.com/laminated-vs-tempered-car-side-windows/

    You may have seen it in the news recently—instances of someone getting stuck in their vehicle after an accident because the car was equipped with laminated side windows. Laminated windows are nearly impossible to break with traditional glass-break tools. These small devices are carried in many driver’s gloveboxes because they easily break car windows so that occupants can escape in emergency situations. Unfortunately, these traditional glass-break tools don’t work with laminated side windows. Even first responder professionals have difficulty breaking through laminated glass windows with specialized tools. It can take minutes to saw through and remove laminated glass. In comparison, tempered glass breaks away in mere seconds.



  • Looks fine to me.

    Little side question: Will the Wi-Fi and Bluetooth on the motherboard work in Arch? From what I could gather, the drivers for it should be in the latest kernel, but I’m not 100% sure.

    If they don’t for some reason and you can’t get it working or need some sort of driver fix, can always worst case fall back to a USB dongle or similar until they do. Obviously, preferable not to do that, but shouldn’t wind up stuck without them no matter what.




  • Plus, even if you manage to never, ever have a drive fail, accidentally delete something that you wanted to keep, inadvertently screw up a filesystem, crash into a corruption bug, have malware destroy stuff, make an error in writing it a script causing it to wipe data, just realize that an old version of something you overwrote was still something you wanted, or run into any of the other ways in which you could lose data…

    You gain the peace of mind of knowing that your data isn’t a single point of failure away from being gone. I remember some pucker-inducing moments before I ran backups. Even aside from not losing data on a number of occasions, I could sleep a lot more comfortably on the times that weren’t those occasions.


  • That’s not a completely reliable fix, a third party library could still call setenv and trigger crashes, there’s still a risk of data races, but we’ve observed a significant reduction in SIGABRT volumes.

    Hmm. If they want a dirty hack, I expect they could do a library interposer that overrides setenv(3) and getenv(3) symbols with versions that grab a global “environment variable” lock before calling the actual function.

    They say that they’re having problems with third party libraries that use environment variables. If they’re using third-party libraries statically-linked against libc, I suppose that won’t work, but as long as they’re dynamically-linked, should be okay.

    EDIT: Though you’ve still got an atomic update problem with the returned buffer, doing things the way they are, if you don’t want to leak memory. Like, one thread might have half-updated the value of the buffer when another is reading the buffer after returning from the interposer’s version of the function. That shouldn’t directly crash, but you can get a mangled environment variable value. And there’s not going to be guarantees on synchronization on access to the buffer, unlike the getenv() call itself.

    thinks

    This is more of a mind-game solution, but…

    Well, you can’t track lifetime of pointers to a buffer. So there’s no true fix that doesn’t leak memory. Because the only absolute fix is to return a new buffer from getenv() for each unique setenv(), because POSIX provides no lifetime bounds.

    But if you assume that anything midway through a buffer read is probably going to do so pretty soon, which is probably true…

    You can maybe play tricks with mmap() and mremap(), if you’re willing to blow a page per environment variable that you want to update and a page of virtual address space per update, and some temporary memory. The buffer you return from the interposer’s getenv() is an mmap()ed range. In the interposer’s setenv(), if the value is modified, you mremap() with MREMAP_DONTUNMAP. Future calls to getenv() return the new address. That gives you a userspace page fault handler to the old range, which I suppose – haven’t written userspace page fault handlers myself – can probably block the memory read until the new value is visible and synchronize on visibility of changes across threads.

    If you assume that any read of the buffer is sequential and moving forward, then if a page fault triggers on an attempted access at the address at the start of the page, then you can return the latest value of the value.

    If you get a fault via an address into the middle of the buffer, and you still have a copy of the old value, then you’ve smacked into code in the middle of reading the buffer. Return the old value.

    A given amount of time after an update, you’re free to purge old values from setenv(). Can do so out of the interposer’s functions.

    You can never eliminate that chance that a thread has read the first N bytes of an environment variable buffer, then gone to sleep for ten minutes, then suddenly wants the remainder. In that case, you have to permit for the possibility that the thread sees part of the old environment variable value and part of the new. But you can expend temporary memory to remember old values longer to make that ever-more unlikely.



  • Assuming that this is the episode and the Factorio dev post that references, I think that that’s a different issue. That dev also was using Sway under Wayland, but was talking about how Factorio apparently doesn’t immediately update the drawable area on window size change – it takes three frames, and Sway was making this very visible.

    I use the Sway window manager, and a particularity of this window manager is that it will automatically resize floating windows to the size of their last submitted frame. This has unveiled an issue with our graphics stack: it takes the game three frames to properly respond to a window resize. The result is a rapid tug-of-war, with Sway sending a ton of resize events and Factorio responding with outdated framebuffer sizes, causing the chaos captured above.

    I spent two full days staring at our graphics code but could not come up with an explanation as to why this is happening, so this work is still ongoing. Since this issue only happens when running the game on Wayland under Sway, it’s not a large priority, but it was too entertaining not to share.

    I’d guess that he’s maybe using double- or triple-buffering at the SDL level or something like that.




  • venv nonsense

    I mean, the fact that it isn’t more end-user invisible to me is annoying, and I wish that it could also include a version of Python, but I think that venv is pretty reasonable. It handles non-systemwide library versioning in what I’d call a reasonably straightforward way. Once you know how to do it, works the same way for each Python program.

    Honestly, if there were just a frontend on venv that set up any missing environment and activated the venv, I’d be fine with it.

    And I don’t do much Python development, so this isn’t from a “Python awesome” standpoint.


  • Well, someone’s gotta pay for all the bandwidth somehow.

    considers

    Honestly, maybe that’d be a way for instances to provide some kind of “premium” service. Like, provide larger upload limits for people who donate. I assume that the instance admins don’t have any ideological objections to larger images, just don’t want to personally pay out-of-pocket for huge bandwidth and storage bills.

    goes looking

    I believe that this is the backend used by Lemmy, pict-rs:

    https://github.com/distruss/pictrs

    https://join-lemmy.org/docs/administration/from_scratch.html

    Lemmy supports image hosting using pict-rs. We need to install a couple of dependencies for this.

    It looks like it only has one global size setting, so probably can’t do that today.

    Could also host one’s images on an off-site image hosting thing, but then you don’t benefit from integration with the uploading UI. I guess another option would be for Lemmy to provide some sort of integration with an off-site image-hosting service, so that a user could optionally use all the Lemmy features seamlessly, but just have your client or browser make use of your off-site account.


  • Also, I tried to upload pictures but kept getting an error.

    If lemm.ee supports image uploads – which they don’t have to – they may have size restrictions; my understanding is that the size restriction can be customized on a per-instance basis.

    EDIT: They say in their sidebar:

    https://lemm.ee/

    • Image uploads are enabled 4 weeks after account creation
    • Image upload limit is 500kb per image

    Your account was created in 2023, so it’s not the 4 week limit, but you’re probably exceeding their (relatively low, as Lemmy instances go) image size limit.

    Be kind of interesting to expose that data and let lemmy.fediverse.observer display limits per-instance.

    EDIT2: I think that the largest image I’ve uploaded on lemmy.today is this high-resolution scan, which is 8 MB.



  • If a nuclear missile is launched at the United States the President has just 6 minutes to come to terms with that and decide to launch a counter attack or not.

    US nuclear deterrence in 2024 doesn’t rely on launch-on-warning, but on the expectation that no hostile power has the ability to locate and destroy the US ballistic missile submarine fleet prior to them performing their counterlaunches.

    https://en.wikipedia.org/wiki/Second_strike

    In nuclear strategy, a retaliatory strike or second-strike capability is a country’s assured ability to respond to a nuclear attack with powerful nuclear retaliation against the attacker. To have such an ability (and to convince an opponent of its viability) is considered vital in nuclear deterrence, as otherwise the other side might attempt to try to win a nuclear war in one massive first strike against its opponent’s own nuclear forces.

    Submarine-launched ballistic missiles are the traditional, but very expensive, method of providing a second strike capability, though they need to be supported by a reliable method of identifying who the attacker is.

    https://en.wikipedia.org/wiki/Launch_on_warning

    Launch on warning (LOW), or fire on warning, is a strategy of nuclear weapon retaliation where a retaliatory strike is launched upon warning of enemy nuclear attack and while its missiles are still in the air, before detonation occurs.

    In 1997, a US official stated that the US had the technical capability for launch on warning but did not intend to use a launch on warning posture and that the position had not changed in the 1997 presidential decision directive on nuclear weapon doctrine.

    This non-reliance on launch-on-warning is also true of the French and British nuclear deterrents – the British don’t even maintain a nuclear arsenal other than on subs, so they haven’t even bothered with maintaining the option to do so, and the French only use tactical ALCMs in addition to the strategic sub-launched weapons; those weapons probably would be poorly-suited for such a role.

    The Brits rather famously have the “letter of last resort”.

    https://en.wikipedia.org/wiki/Letters_of_last_resort

    The letters of last resort are four identically worded handwritten letters from the prime minister of the United Kingdom to the commanding officers of the four British ballistic missile submarines and stored on board of each. They contain orders on what action to take if an enemy nuclear strike has both destroyed the British government and has also killed or otherwise incapacitated both the prime minister and their designated “second person” of responsibility, typically a high-ranking member of the Cabinet such as the deputy prime minister or the first secretary of state. If the orders are carried out, the action taken could be the last official act of His Majesty’s Government.

    If the letters are not used during the term of the prime minister who wrote them, they are destroyed unopened after that person leaves office, so that their content remains unknown to anyone except the issuer.

    Process

    A new prime minister writes a set of letters immediately after taking office and being told by the Chief of the Defence Staff “precisely what damage a Trident missile could cause”. The documents are then delivered to the submarines in sealed envelopes, and the previous prime minister’s letters are destroyed without being opened.

    In the event of the deaths of both the prime minister and the designated alternative decision-maker as a result of a nuclear strike, the commander(s) of any nuclear submarine(s) on patrol at the time would use a series of checks to ascertain whether the letters of last resort must be opened.

    According to Peter Hennessy’s book The Secret State: Whitehall and the Cold War, the process by which a Vanguard-class submarine commander would determine if the British government continues to function includes, amongst other checks, establishing whether BBC Radio 4 continues broadcasting.

    In 1983, the procedure for Polaris submarines was to open the envelopes if there was an evident nuclear attack, or if all UK naval broadcasts had ceased for four hours.

    Options

    While the contents of these letters are secret, according to the December 2008 BBC Radio 4 documentary The Human Button, there were four known options given to the prime minister to include in the letters. The prime minister might instruct the submarine commander to:

    • retaliate with nuclear weapons;

    • not retaliate;

    • use their own judgement; or,

    • place the submarine under an allied country’s command, if possible. The documentary mentions Australia and the United States.

    The Guardian reported in 2016 that the options are said to include: “Put yourself under the command of the United States, if it is still there”, “Go to Australia”, “Retaliate”, or “Use your own judgement”. The actual option chosen remains known only to the writer of the letter.




  • The feature list of the language is so long at this point that it is pretty much impossible for anyone new to learn C++ and grok the design decisions anymore.

    Even if it is possible, it’s a high bar. The height of that bar matters in bringing new people in.

    I have seen decades of would-be “C++ killers” come and go. I think that in the end, it is C++ that kills C++. The language has just become unusably large. And that’s one thing that cannot be fixed by extending the language.