News for hackers. Stuff that matters.
Re:Docker for Windows won't run if Razer Synapse driver mana... by mcv on Tuesday February 18, 2020 @05:35AM (#22354944)
> "Who the hell copy pastes code into their program without first examining..."

Quite a lot of people do that. It's pretty much the reputation of Stackoverflow. And of course everybody knows it's bad, but it saves time and it works and there's deadlines so they move on and ship it to production.

How to find this particular bug is not that hard, though: you're looking for a way to ensure that your program can run only once, so you use that mutex. But you want to be sure that mutex is unique to your program and not shared with others that use the same method, so you create another program that uses the same method and test if they conflict. If they do, then your mutex is not unique to your program.

Re:Docker for Windows won't run if Razer Synapse driver mana... by JeremyNT on Tuesday February 18, 2020 @11:16AM (#22357078)
> Quite a lot of people do that. It's pretty much the reputation of Stackoverflow. And of course everybody knows it's bad, but it saves time and it works and there's deadlines so they move on and ship it to production.

The trick of it is, it's only "bad" if you care about code quality and/or maintainability, fuzzy attributes which are seldom measured or optimized for. It's the only logical conclusion to "move fast and break things."

p.s. - the good news is, most of us are working on software that doesn't really matter terribly much, so the fact that it's bad also doesn't matter very much

Re:Docker for Windows won't run if Razer Synapse driver mana... by viraptor on Tuesday February 18, 2020 @05:51AM (#22355016)
> If they do, then your mutex is not unique to your program.

Unfortunately, if they don't, you only know that there exists one program which does collide with your app's mutex. Nothing more, nothing less.

> But you want to be sure that mutex is unique to your program

This one's actually impossible to test. Or to be pedantic, we know it can't be done - another app can be using your app's guid for its mutex, but in realistic cases, it's just really hard to test for. There could be even a real use case for collision - independent agents walking the process tree and relying on locks based on guids to not step on each other.

Re:Docker for Windows won't run if Razer Synapse driver mana... by mcv on Tuesday February 18, 2020 @07:13AM (#22355361)
It's not a true proof that it's unique, but if you have two programs use the same method to generate that GUID and end up with different GUIDs, while different instances of the same program get the same one, it's looking pretty likely that they're unique to the program. Going beyond that is only really interesting to mathematicians.
Re:Docker for Windows won't run if Razer Synapse driver mana... by _pmf_ on Tuesday February 18, 2020 @06:18AM (#22355123)
I've had exactly zero instances where I could copy and paste literally.