My Authors
Read all threads
So I learned of an amusing bug today:

Docker for Windows won't run if you have the Razer Synapse driver management tool running.

But the reason is the funny part...
So, both programs want to ensure you only run one copy of themselves.
So they create a global mutex using the GUID of their .NET assembly, right?
except! they do it wrong. And they both do it wrong in the same way.
The code involved is something like this:

string.Format("Global\{0}", (object) Assembly.GetExecutingAssembly().GetType().GUID);
The idea is to get the GUID of the assembly that's executing and to create a GUID based on that, so now you can only run one copy of it.
But it's wrong.
The .GetType() part isn't supposed to be there.
That gets the type of the assembly, not the assembly itself.
And that type is System.Reflection.RuntimeAssembly, part of .NET itself.
So what happens is that both of them are creating a global mutex to ensure only one copy runs, but instead of basing the GUID on their own code, they're both using the GUID of a part of .NET itself.
And they're using the same one!
So how'd that happen?
Well, it turns out we can tell EXACTLY how that happened.

Because the answer is... STACK OVERFLOW
Back in 2009, the user "Nathan" asked how to get the GUID of the running assembly.
Twelve minutes later, "Cerebrus" answered. And that answer was wrong.
A year and a month later, it was pointed out (by "Yoopergeek") that it gives the wrong GUID.

Three years later, Cerebrus returns and fixes the answer. They can't delete it, because it was accepted
But because they made an error in replying to someone in 2009... this flawed code caused bugs that still exist as recently as March of 2018.

reddit.com/r/docker/comme…
That flawed stackoverflow post is here:
stackoverflow.com/a/502323
(And thanks to @matt_sieker for pointing this out to me!)
@matt_sieker homework assignment for all programmers reading this thread:
Think about how you'd find this bug in your own programs.
You copy/paste the code, it seems to work, and you don't realize it's broken because you don't run either of these programs which made the same mistake.
@matt_sieker and you don't find out the error until users report it.

How could you change your development processes to detect this kind of error prior to shipping it?
@matt_sieker I found another example of someone making this same error, and then someone else noticing it's wrong.
But this one is from 2003!
pcreview.co.uk/threads/assemb…
@matt_sieker An update to clear up some confusion:
I didn't mean to suggest this was a bug that was STILL HAPPENING, although at the time I didn't have confirmation that it was fixed. I didn't make that very clear, though! Sorry about that.
@matt_sieker in any case, here's one of the (several) bug reports to docker/for-win which reported this problem back in 2018:
github.com/docker/for-win…
@matt_sieker and that thread (as well as Docker dev @stefscherer) show that it's definitely not still in existence, as it was fixed by May, 2018.
@matt_sieker @stefscherer Still an open question: did they fix it on the Razer Synapse side too? If they're still broken, it won't interfere with the now-fixed Docker, but it might interfere with any other program making the same mistake.
@matt_sieker @stefscherer BTW, if you want to read more of me ranting about software bugs, I have a similar thread where I got mad at the terrible driver software Roccat ships (or doesn't. I still need to finish the Archive The Roccat project):
@matt_sieker @stefscherer and what's possibly my ultimate Angry At Bugs thread, that time I came home from a hospital at 3am and discovered my windows machine had messed up because of a bug that dates back to NINETEEN SEVENTY FOUR:
@matt_sieker @stefscherer And a bug so bad that we're already anticipating the disaster... and it hasn't even hit yet:
@matt_sieker @stefscherer and there's this fun one, about a bug in Pilotwings, which happens despite every single byte of code being identical between the working and broken versions:
@matt_sieker @stefscherer and this thread has gotten enough retweets that I'm legally required to link to my soundcloud.
Well, I don't have one, but feel free to send me a dollar or two on Ko-Fi if you enjoyed this thread and would like me to keep doing this sort of thing:
ko-fi.com/fooneturing
@matt_sieker @stefscherer or set up a monthly donation on Patreon:
patreon.com/foone
@matt_sieker @stefscherer Update: The CEO of Razer has seen this thread and it's scheduled to be fixed in the next update.
(So then it'll be fixed on both ends, preventing either from having errors if a 3rd program does this)
Missing some Tweet in this thread? You can try to force a refresh.

Enjoying this thread?

Keep Current with foone

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!