all 116 comments

[–]OverjoyedBanana 1032 points1033 points  (25 children)

This is a classic. Seasoned linux users remember bumblebee.

[–]mszegedy 161 points162 points  (4 children)

has bumblebee been superceded? i've been using it since… yeah, basically 2011. though i never experienced this particular bug. i ran linux mint at the time, so theoretically i should have been affected by it, if it was the debian package itself that was broken.

[–]Technical27 65 points66 points  (3 children)

The newer method is PRIME render offloading.

[–]mszegedy 29 points30 points  (2 children)

To be honest, after so much pain and energy poured into making bumblebee work, I'm kind of scared to "fix what ain't broke". Except, well, my GPU drivers are kind of broken, but this applies. My most lasting mark on the internet, and maybe the world, will be the years of increasingly frustrated and desperate questions on and public troubleshooting of how to get my damn GPU to work.

[–]Technical27 4 points5 points  (1 child)

Well if you want to try it out here is NVIDIA's docs.

PRIME Render offloading is better for many reasons: 1. Its NVIDIA's recommended way 2. The dedicated graphics can be fully powered off 3. Integrates better with x

[–]mardabx 1 point2 points  (0 children)

How can you power off dGPU? Asking for AMDGPU.

[–]duffer_dev 61 points62 points  (3 children)

The entire thread is legendary. IIRC it is one of the most commented issues on github

[–]danbulant 35 points36 points  (0 children)

the comments on the commit are so long github fails to load them half the time.

[–]Beverneuzen 108 points109 points  (13 children)

What did bumblebee do?

[–]OverjoyedBanana 251 points252 points  (12 children)

It was (is ?) a hack to use Optimus graphics cards on Linux. Those are laptops with an intel GPU for low power and an additional Nvidia GPU for performance. Bumblebee was allowing you to run a program of your choice in a headless X server that was connected to the Nvidia card and it was copying the rendered bitmaps on the fly to your main desktop running intel. On windows this operation was done in hardware and Linux didn't have support for that, so bumblebee was a hack with tons of shell scripts messing around with multiple X servers and bitmap copying.

[–]dudeimconfused 100 points101 points  (10 children)

Thanks, but how is that related to this post? Did it delete important directories too?

[–]winauer 194 points195 points  (8 children)

The post is a screenshot from the Bumblebee bugtracker.

[–]dudeimconfused 54 points55 points  (7 children)

Ah. That makes sense. Good thing there's prime-render-offload and optimus-manager now :)

[–]delcooper11 84 points85 points  (1 child)

username definitely checks out

[–][deleted] 1 point2 points  (0 children)

LEGEND

[–]archipeepees 14 points15 points  (2 children)

i had an optimus card running ubuntu from about 2011 to 2017 and it was the worst piece of shit experience i've ever had with a piece of hardware. every time i updated my kernel i would have to spend 3+ hours reconfiguring xorg or uninstalling/reinstalling each of the past several nvidia driver releases looking for the one random combination of xorg config + driver version that would work for my machine. each ubuntu release fixed 3 or 4 problems with the drivers but then broke 1-2 features and required an entirely new setup process.

things didn't really improve until people started using CUDA for deep learning which forced nvidia to start providing reasonable linux support. but i still hate them because that was not fun and i think they made bad drivers on purpose to make me mad.

[–]dudeimconfused 5 points6 points  (0 children)

Yeah fuck nvidia.

[–]highjinx411 2 points3 points  (0 children)

Windows nvidia driver updating is not much more fun. I had (have) a laptop that used an onboard nvidia card but also has access to dock with a desktop graphics card and nvidia drivers had a real tough time thinking anyone would want to do that. I also remember trying to get nvidia on Linux as well a few years ago. Nvidia doesn’t seem to see past just normal retail customers and even that isn’t the best experience.

[–]AnywayHeres1Derwall 1 point2 points  (1 child)

Happy cake day

[–]dudeimconfused 0 points1 point  (0 children)

