WTF Bites



  • @Arantor said in WTF Bites:

    @Rhywden It's like they have to take features out to put the new ones in though.

    Just think how much memory programs would take if you keep adding new features without removing old ones. You might even call it bloated. Um, wait...


  • Considered Harmful

    @Tsaukpaetra said in WTF Bites:

    @Applied-Mediocrity said in WTF Bites:

    @Tsaukpaetra said in WTF Bites:

    ServiceHow legs

    It has now grown legs? We're doomed :eek:

    Sorry sorry, upgraded phone, still teaching the keyboard words.

    Got upvotes. Regret nothing.


  • Discourse touched me in a no-no place

    @DogsB said in WTF Bites:

    We can't connect directly to maven central. We have to go through an internal artifactory with a process for adding new libraries. There is a further process for allowing those libraries in a production environment. We're very limited in what we an work with.

    One of the good things about the way maven works is that it is (comparatively) easy to plumb in your own review process like that. (I've done it in a previous project, but don't need it at the moment.)


  • BINNED

    I'm trying to copy some things from one PowerPoint presentation to another. Opening the source document, PowerPoint tells me it contains read-only embedded fonts and suggests I should open the file read-only. Yeah, whatever, I don't intend to make changes anyway.

    I find the slide I'm looking for, select the relevant content and click copy. Paste over into the other document and the wrong thing gets pasted. Thinking I made a mistake I try a few more times but it doesn't work. Looks like you cannot copy from a read-only file. The copy buttons are not disabled or anything, they just don't work.

    How retarded is that? Who the hell though this is a good idea?! This makes no fucking sense whatsoever.


  • Notification Spam Recipient

    @topspin said in WTF Bites:

    Looks like you cannot copy from a read-only file.

    Open it in copy-only mode. Duh.



  • @topspin A lot of features are disabled in read-only mode. IIRC, printing and saving (including saving as PDF) are also forbidden


  • Discourse touched me in a no-no place

    @hungrier said in WTF Bites:

    @topspin A lot of features are disabled in read-only mode. IIRC, printing and saving (including saving as PDF) are also forbidden

    Screenshots it is then?


  • Discourse touched me in a no-no place

    @hungrier said in WTF Bites:

    IIRC, printing and saving (including saving as PDF) are also forbidden

    Office for Mac allows printing on read only documents, and attempting to save shows a message reminding you the document is read only then shows the Save As dialog.



  • *wink, wink*



  • @dkf said in WTF Bites:

    @hungrier said in WTF Bites:

    @topspin A lot of features are disabled in read-only mode. IIRC, printing and saving (including saving as PDF) are also forbidden

    Screenshots it is then?

    Windows 11 will take care of that, too.


  • Discourse touched me in a no-no place

    @BernieTheBernie said in WTF Bites:

    @dkf said in WTF Bites:

    @hungrier said in WTF Bites:

    @topspin A lot of features are disabled in read-only mode. IIRC, printing and saving (including saving as PDF) are also forbidden

    Screenshots it is then?

    Windows 11 will take care of that, too.

    Screenshots with your phone. Sheesh. Do we really need to add the wooden table in there as well?


  • BINNED

    @dkf said in WTF Bites:

    @BernieTheBernie said in WTF Bites:

    @dkf said in WTF Bites:

    @hungrier said in WTF Bites:

    @topspin A lot of features are disabled in read-only mode. IIRC, printing and saving (including saving as PDF) are also forbidden

    Screenshots it is then?

    Windows 11 will take care of that, too.

    Screenshots with your phone. Sheesh. Do we really need to add the wooden table in there as well?

    Judging by the amount of screenshots and lack of cropping going around, it seems like screenshots are the "digital natives'" version of a wooden table.



  • @topspin I haven’t had Word documents for a while.

    Though I did love the one customer I used to have, I successfully taught them “if you have a bug, make a video showing me what you’ve done” so I got a usefully unambiguous set of “what the problem is” and “how to reproduce it” steps.


  • Notification Spam Recipient

    @Arantor said in WTF Bites:

    @topspin I haven’t had Word documents for a while.

    Though I did love the one customer I used to have, I successfully taught them “if you have a bug, make a video showing me what you’ve done” so I got a usefully unambiguous set of “what the problem is” and “how to reproduce it” steps.

    Were the videos short short and with long file names by chance?



  • @dkf said in WTF Bites:

    Screenshots with your phone.

    The Holy Allied Protectors of Copyright (Microsoft, Apple, Google) will create more sophisticated versions of Operating Systems - and perhaps even interoperability between them! - to take care of that, too.


  • Notification Spam Recipient

    @topspin said in WTF Bites:

    @dkf said in WTF Bites:

    @BernieTheBernie said in WTF Bites:

    @dkf said in WTF Bites:

    @hungrier said in WTF Bites:

    @topspin A lot of features are disabled in read-only mode. IIRC, printing and saving (including saving as PDF) are also forbidden

    Screenshots it is then?

    Windows 11 will take care of that, too.

    Screenshots with your phone. Sheesh. Do we really need to add the wooden table in there as well?

    Judging by the amount of screenshots and lack of cropping going around, it seems like screenshots are the "digital natives'" version of a wooden table.

    I gave up on screenshots on mobile. It's too much time and effort to crop, upload and link it here. I just need it to copy to the clipboard but no such luck. ☹



  • @MrL the average video was about 45 seconds to a minute, and usually the file name was the time and date the recording was made because whatever software they were using defaulted to that.



  • @DogsB said in WTF Bites:

    If you can write a program to escalate privileges, get around the firewall whitelist and then escape the VM to do some actual damage send me a link.

    That reminds me of my first real job. The IT created a restrictive policy, but in the end everyone had to get admin privileges because the Time Tracking application (built in-house) did not work without them.

    :trwtf: is that the Time Tracking application was a website. One must like the smell of Internet Explorer in the morning.



  • So I've been trying to get this opentelemetry-cpp library compiling on our target. I'll have to export the data in some random ❄ format to the existing monitoring agent, but I'm thinking at least add a standard API to make it future-proof for when the next customer comes with similar request.

    So I am enabling the features, and when I come to the log preview, I get error that __yield() is not found. And there is a piece of code like this:

    // Issue a Pause/Yield instruction while spinning.
    #if defined(_MSC_VER)
            YieldProcessor();
    #elif defined(__i386__) || defined(__x86_64__)
    #  if defined(__clang__)
            _mm_pause();
    #  else
            __builtin_ia32_pause();
    #  endif
    #elif defined(__arm__)
            // This intrinsic should fail to be found if YIELD is not supported on the current
            // processor.
            __yield(); // This is ARMv7a, so compile error here.
    #else
            // TODO: Issue PAGE/YIELD on other architectures.
    #endif
    

    So I start looking for what this mysterious __yield() is. And I find nothing. It's also bit strange, because if it was a gcc intrinsic (this is somewhat aging gcc 7.3.1), it would be almost certainly be called __builtin_arm_something, not just __yield. So I ask on stack overflow. And promptly get a comment saying:

    That's horrifying. If what you write is true, the same code does does wildly different things on different platforms, with very different performance characteristics. Also, as always, yielding the processor is a sure sign of a hilariously bad program design.

    The change in question came from https://github.com/open-telemetry/opentelemetry-cpp/pull/443, but that's not adding the spinlock, just some more bad logic into it. Not sure who had the bad idea to add the spinlock in the first place.



  • I would have expected that the intersection of "people who don't know about synchronization primitives" and "people who know about low-level intrinsics for several different processors and compilers" was the empty set.

    Obviously, I was wrong.

    EDIT :

    Maintainers (@open-telemetry/cpp-maintainers):

    Emil Mikulic, Google
    Lalit Kumar Bhasin, Microsoft
    Reiley Yang, Microsoft
    Tom Tan, Microsoft


  • @Zerosquare Nah, writing spin-locks by hand is practically a way of life in some communities out there. "Eww, why did you write a spin lock by hand" is pretty much the right reaction. But sometimes there are benchmarks and tangible reasons to back it up. (Not claiming that is the case here).

    That said, I think SO is on the wrong here. The code doesn't do wildly different things on different platforms.

    • YieldProcessor() inserts either a pause instruction (x86 / x86_64 --- rep nop is apparently the same as pause) or a yield instruction (arm).
    • _mm_pause() is an intrinsic that inserts a pause instruction (see godbolt).
    • __builtin_ia32_pause() is a GCC-builtin intrinsic that results in pause.
    • __yield() is an ARM intrinsic. GCC/Clang actually tends to have those too. It generates the ARM yield instruction.

    Those two instructions (pause/yield) seem to be the right thing for a spin loop:

    Improves the performance of spin-wait loops. When executing a “spin-wait loop,” processors will suffer a severe performance penalty when exiting the loop because it detects a possible memory order violation. The PAUSE instruction provides a hint to the processor that the code sequence is a spin-wait loop. [...]

    YIELD indicates to the hardware that the current thread is performing a task, for example a spinlock, that can be swapped out. [...]

    Edit: To be fair, not entirely sure about the ARM one. I don't quite know ARM well enough to understand what they mean by indicating to the hardware that a thread can be swapped out. I would think the latter is more in the domain of the kernel. And ARM didn't have hyperthreading at the time</strike. Maybe somebody more familiar with the modern ARM stuff knows? (But, I'm also willing to accept that this is down to bad documentation.)Nope, seems ARM maybe has SMT support in some platforms?



  • pause is indeed the right instruction to use to implement a spinlock on x86/x64, but as you say, there are very few cases where reimplementing a spinlock in application code makes sense.



  • @Zerosquare Agreed. But the main point is that ${whoever} on SO is wrong (which is always the main point of things :half-trolleybus-tl:).

    Not only does it not appear to do wildly different things on different platforms, but it also doesn't actually yield the processor (as in yielding the time slice back to the kernel).



  • @cvi said in WTF Bites:

    ${whoever} on SO is wrong

    :surprised-pikachu:



  • @cvi said in WTF Bites:

    Nope, seems ARM maybe has SMT support in some platforms?

    The newer ARM platforms do indeed have SMT support. All phones are multi-core now.

    In fact the target I am building for should have it too. There are two versions of the hardware, and at least the newer one has two cores. The page you linked says

    This ARM instruction is available in ARMv6K and above.
    This 32-bit Thumb instruction is available in ARMv6T2 and above.
    This 16-bit Thumb instruction is available in ARMv6T2 and above.

    And my platform definition says -mcpu=cortex-a9 -mtune=cortex-a9 -march=armv7-a. If it's available since v6, I'd expect it to be available on v7a. Unfortunately ARM versioning is a Mess™.


  • Discourse touched me in a no-no place

    @Bulb said in WTF Bites:

    ARM versioning is a Mess™

    This is very true. The biggest complication of all is that many things that you might think are Essential are options that are only available if the chip manufacturer bought that module. Or they might instead be memory-mapped custom stuff.

    RISC-V goes even further with the fun, allowing outright custom instructions. Take that, code portability!



  • @cvi said in WTF Bites:

    @Medinoc said in WTF Bites:

    @cvi IIRC, Group Policies overwrite your machine settings every few hours, that's how they work.

    I've noticed that my settings get nuked every few days ...

    But that's still entirely pointless. If I can trivially bypass locks/security settings in a few clicks, it doesn't matter that the settings get reapplied every few hours. They're still (at best) a vague suggestion.

    Group Policies were intended for computers whose users are not local administrators. There's no "administrator hierarchy" saying the domain admin trumps local admins, so when you have local admins, Group Policies become a "poor man's subtitute" for that.



  • @dkf said in WTF Bites:

    @Bulb said in WTF Bites:

    ARM versioning is a Mess™

    This is very true. The biggest complication of all is that many things that you might think are Essential are options that are only available if the chip manufacturer bought that module. Or they might instead be memory-mapped custom stuff.

    RISC-V goes even further with the fun, allowing outright custom instructions. Take that, code portability!

    Well, for many SoC omitting parts that a specific application won't need makes sense. And they now defined the R, M and A profiles to simplify it a bit. And they now defined the A, M and R profiles that should unify things a bit; but it's still hard to tell which features includes or not.


  • Discourse touched me in a no-no place

    @Bulb said in WTF Bites:

    Well, for many SoC omitting parts that a specific application won't need makes sense. And they now defined the R, M and A profiles to simplify it a bit. And they now defined the A, M and R profiles that should unify things a bit; but it's still hard to tell which features includes or not.

    I've no idea which profile our next-gen chip's using. We use a highly partitioned memory architecture that makes the standard model of computing not work very well, plus quite a lot of other custom bits and pieces, so it's definitely going to need a custom kernel. But the test chips we've seen so far didn't have enough working peripherals for us to start writing the OS, so the hardware guys' assumptions that it would all be easy are… unlikely to hold true. Especially given that it's a totally new memory layout and a totally redone networking engine too.

    Right now I'm letting someone else worry about that. 😆



  • @dkf You have very special hardware, so it can be anything. The standard profiles are for the more off-the-shelf stuff—phones are A as are Pis, Beagleboards, CuBoxes and Chromebooks, while Arduinos are M and there is again bunch of similar generic-purpose controllers with the same M profile. I haven's seen an R, but there is probably a bunch of generic-ish boards with R too.


  • Discourse touched me in a no-no place

    @Bulb It might be close to the M profile. Except we've got around 150 cores per chip. (I don't know the number; it changed that much during development that I lost track.) The crazy core count is what limits the amount of (fast) storage per core (slow storage is off chip and desperately slow if not DMAd) and there's several levels of chip architecture that we've exposed in the memory layout.

    More fun in the old chip design was the fact that we were using an ARM that didn't have bus interlocking, so all mutexes had to use a special on-chip hardware module. Easy… but very much not like anything else on the planet. Mutex allocation management was handled on host in Python (with mutex 0 reserved for the on-chip OS); nobody ever bothered to do anything else.



  • @dkf said in WTF Bites:

    writing the OS, so the hardware guys' assumptions

    As a hardware guy, I can assure you that the hardware guy's assumptions are wrong, because we know nothing about writing an OS.


  • Banned

    @cvi said in WTF Bites:

    That said, I think SO is on the wrong here.

    :surprised-pikachu:

    The commenter obviously never spent any time reading low level C/C++ code. Most libraries in that category have such ifdefs. The best course of action is to ignore everything that comes out of that person's mouth (my head cannon is that they use Google Assistant to post.)



  • @Gąska Well, this library isn't supposed to be that low-level. It is rather out of place there. But some people just don't want to wait for the compiler or standard library to get the optimizations (we do have three years old toolchain here) and bring their own.


  • BINNED

    @Gąska said in WTF Bites:

    my head cannon is that they use Google Assistant to post GitHub Copilot to code.

    🔧


  • Banned

    @Bulb said in WTF Bites:

    @Gąska Well, this library isn't supposed to be that low-level.

    Another thing I've noticed reading dozens of C libraries is that C programmers don't understand the concept of "isn't supposed to be that low-level".



  • @Gąska said in WTF Bites:

    my head cannon

    9c9b79cd-823b-45f2-b830-45171ac0fec0-image.png

    Canon, people, canon.

  • BINNED


  • Banned

    @Rhywden my actual thought process when writing that sentence:

    Is head canon one word or two?
    Eh, let's make it two.
    An extra n to make it funnier.
    There was an xkcd about it right? If someone asks I'll say it's xkcd reference.



  • @Gąska said in WTF Bites:

    @Rhywden my actual thought process when writing that sentence:

    Is head canon one word or two?
    Eh, let's make it two.
    An extra n to make it funnier.
    There was an xkcd about it right? If someone asks I'll say it's xkcd reference.

    I see you're subscribing to the Nanny Ogg School of Orthography.


  • Notification Spam Recipient

    @aitap said in WTF Bites:

    @Arantor Any regrets about your WinRAR license?

    Trying to expense a license. I will post a photo of the cd on a wooden table when it arrives.


  • Java Dev

    You are not worthy of chicken of the fried variety from a particular state in the US.

    no-chicken.png


  • BINNED

    @Atazhaia
    Devine intervention ...


  • Notification Spam Recipient

    @Atazhaia said in WTF Bites:

    You are not worthy of chicken of the fried variety from a particular state in the US.

    no-chicken.png

    VPN? I can't access some sites when I'm on a vpn.


  • Java Dev

    @DogsB Nope. My guess is that the site is broken.


  • Notification Spam Recipient

    @Atazhaia yup.

    c288bf38-53df-49d2-84dc-98b778ac07a0-image.png


  • Banned

    @DogsB no repro. Maybe it's GDPR thing?


  • Notification Spam Recipient

    @Gąska said in WTF Bites:

    @DogsB no repro. Maybe it's GDPR thing?

    Not sure but I can see the site when I turn the VPN to USA.


  • Considered Harmful

    @Gąska said in WTF Bites:

    @DogsB no repro. Maybe it's GDPR thing?

    Unless they think GDPR applied in Sri Lanka, no, it looks like a reverse proxy misconfiguration.


  • Banned

    @LaoC said in WTF Bites:

    @Gąska said in WTF Bites:

    @DogsB no repro. Maybe it's GDPR thing?

    Unless they think GDPR applied in Sri Lanka

    ...which isn't exactly out of the question...


Log in to reply