WTF Bites


  • Considered Harmful

    @First-Last Welcome to the forum!



  • @Gribnit said in WTF Bites:

    could have sworn someone was using '^' for concatenation,

    MUMPS?

    @Tsaukpaetra said in WTF Bites:

    if a device thinks it can save as much power by turning off most everything (like the display and storage) then do that instead of going S5 .

    That's called S3, which is what sleep is and has been since ACPI was invented.


  • Considered Harmful

    @anotherusername said in WTF Bites:

    @Tsaukpaetra Is it even possible to change a monitor to 16-bit color anymore? I guess maybe NVidia's control panel might have a super-buried setting for it...

    Are you talking about the monitor, or the driver? Because the monitor doesn't really care how many colors you're sending it... when the video signal goes across the wire, it doesn't really matter. The number of colors is more of a memory limitation on the sending side than it is anything that the receiving side has to care about.

    The analog monitors nobody really uses any more, they don't care. Digital video interfaces do, it's just that they all support at least 24-bit so it doesn't matter for those historical modes.


  • Considered Harmful

    @mott555 said in WTF Bites:

    GMail just decided that an English-language email from a coworker was actually written in Polish, and auto-translated it to English for me. The original email and the translated email are identical so it didn't screw anything up for me, but :wtf:

    You're lucky his family ain't Somali



  • @Onyx said in WTF Bites:

    qint64 QIODevice::readLine(char *data, qint64 maxSize)

    This function reads a line of ASCII characters from the device, up to a maximum of maxSize - 1 bytes, stores the characters in data, and returns the number of bytes read. If a line could not be read but no error ocurred, this function returns 0. If an error occurs, this function returns the length of what could be read, or -1 if nothing was read.

    That's standard behaviour of all read and fread functions throughout the Universe.

    It needs to mention where it stores the error code though, so the documentation is somewhat :wtf:.

    This was likely a cause of a bug I was hunting for. So, let me get this straight:

    • if it reads a line without an error, it returns the number of bytes read
    • if it reads a line, but there's an error, it still returns the number of bytes read
    • if it can't read a line, but there was no error, it returns 0
    • if ti can't read a line, but there is an error, it returns -1

    Whose demented brainchild is this? What in the holy fuck?

    Thompson's or Richie's, probably. Exists at least since the first version of Unix.

    Anyway, changed while(socket->readLine(buf, MAX_LINE_SIZE)) to while(socket->readLine(buf, MAX_LINE_SIZE) > 0). Now, we hope. Because fuck if I can figure out why it fucking fails in this particular case (on an install that's been there for like 2 years and suddenly decided it's now the time to become a dick).

    You shouldn't indiscriminately end the loop on error, because certain notable non-errors, in particular EAGAIN and EINTR, are considered errors for this purpose. You really need to add the case for -1 and at least log the condition, otherwise you'll never know.


  • Discourse touched me in a no-no place

    @Bulb said in WTF Bites:

    You shouldn't indiscriminately end the loop on error, because certain notable non-errors, in particular EAGAIN and EINTR, are considered errors for this purpose. You really need to add the case for -1 and at least log the condition, otherwise you'll never know.

    Check the documentation as this can vary. Though the low-level API has those states, layers on top might instead restart the operation. This stuff is non-trivial. It gets particularly fun with EAGAIN, as that only happens in non-blocking mode and a lot of languages and libraries have only very poor support for that.

    Also, “I've managed to read a line but the last read was an error” makes no sense as a state. It's literally incoherent.


  • BINNED

    @Bulb said in WTF Bites:

    @Onyx said in WTF Bites:

    qint64 QIODevice::readLine(char *data, qint64 maxSize)

    This function reads a line of ASCII characters from the device, up to a maximum of maxSize - 1 bytes, stores the characters in data, and returns the number of bytes read. If a line could not be read but no error ocurred, this function returns 0. If an error occurs, this function returns the length of what could be read, or -1 if nothing was read.

    That's standard behaviour of all read and fread functions throughout the Universe.

    It needs to mention where it stores the error code though, so the documentation is somewhat :wtf:.

    This was likely a cause of a bug I was hunting for. So, let me get this straight:

    • if it reads a line without an error, it returns the number of bytes read
    • if it reads a line, but there's an error, it still returns the number of bytes read
    • if it can't read a line, but there was no error, it returns 0
    • if ti can't read a line, but there is an error, it returns -1

    Whose demented brainchild is this? What in the holy fuck?

    Thompson's or Richie's, probably. Exists at least since the first version of Unix.

    Anyway, changed while(socket->readLine(buf, MAX_LINE_SIZE)) to while(socket->readLine(buf, MAX_LINE_SIZE) > 0). Now, we hope. Because fuck if I can figure out why it fucking fails in this particular case (on an install that's been there for like 2 years and suddenly decided it's now the time to become a dick).

    You shouldn't indiscriminately end the loop on error, because certain notable non-errors, in particular EAGAIN and EINTR, are considered errors for this purpose. You really need to add the case for -1 and at least log the condition, otherwise you'll never know.

    I did add a case in the end. Also, fuck knows what's happening in there, and I would expect the readyRead signal to emit again in such a case, so it should handle it fine either way (I have a buffer that persists between slot invocations).

    I just expected more from Qt. Also, if it told you anything about errors being stored anywhere I'd be fine and whine less, but unless I need to read the entire docs for fucking QAbstractIODevice, or what the fuck ever lower level than that, I haven't seen it referenced in there.



  • My work computer is an HP Pavilion. It runs the Windows 10 Home Edition that came with it (hooray for price discrimination). In addition to the HP drivers and crapware, we installed Visual Studio, Firefox, Chrome, an outdated version of Microsoft Office, Malwarebytes (probably unnecessary but whatever) and nothing more. The updates are all installed (not like we have a choice).

    Yesterday all of a sudden all the UWP apps, except Settings, stopped working. The window shows a splash screen for half a second then just closes. I rebooted the system and the problem persisted. I ran sfc and chkdsk and they didn't find any problems, so there's no system file corruption it could be blamed on. I even ran a specific "Windows Store Apps troubleshooter". Unfortunately all it tells me is that I should sign in with a Microsoft account.

    How do you screw up an OS so badly that its core functionality can just suddenly stop working by itself? For all I rant about Linux being poorly designed, I don't think it's ever done that to me.

    I think it might be the AMD GPU driver update, because it's the only thing that changed recently, but even then, everything else still works fine. And just closing the window on me? Can't it give me a little hint on what might be going wrong in there?


  • Notification Spam Recipient

    @anonymous234 said in WTF Bites:

    Can't it give me a little hint on what might be going wrong in there?

    😂 😂 😂

    You're going to need to create a new user profile in the end, I think.



  • @anonymous234 said in WTF Bites:

    How do you screw up an OS so badly that its core functionality can just suddenly stop working by itself?

    blakeyrat You screwed with the settings, it's your damned fault!

    pie_flavor WOMM, you must be using Linuxfaulty hardware

    🍹



  • After finding a problem I've gone from "why X doesn't work?" to "how was anything working at all?"


  • Considered Harmful

    @sockpuppet7 Well, take a moment to reflect on the good times you've had with your sanity.



  • @Gribnit Implicating I ever had any sanity


  • Considered Harmful

    @anonymous234 HP. That's what's going wrong in there.



  • @pie_flavor said in WTF Bites:

    @anonymous234 HP. That's what's going wrong in there.

    Thank you :trollface:


  • Fake News

    @sockpuppet7 said in WTF Bites:

    Implicating

    💢


  • BINNED

    @Bulb The mere existence of EAGAIN/EINTR is a :wtf: to begin with. From the history posts I read, they came up with that because, like everything UNIX, it made some system calls a bit easier to implement, decades ago. Okay fine, so it's easier to err out of kernel mode and retry.
    But that's as much of an implementation detail as you could possibly get. Instead of documenting that for all eternity, just make the function that does the syscall do the loop. Don't let that shit leak out into user code.



  • @topspin said in WTF Bites:

    just make the function that does the syscall do the loop. Don't let that shit leak out into user code.

    What if you don't want to wait forever?



  • @dkf said in WTF Bites:

    Check the documentation as this can vary. Though the low-level API has those states, layers on top might instead restart the operation. This stuff is non-trivial. It gets particularly fun with EAGAIN, as that only happens in non-blocking mode and a lot of languages and libraries have only very poor support for that.

    Certainly. The POSIX API has those cases, but Qt, being supposedly portable, has to wrap them somehow.

    @dkf said in WTF Bites:

    Also, “I've managed to read a line but the last read was an error” makes no sense as a state. It's literally incoherent.

    The API is not able to represent it anyway. If something was read, then it is returned and the next call will report the error if it can't make any progress. However, the read line API needs to loop the low-level system call internally, so it can find out already, so somebody had the idea of including it in the documentation even though it still can't really be represented.

    @Onyx said in WTF Bites:

    Also, if it told you anything about errors being stored anywhere I'd be fine and whine less, but unless I need to read the entire docs for fucking QAbstractIODevice, or what the fuck ever lower level than that, I haven't seen it referenced in there.

    Yeah, that's the real problem. I think there should be some kind of last error member on the object (similar to ferror on FILE *), but it should be mentioned in the relevant methods—along with explanation of any “error” conditions that may occur and may need special handling (the system call documentation always does that).



  • @anonymous234 said in WTF Bites:

    Can't it give me a little hint on what might be going wrong in there?

    Maybe it gave a hint in the Event Viewer?


  • BINNED

    @swayde said in WTF Bites:

    @topspin said in WTF Bites:

    just make the function that does the syscall do the loop. Don't let that shit leak out into user code.

    What if you don't want to wait forever?

    On mobile, so I didn't look it up: I was specifically thinking of EINTR only, where the call should succeed, implementation details aside.


  • 🚽 Regular

    @Tsaukpaetra said in WTF Bites:

    0_1534740335471_7fc7ec87-03ee-4bb8-9737-6311c68505b9-image.png

    What's "broken" about my account?

    0_1534740380164_08d5d787-5edf-421c-a6f5-a0409e013c77-image.png

    Nothing, apparently.

    I got that one too, recently. I just shrugged and went about my day.


  • 🚽 Regular

    @anonymous234 said in WTF Bites:

    How do you screw up an OS so badly that its core functionality can just suddenly stop working by itself?

    I've been holding back on updating, so I'm relatively new to Windows 10's idiotsyncrazies.

    I've looked away from my laptop for half a minute and the screen turned off. Normally I'd just tap a dead key and it would turn the screen back on, but this time the screen remains completely dark even though the computer never stopped being on.

    I'm hoping it's because it's 1 AM and it's unilaterally decided it's off work hours and it needs to update.
    I'm goofing off on the desktop currently.



  • @First-Last said in WTF Bites:

    while true docker run hello-world * cores * 10

    prepare for "Error: no space left on disk" in about fifteen seconds due to the log files.


  • 🚽 Regular

    @Zecc An hour and a half later it was still turned on (:giggity:) and unresponsive.

    I ended up long-pressing the power button. It then went something like this:

    • 💻 updates 100% complete
    • 💻 ...100% complete
    • 💻 ...
    • 💻 0% complete
    • 💻 15% complete
    • 💻 33% complete
    • 💻 ...
    • 💻 33% complete
    • 💻 ...
    • 💻 ...... 33% complete
    • 💻 75% complete
    • 💻 100% complete
    • 💻 ...100% complete
    • 💻 login screen
    • Zecc logs in
    • Zecc wheretf are all my windows, you lost my data, you PoS 💢
    • Zecc "how to turn off windows 10 rebooting without warning"
    • 🌐 here's a configuration option you don't have until you upgrade to Windows Pro, or you can use Task Scheduler to disable the task that updates, but then you also need to create a new task that re-disables the task that updates because the task that updates is periodically re-enabled, or try this third-party app that periodically changes the work hours configuration to sometime in the future, or ForceReboot = 0 and AUOptions = 2 in the registry
    • Zecc I'm getting too old for this bullshit :belt_onion:

    Great UX, guys.


  • Considered Harmful

    @Zecc It's not supposed to be great UX. If you are a non-technical user, you cannot be trusted to not hold off security updates indefinitely out of laziness. If you are one, then you know how to edit the registry, and there's a key for that.



  • @pie_flavor But what if shooting aliens is more important than getting updates?


  • kills Dumbledore

    @remi that's why space force will be mac based. As a bonus, it will also mean they can upload viruses directly to alien computers


  • Considered Harmful

    @remi said in WTF Bites:

    @pie_flavor But what if shooting aliens is more important than getting updates?

    https://i.imgur.com/5C7fV7n.jpg

    Nothing is more important than trumps shooting aliens.
    - USSF



  • @pie_flavor said in WTF Bites:

    It's not supposed to be great UX.

    No, but applying updates could be better UX in the first place. It's not like only technical users are complaining about the forced/random reboots and other WU annoyances. If the updates were a painless transparent thing that magically happened without impacting work or gaming or whatever, like 99% of the complaints wouldn't be there. (The remaining 1% would be the tinfoil hats that resent anybody automatically installing updates on their machines in the first place.)

    Filed under: Why does performance suddenly suck? Oh. $random-WU-process is running at full tilt again.



  • @cvi said in WTF Bites:

    If the updates were a painless transparent thing that magically happened without impacting work or gaming or whatever

    You mean, like Linux updates? 🍹


  • Considered Harmful

    @remi said in WTF Bites:

    @pie_flavor But what if shooting aliens is more important than getting updates?

    With AI being all the rage now, they could just make it progressively less convenient. First two days you get to click "fuck off". Then you get a text box where you have to write "Please". After that it's a minimum of two grammatically correct sentences related to the topic of rebooting, until after a month or so you have to write a detailed essay on why it's really really important to postpone this update pretty please with sugar on top :trollface:


  • Considered Harmful

    @cvi said in WTF Bites:

    @pie_flavor said in WTF Bites:

    It's not supposed to be great UX.

    No, but applying updates could be better UX in the first place. It's not like only technical users are complaining about the forced/random reboots and other WU annoyances. If the updates were a painless transparent thing that magically happened without impacting work or gaming or whatever, like 99% of the complaints wouldn't be there. (The remaining 1% would be the tinfoil hats that resent anybody automatically installing updates on their machines in the first place.)

    Except the way you hold off updates ad infinitum is by never turning off your computer. Or even just taking advantage of hybrid shutdown. There is no way to force updates on people without some inconvenience. However, I have never had any forced restarts on my laptop, simply because I routinely shut it down. So that's how you can deal with the problem if you are a nontechnical user.



  • @TimeBandit said in WTF Bites:

    You mean, like Linux updates?

    Emerging updates in Gentoo is barely noticeable when typing in vim on my 12 core coffee-lake i7 at work. 🐠


  • BINNED

    @pie_flavor said in WTF Bites:

    @Zecc It's not supposed to be great UX. If you are a non-technical user, you cannot be trusted to not hold off security updates indefinitely out of laziness.

    Yeah, fuck people who use their computer for work. Sucks for them if they lose data. And fuck those who don't use it for work, too, who cares if you wanted to play a game when windows has other plans.



  • @pie_flavor said in WTF Bites:

    Except the way you hold off updates ad infinitum is by never turning off your computer.

    I refuse to believe that it's impossible to come up with an update-solution that doesn't require rebooting the whole machine. At least most of the time. (It's not an easy problem to solve, and a ton of legacy cruft makes it messy, but there are some really good engineers at MS too. Alas, it's not a very sexy project, and I wouldn't volunteer to tackle that either...)

    However, I have never had any forced restarts on my laptop, simply because I routinely shut it down.

    I used to do that, but I'm too lazy these days - waking my machine and having everything open the way I left it is too useful. Laptops are a bit of an exception, I don't really use them that regularly. OTOH this means that WU will attempt to run whenever I actually grab a laptop and want to do something with it (i.e., I need to do a presentation, and have to be careful about not having to reboot because that would cause WU to run for some indeterminate time; or having to wait out WU before being able to stuff the laptop into a bag because I accidentally told it to shut down after that meeting; or...).

    But ... not having to reboot in the first place would make most of these problems go away. (Noteable exception being some WU processes running amok and impacting performance system wide. But that just shouldn't be a thing.)


  • Considered Harmful

    Intel refuses to fix their b0rken microcode unless you consent to not publishing any benchmark results
    I'm curious to see exactly which governments will make their citizens bend over to be shafted like this.



  • @cvi said in WTF Bites:

    I refuse to believe that it's impossible to come up with an update-solution that doesn't require rebooting the whole machine.

    It doesn't now. It just requires all applications and servers to be stopped and all users to be logged out.

    The problem is: that's functionally identical to rebooting.



  • @blakeyrat Fair enough. But as you say, the end result is the same.



  • @cvi said in WTF Bites:

    @blakeyrat Fair enough. But as you say, the end result is the same.

    Right but how do you imagine anybody could do better? Programs are stored both in memory and on disk. Libraries are stored both in memory and on disk. Updates can change the interface of libraries. Programs can be storing data objects from libraries, when the updated library has an object of a different length or layout.

    I mean if you have a proposal, by all means make it.


  • ♿ (Parody)

    @pie_flavor said in WTF Bites:

    It's not supposed to be great UX.

    Yeah, that's what people are complaining about!


  • ♿ (Parody)

    @LaoC said in WTF Bites:

    @remi said in WTF Bites:

    @pie_flavor But what if shooting aliens is more important than getting updates?

    With AI being all the rage now, they could just make it progressively less convenient. First two days you get to click "fuck off". Then you get a text box where you have to write "Please". After that it's a minimum of two grammatically correct sentences related to the topic of rebooting, until after a month or so you have to write a detailed essay on why it's really really important to postpone this update pretty please with sugar on top :trollface:

    Heh. I just watched this episode (been sitting on the DVR for a long time):

    Scully and Mulder get chased around by drones and driverless cars and their phones and roombas and pretty much everything else because they didn't leave a tip at a fully automated restaurant that got Mulder's order hilariously wrong. It was pretty funny, actually, but only because it wasn't real. Yet.



  • @blakeyrat said in WTF Bites:

    Right but how do you imagine anybody could do better?

    Yeah, nobody ever managed to make it better :rolleyes:

    Programs are stored both in memory and on disk. Libraries are stored both in memory and on disk. Updates can change the interface of libraries. Programs can be storing data objects from libraries, when the updated library has an object of a different length or layout.

    I mean if you have a proposal, by all means make it.

    It was already explained to you, but let me repeat just in case you would understand it this time (I really doubt it)

    If you DON'T lock the executable/library when it's loaded in memory, you can just replace the version on disk, then restart the service and BAM! new version gets loaded.

    What's so difficult about this?


  • ♿ (Parody)

    @TimeBandit said in WTF Bites:

    What's so difficult about this?

    It's not the Mi¢ro$soft Way, so it just doesn't make sense.



  • @TimeBandit said in WTF Bites:

    It was already explained to you, but let me repeat just in case you would understand it this time (I really doubt it)
    If you DON'T lock the executable/library when it's loaded in memory, you can just replace the version on disk, then restart the service and BAM! new version gets loaded.
    What's so difficult about this?

    That still requires you to reboot all the apps and services and is functionally identical to a reboot. As I've explained every time some idiot moron Linux user spews out their stupid wrong positions on this matter.

    What's so difficult about that?

    The point of locking the executable/library code while it's running is to prevent exactly what you're proposing: the version on disk being different than the version in memory. Especially important since shared libraries can be loaded or unloaded at any time. It's a safety feature, ensuring that if a program loads foo.dll, then unloads it, then later loads it again, the second time it gets the same version as the first.

    @boomzilla said in WTF Bites:

    It's not the Mi¢ro$soft Way, so it just doesn't make sense.

    Right; the fact that it doesn't even help the fucking problem, we'll just ignore that. It must all be about praising Microsoft I guess.



  • @blakeyrat said in WTF Bites:

    That still requires you to reboot all the apps and services and is functionally identical to a reboot.

    Yeah, every programs and services uses EVERY library in the system, so if you update one library, you have to restart everything.

    :facepalm:



  • @blakeyrat said in WTF Bites:

    Right but how do you imagine anybody could do better?

    Anybody? Yeah, I imagine that somebody with the resources of Microsoft could do better if they prioritized that. We're talking about a product that has lasted multiple decades, with several major redesigns along the way. Granted, Windows Update is a bit newer, but it has been around for a while (and the complaints are a bit newer again, but have been around for at least 3 or 4 major iterations).

    That still requires you to reboot all the apps and services and is functionally identical to a reboot.

    So do that incrementally and in the background? Nothing says that all of them have to be restarted at once. Or that even a majority have to be restarted, depending on what's being updated.

    For example, I don't care if the Visual Studio IDE restarts itself when I've locked my screen to get a cup of coffee or overnight or whatever, assuming it's back in the same state I left it when I'm back. I care even less about the services that are running in the background - surely those could be made restartable in the background without bothering me? (Yes, it'll take some amount of engineering to make that work.)

    I mean, my fucking Android phone seems to be able to pull that off.

    The point of locking the executable/library code while it's running is to prevent exactly what you're proposing: the version on disk being different than the version in memory. Especially important since shared libraries can be loaded or unloaded at any time. It's a safety feature, ensuring that if a program loads foo.dll, then unloads it, then later loads it again, the second time it gets the same version as the first.

    Yet, in practice, that doesn't seem to be much of a problem.



  • @TimeBandit said in WTF Bites:

    @blakeyrat said in WTF Bites:

    That still requires you to reboot all the apps and services and is functionally identical to a reboot.

    Yeah, every programs and services uses EVERY library in the system, so if you update one library, you have to restart everything.

    :facepalm:

    Serious question (yeah, I know that's :doing_it_wrong:)--how does the OS know what programs/services are using what libraries? That is, how does it know which need to be restarted and which don't?

    There's probably a registration method somewhere, but that seems fragile.


  • Considered Harmful

    @blakeyrat said in WTF Bites:

    The point of locking the executable/library code while it's running is to prevent exactly what you're proposing: the version on disk being different than the version in memory. Especially important since shared libraries can be loaded or unloaded at any time. It's a safety feature, ensuring that if a program loads foo.dll, then unloads it, then later loads it again, the second time it gets the same version as the first.

    Wat? That would require Windows to intervene when I'm loading a shared library and after I loaded it once, lock it for the lifetime of my process even if I closed it again, on the off chance that a) I might want to load it again AND b) the library programmer might have fucked up and subverted the major point of a shared library, namely that users don't have to give a damn about the implementation as long as the API stays the same.
    That would be even sicker than I thought.



  • @Benjamin-Hall said in WTF Bites:

    Serious question (yeah, I know that's )--how does the OS know what programs/services are using what libraries? That is, how does it know which need to be restarted and which don't?

    The system already knows which libraries have been loaded by what processes.

    In fact, the system needs to track all open files anyway (as file IO goes through the kernel), along with which process opened them. Loading a library involves opening the corresponding file.


Log in to reply