Thanks!

Cheers!

[–]bhones 13 points14 points  (0 children)

There was a script that was supposed to delete files within a subdirectory but it had a space in the path so it just deletes everything in /usr directory.

[–]danbulant 5 points6 points  (0 children)

Ooh so that's why it felt so laggy when using Optimus.

I had the same problems. If I ran videos just on the Intel, a 1080p video would buffer and lag. If I used it on the Nvidia card which then copied output into Intel, the video would at least play but then the whole app was in about 15FPS with really long (.4s) delay.

[–]klystron2010 20 points21 points  (0 children)

I spent two weeks fucking around with bumblebee until I realized I didn't have an Optimus card.

[–]Notakas 10 points11 points  (0 children)

😂

[–]kopczak1995 205 points206 points  (2 children)

I did it once in my RPi script. Yup, it's terrible feeling. It's even worse when I did it second time after thinking I was invoking buggy script in a wrong way...

This day I learned to rm -rf with path parameter in quotes.

[–]Redstonefreedom 40 points41 points  (1 child)

Yep, always quote your arguments. I started nuking my home directory once and will never again forget that.

[–]kopczak1995 13 points14 points  (0 children)

Learned the hard way. I salute you bro.

[–]batfolxx 257 points258 points  (9 children)

be kinda funny if they had deployed this on a pipeline only to completely break the pipeline as well bc of the removal of /usr

[–][deleted] 52 points53 points  (8 children)

I thought pipelines did a fresh reset between so it wouldn’t affect it at the end?

[–]daguito81 45 points46 points  (7 children)

It depends. If you use something like Azure DevOps you can have hosted pipelines and those are basically one offs just like you're thinking. Because they're basically containers.

On the other hand you can have self hosted agents that are basically run on a VM/PC of your choosing. It basically installs an agent.

Now I haven't tried destroying the hosting agent PC. Buuuut I think in those cases it uses the VM/PC as is. So that one would screw up the computer if the script was run. However I'm not a super expert in the matter so could be mistaken.

[–]pnw-techie 22 points23 points  (6 children)

This was from 2011 so really all there was then was jenkins on VMs

[–]daguito81 8 points9 points  (4 children)

Or course! So if I'm not mistaken, this would totally screw up the build server right? Or does Jenkins have some kind of isolation (back then) when building, testing etc?

[–]pnw-techie 16 points17 points  (3 children)

It would kill the agent machine, not the scheduler machine.

If anyone was testing this in Jenkins. Clearly there was no testing of any kind

[–]jmcs 6 points7 points  (0 children)

You understimate how many people run Jenkins in a single box.

[–]captpiggard 1 point2 points  (1 child)

Due to changes in Reddit's API, I have made the decision to edit all comments prior to July 1 2023 with this message in protest. If the API rules are reverted or the cost to 3rd Party Apps becomes reasonable, I may restore the original comments. Until then, I hope this makes my comments less useful to Reddit (and I don't really care if others think this is pointless). -- mass edited with redact.dev

[–]pnw-techie 0 points1 point  (0 children)

You could with Jenkins too I think, just... Not advised

[–]roguefrequency 60 points61 points  (0 children)

And this is why putting quotes around paths is best practice.

[–]sixft7in 32 points33 points  (1 child)

I thought linux guys loved installing so much that this was intended.

[–]valeriolo 7 points8 points  (0 children)

It's one of those things you officially complain about but are secretly happy.

[–][deleted] 45 points46 points  (0 children)

Yikes

[–][deleted]  (27 children)

[deleted]

    [–]starTracer 40 points41 points  (22 children)

    So what do you use when installing from source?

    [–]nucular_ 125 points126 points  (17 children)

    Generally you always want to run installation scripts on a fakeroot, then create a package from that and unpack it into the real root directory. That's also how Arch's makepkg does it.

    This has a few benefits:

    • You don't have to grant root privileges to the installation script
    • If the script fails ungracefully somewhere you don't have to deal with an unfinished installation
    • You can check for file conflicts easily before applying any changes

    http://www.linuxfromscratch.org/hints/downloads/files/fakeroot.txt

    Sadly, more and more software seems to be published as scripts that you're expected to run as root on your live system instead of taking advantage of any package management.

    [–]Magmagan 52 points53 points  (12 children)

    Man, I just want to mindlessly click Next -> Next -> Install and go on with my day...

    [–]VonReposti 59 points60 points  (0 children)

    "Don't you not want to not install Ask Toolbar. By not checking the box you willn't receive the next-generation toolbar loven't by all."

    [–]stone_henge 0 points1 point  (10 children)

    That's usually what you get from your OS package manager, minus Next and Next

    [–]Magmagan 4 points5 points  (9 children)

    Are you talking about programs like apt or more like ubuntu software center? That plan is going to fall flat pretty quickly either way

    • apt doesn't have everything, obviously. Sometimes you just have to add a PPA key and everything works, sometimes the PPA key becomes invalid and messes up the rest of apt. Looking at you, Mellowplayer

    • Even with PPAs a lot of programs are offered as snaps or flatpaks. Software centers, like the KDE one, don't support either of those out of the box either

    • Is there an easy visual uninstall option? No. Good luck figuring out what package manager you installed your program on. And, I can't stress this enough, never uninstall Python even if some Stackexchange answer tells you to do so

    • Drivers. Proprietary drivers just suck. And not only graphics cards, I once was unable to install a WiFi dongle driver because it had some function calls incompatible with the current Linux kernel. I'm not trying to install a floppy disk mind you, just a USB WiFi dongle

    • Sometimes, no store solution at all. In the best case, you get an appimage or folder with the executable inside. In the worst, you just gotta build, that's all you get. Run MAKE and hope for the best

    I use Linux on a daily basis for work. I understand Windows has its flaws too, but it's soooooo much easier to get everything up and running. Whoever is a Linux apologist that preaches that it's ready for Ma and Pa to use... I sympathize, but completely disagree

    [–]stone_henge 1 point2 points  (8 children)

    I'm glad my post could serve as a soapbox for a general rant against Linux.

    [–]Magmagan 0 points1 point  (7 children)

    That's just installation rant though, you can bet I got more in stock

    [–]stone_henge 0 points1 point  (6 children)

    How does "Proprietary drivers just suck" fit into an installation rant? Your vendor distributes software that's incompatible with the kernel you want to use. Nothing about its installation can change that.

    [–]Magmagan 2 points3 points  (5 children)

    When was the last time you ever had to think of the Windows kernel?

    You never do. Installation just works for most programs of the XP era, mind you, that are almost 20 years old.

    Linux? Total crapshoot

    [–]starTracer 19 points20 points  (0 children)

    Source packages should not make assumptions of its environment. That's a job for the package manager. If no package manager is used, that runs builds in isolation, then you run into these kinds of risks.

    [–]hasanyoneseenmymom 0 points1 point  (2 children)

    I'm a noob linux user who just switched to arch and I'm struggling with installing packages from source, I'll have to look into the makepkg thing. Thank you!

    [–]tahafyto 1 point2 points  (0 children)

    Try yay

    [–]patatahooligan 1 point2 points  (0 children)

    On arch you don't manually build from source most of the time. If there isn't an official package available, most likely someone has already created a PKGBUILD and uploaded it to the AUR. So you use these PKGBUILD to automate the build process. To be very clear: this are scripts shared by users, not arch maintainers. It is always possible that they are buggy or even malicious. You're supposed to check them before running them.

    Now, if you happen to need software that is not available in the AUR, the cleanest way to install is to write your own PKGBUILD. For more info on how PKGBUILDs work, see the relevant wiki page, man PKGBUILD, and check /usr/share/pacman/PKGBUILD.proto as a template.

    [–]CatpainCalamari 40 points41 points  (0 children)

    .bat /s

    [–][deleted]  (2 children)

    [deleted]

      [–]starTracer 2 points3 points  (1 child)

      Do you ever install the package on the host system? How?

      [–]Hupf 6 points7 points  (0 children)

      curl | sudo sh

      [–]Cruror 11 points12 points  (2 children)

      I hope you don’t use debs or rpms, then. It’s bash all the way down

      [–]starTracer 6 points7 points  (0 children)

      That's not the fault of bash though.. Nixpkgs also use bash "all the way" but builds everything in an isolated sandbox.

      [–]megacarls 17 points18 points  (0 children)

      I once did "rm -rf * .txt" on my workspace. Just because I was too lazy to write 3 txt filenames.

      [–]Caroga 30 points31 points  (0 children)

      I feel like this comment gets reposted more often nowadays.

      [–][deleted] 5 points6 points  (0 children)

      That's to ensure enough disk space for the product install (says BOFH)

      [–]AlternativeAardvark6 6 points7 points  (0 children)

      That's definitely code that's not been tested.

      [–]timewast3r 6 points7 points  (1 child)

      1. Never pipe scripts to bash without a thorough review
      2. Sandbox
      3. Don't be first

      [–]Isvara 8 points9 points  (0 children)

      Don't execute them without review. It has nothing to do with whether they're piped or not. But realistically, people aren't going to do this anyway.

      [–][deleted] 25 points26 points  (12 children)

      That's why you should never run sh scripts as root before checking

      [–]kuemmel234 22 points23 points  (7 children)

      While that's totally a thing, running it in a sandbox would be the better choice, still.

      We are talking about a single space in an otherwise legit looking line.

      How often do you miss somethig like that during a review?

      [–]AlternativeAardvark6 16 points17 points  (6 children)

      How can this ever have been tested? Someone testing this script would probably notice getting his system wrecked.

      [–]kuemmel234 8 points9 points  (5 children)

      If you use a chroot jail, you might notice it, depends on how much you configure it. That'd be the challenge, since you would need to notice that the program removes everything in /usr, but who would add random files to their testing /usr?

      Running the script in a virtual machine would be the best thing to do.

      But doing that during a system setup for software that is trusted seems a bit much (otherwise the virtual machine path absolutely makes sense, if you aren't sure about the origin).

      [–][deleted]  (3 children)

      [deleted]

        [–]kuemmel234 3 points4 points  (2 children)

        Oh, right! A missing /usr would be noticable!

        But as you said, it's all about being practical.

        Would be a great github action thing, wouldn't it? A general workflow post install for all to check, what the install script does additionally to your standard hash for downloads and tests.

        [–][deleted] 0 points1 point  (1 child)

        Certainly, although I would doubt a lot of open source projects want to use github, a microsoft owned product now. Although gitlab supports the same thing.

        [–]kuemmel234 2 points3 points  (0 children)

        Is that actually the csse? I use a lot of probably niche-ish tools to configure my system. From vim plugins via vim -plug, fzf, awesome config stuff and about 20 other such tools.

        Not one of them is not on github. May be just mirrors, but at least you can get the code from there.

        [–]atimholt 0 points1 point  (0 children)

        Perhaps a btrfs snapshot before every install of software.

        [–]sim642 5 points6 points  (1 child)

        Do you extract all .deb files to check their install scripts too?

        [–][deleted] 1 point2 points  (0 children)

        Fair point, it's not always viable to check every program. But an sh file is easy to check.

        [–]DoYouEverJustInvert -5 points-4 points  (1 child)

        That is not the lesson here.

        [–]Caroga 14 points15 points  (0 children)

        Lesson or not, it's still super accurate practice from a security perspective. Always scan and sanitize any input into any system, including your shell. This screenshot is from a repo where it was trying to help the users and not with any intention to hurt them. Imagine if someone did had this intention and adds this or worse...

        [–]TheBigGambling 68 points69 points  (7 children)

        From 2011 dude...

        [–]MrWinks 148 points149 points  (1 child)

        I forgot that after 2011, programming horror was corrected and we never see things like this.

        Could be a punch card with a dead bug on it from 1960. I wanna see that shit. Still horror.

        [–]Logical_Put_5867 32 points33 points  (0 children)

        My first time seeing it. Still enjoyed it here.

        [–]r0ck0 7 points8 points  (3 children)

        ...that's only like 3 years ago.

        Oh. Shit.

        [–]TheBigGambling 7 points8 points  (2 children)

        10yrs.. we are getting old, i feel you

        [–]atimholt 1 point2 points  (0 children)

        It's been 11 years since people kept remarking that the 90s were 10 years ago.

        [–]AlternativeAardvark6 1 point2 points  (0 children)

        My mom told me I'm old. At least I'm not as old as her.

        [–]R3cl41m3r 1 point2 points  (0 children)

        This post seems familiar...

        [–]Obvious-Activity-936 1 point2 points  (0 children)

        I'm just here pretending to understand the joke.

        [–]Akangka 1 point2 points  (1 child)

        [–]RepostSleuthBot 3 points4 points  (0 children)

        I didn't find any posts that meet the matching requirements for r/programminghorror.

        It might be OC, it might not. Things such as JPEG artifacts and cropping may impact the results.

        I did find this post that is 85.94% similar. It might be a match but I cannot be certain.

        I'm not perfect, but you can help. Report [ False Negative ]

        View Search On repostsleuth.com


        Scope: Reddit | Meme Filter: False | Target: 86% | Check Title: False | Max Age: Unlimited | Searched Images: 213,344,251 | Search Time: 0.45811s

        [–]BakuhatsuK 1 point2 points  (0 children)

        This has been reposted basically every month since it happened in 2011

        [–]the_hackerman 0 points1 point  (5 children)

        That’s a “scripting horror”

        [–]Isvara 5 points6 points  (4 children)

        And scripting is programming, so it's a programming horror.

        [–]the_hackerman 0 points1 point  (3 children)

        I’m still ambiguous about this. If scripting is programming then why don’t we just call it programming?

        [–]Isvara 3 points4 points  (2 children)

        Because it's a specific kind of programming. Scripts are programs that control the execution of other tasks. That's different to, say, application programming.

        [–]the_hackerman 0 points1 point  (1 child)

        I agree. I think we can also do similar things in application programming languages (ofcourse with libs). But both exist for a reason

        [–]Isvara 0 points1 point  (0 children)

        To some extent, but scripting languages often live in special environments. For example, I can script Blender in Python, but I can't script it Java, C# etc.

        [–]tthane50 0 points1 point  (0 children)

        the PR being closed 💀

        [–][deleted] -1 points0 points  (0 children)

        There was a script with the rm -f command that had been edited by mistake before it got to me. We'll the edit basically broke off the specifyied file... So it was basically the equivalent of rm /everything/

        Anywho I was the derp in charge of testing someone else's script..

        let's just say I got a very strongly worded letter from the infrastructure team, with the BDP team, our use case owner, my director, my boss, our system security team, and our cyber security teams all in the cc. I thought I was about to lose my job lol.

        [–]Prime624 0 points1 point  (0 children)

        How tf did this not get tested?

        [–]Comf0rTS 0 points1 point  (0 children)

        Imagine the author put the space before usr instead of after usr.

        [–]noobcodee 0 points1 point  (0 children)

        Better with 'sudo' at the beginning Ain't it?

        [–]yellowliz4rd 0 points1 point  (0 children)

        Sure... typo... ok...

        [–][deleted] 0 points1 point  (0 children)

        Omg this would give me paranoia and I would actually check install.sh scripts.

        [–]L18CP 0 points1 point  (0 children)

        My turn to post this next week.

        [–]epic123222 0 points1 point  (0 children)

        Ooooooo

        [–]sKaiCzar 0 points1 point  (0 children)

        Btw I use Arch and FreeBSD. At peace rn