How to stop dotnet?



  • I've been playing around with ASP.NET Core a bit (just to keep my C# up to snuff). I made a terrible mistake of doing this on Windows, so now I am stuck with STUPID FUCKING file locking situation, as it always happens to me.

    There are several background processes holding locks to built .dll-s in the bin folder.

    0_1537108798339_0c124bb8-3533-4c7b-9fe6-5b0073048522-image.png

    Unlocker can't unlock them.

    When I try to kill the processes directly, I get this:

    0_1537108968606_53696d27-4396-48bf-a995-d2c8986ec13a-image.png

    How is task manager, running as Administrator, unable to kill a (what I suppose is) userland program? How can anyone get anything serious done on fucking Windows these days, this is ridiculous.

    Anyone has any idea what else can I try (other than restart computer)? And how to prevent this from happening again (other than moving to Linux)?



  • BTW, the way this situation hit me was when I tried to create a new migration and the dotnet ef tool got stuck on a blank screen.

    I tried it with the -v flag and learned it was stuck in an endless loop, trying to write DLL over a locked DLL.

    0_1537109448289_d8514080-8dcf-4a11-9f3a-0ea62adbf0ea-image.png

    Even MS-s tooling doesn't know how to deal with this locking shit on their own OS. What a mess.



  • Do you have Process Explorer from SysInternals?

    One nice thing it can do is show a process tree. Usually when I'm unable to kill a process, it's because the process has already crashed and it's just being held in memory by WerReporter or whatever it's called while it takes a dump.

    ProcExp's tree mode can also be useful for finding worker processes that didn't notice their parent had died. A few VS2017 versions ago, it liked to spam cmd.exe processes that would stick around forever, for example.



  • @ben_lubar

    Good idea, but no dice.
    0_1537110853753_06dfece3-2053-4845-85f4-cae68dd91906-image.png

    Looking at the CMD, it seems that all 3 processes are dotnet ef commands, trying to create a migration file, holding each other in a deadlock.

    But why are they immune to the system killing them? What kind of weak-ass shit is that?



  • Wow. Everyone has problems like this.

    There are like 100 ways you can kill a process on Windows, and none work for me.

    I give up. I'm restarting and hoping this doesn't happen again, I guess.



  • @cartman82 said in How to stop dotnet?:

    I made a terrible mistake of doing this on Windows,

    Dows linux already have decent tools for .net?


  • BINNED

    @cartman82 said in How to stop dotnet?:

    @ben_lubar

    Good idea, but no dice.

    Did you look at the parents as @ben_lubar said? Can't tell from that screenshot.



  • @sockpuppet7 said in How to stop dotnet?:

    Dows linux already have decent tools for .net?

    Theoretically. In practice, every time I tried playing with .NET core on linux so far, it ended up crashing.

    On Windows at least it hasn't crashed... so far.



  • @topspin said in How to stop dotnet?:

    Did you look at the parents as @ben_lubar said? Can't tell from that screenshot.

    Yes. It was conhost at some point. Then when I closed the console, it remained "orphaned", but still wouldn't go away.

    As the SO thread suggests, I suspect the code to create a file went into a dead loop waiting on drive to respond (which it never did, because of locking), so it didn't see kill flags system was setting. So, either a bad driver or .NET tried to sneak in some buggy low level code and it crapped out.


  • kills Dumbledore

    When this has happened to me, I've found renaming the files is allowed and lets visual studio copy the new version in. Once it's built the renamed dll (I usually change the extension to .FUCKYOUVS) can be deleted



  • Oh great. It's the same exact shit after restart.

    It gets stuck after this:

    0_1537118717082_d7e3c818-3eb8-4128-b066-12480a6aa981-image.png

    I can cancel it, but it stays running in the background and keeping the locks.

    So it's not just some one-off fluke. Seems like .NET Core or EF are broken in some way.



  • @cartman82

    0_1537122241372_52f5b6ab-96b4-4d77-b5a9-668f592a47cc-image.png

    Oh wow. It works on Linux.

    So even Microsoft doesn't seem to care about poor old Windows anymore. They even don't list it as no 1 platform.

    0_1537122354370_1539e650-c57a-4d99-a20b-1169b35cae26-image.png



  • @cartman82 Windows, failing at basic functionality, etc.



  • @cartman82 said in How to stop dotnet?:

    so it didn't see kill flags system was setting

    On Linux, this wouldn't happen because SIGKILL doesn't ask the process for permission.



  • @ben_lubar said in How to stop dotnet?:

    so it didn't see kill flags system was setting

    On Linux, this wouldn't happen because SIGKILL doesn't ask the process for permission.

    Actually, similar thing happened to me once with a corrupted ZFS partition on FreeBSD. Terminal would go into a dead loop while listing directory and even SIGKILL -9 couldn't stop it.

    I haven't seen it on linux proper so far, though.



  • @cartman82 said in How to stop dotnet?:

    @ben_lubar said in How to stop dotnet?:

    so it didn't see kill flags system was setting

    On Linux, this wouldn't happen because SIGKILL doesn't ask the process for permission.

    Actually, similar thing happened to me once with a corrupted ZFS partition on FreeBSD. Terminal would go into a dead loop while listing directory and even SIGKILL -9 couldn't stop it.

    I haven't seen it on linux proper so far, though.

    I've gotten similar results out of unmounting a partition while the kernel was reading from it.



  • @ben_lubar said in How to stop dotnet?:

    @cartman82 said in How to stop dotnet?:

    so it didn't see kill flags system was setting

    On Linux, this wouldn't happen because SIGKILL doesn't ask the process for permission.

    It doesn't ask the process for permission, but it can still only actually terminate it when it gets into schedule(). Normally it wakes it up, which causes either kernel entry or exit and those hit the appropriate termination check immediately. But if the process is in TASK_UNINTERRUPTIBLE state, it might remain sitting there for unbounded amount of time.

    @cartman82 said in How to stop dotnet?:

    I haven't seen it on linux proper so far, though.

    NFS is/was rather notorious for this if the network went down.


  • Java Dev

    @cartman82 said in How to stop dotnet?:

    I haven't seen it on linux proper so far, though.

    PACKET_MMAP forcing out pages in use by NFS, while the remote wasn't responding.

    I've also run into that with a size argument larger than total system memory. Ends with the OOM killer killing absolutely everything except the process responsible, because that system call is not interruptible.


  • Notification Spam Recipient

    @cartman82 I would first assume you contracted a virus, but I'll read on withholding my judgement...


  • 🚽 Regular

    @cartman82 said in How to stop dotnet?:

    So, either a bad driver or .NET tried to sneak in some buggy low level code and it crapped out

    Seems likely, you should be able to find out what it's cocked-up if you care:

    https://blogs.technet.microsoft.com/markrussinovich/2005/08/17/unkillable-processes/

    Just a thought though, I wonder if you can murder the lock on that file with ProcessExplorer (find handle feature) and then delete that DLL and create a folder called 'WebUI.dll' in that directory. Possibly it might fail in a more constructive way and clear whatever shenanigans is occurring?



  • @cartman82 sure... I'm a DotNet developer, core is shit and really is not dotnet regardless of the lies told by everyone including MS.
    There is the dotnet standard library which is what actually interfaces with windows. Then there is the dotnet runtime which is the dotnet environment we all know and some of us love. then there is core, incompatible with the dotnet runtime, both this and the runtime sit on top of the standard library. The issue you have with core are core issues, with the core environment and should be purged from MS like last year after they went through a complete and total re-write of the thing after realizing there were major issues. Won't happen though, instead they will kill the dotnet runtime and make everything core but write their own apps in their own in house language managed so much better on their servers just to support subscritptions to your own computer.

    Yes I love the dotnet frameworks, I've made a living out of them for a long time, maybe that's the problem and just want MS off my lawn now.


  • Garbage Person

    @cartman82 said in How to stop dotnet?:

    @ben_lubar

    Good idea, but no dice.
    0_1537110853753_06dfece3-2053-4845-85f4-cae68dd91906-image.png

    Looking at the CMD, it seems that all 3 processes are dotnet ef commands, trying to create a migration file, holding each other in a deadlock.

    But why are they immune to the system killing them? What kind of weak-ass shit is that?

    This is the system punishing you for using EF.

    Stop it. Entity Framework is fucking cancer.


  • Considered Harmful

    @Weng No.



  • @Weng said in How to stop dotnet?:

    @cartman82 said in How to stop dotnet?:

    @ben_lubar

    Good idea, but no dice.
    0_1537110853753_06dfece3-2053-4845-85f4-cae68dd91906-image.png

    Looking at the CMD, it seems that all 3 processes are dotnet ef commands, trying to create a migration file, holding each other in a deadlock.

    But why are they immune to the system killing them? What kind of weak-ass shit is that?

    This is the system punishing you for using EF.

    Stop it. Entity Framework is fucking cancer.

    In related news, I tried using SWIG yesterday on the Steam API and VSCode promptly froze (while still responding to the event loop so that Windows wouldn't know it had frozen). It immediately froze every time I killed and restarted it until I deleted the SWIG output.



  • @ben_lubar said in How to stop dotnet?:

    until I deleted the SWIG output

    Well, it was apparently trying to parse that output for DebilliSense™ or something. But what the hell could SWIG generate so poisonous.



  • @Bulb said in How to stop dotnet?:

    But what the hell could SWIG generate so poisonous.

    Imagine the worst generated wrapper code you've ever seen in a file that's like 300 megabytes.


  • And then the murders began.

    @Weng said in How to stop dotnet?:

    This is the system punishing you for using EF.

    Stop it. Entity Framework is fucking cancer.

    On the one hand: you're not wrong.

    On the other hand: I really like Automapper being able to do projections for me, instead of having to hand-write SQL for each and every view model class I use.

    Sure, if you're relying on lazy loading you can get some really dumb shit, but fortunately EF Core turns that off by default.



  • @Unperverted-Vixen It would be nice if Entity Framework supported features SQL Server has had for a decade, like using a user-defined table variable as SPROC input. It would also be nice if it recognized primary keys that were defined as (NewSequentialId()) (which is not only perfectly cromulent, but best practice if you're planning to shard out in the future) but fucking SSMS has trouble with that one, too.

    What kind of weird-ass bizarro universe are we in where the core product functionality changes like 3 times faster than the tool makers can keep up.



  • @Weng said in How to stop dotnet?:

    This is the system punishing you for using EF.
    Stop it. Entity Framework is fucking cancer.

    I was just following tutorial like a good little boy.

    It's amazing this is the third time I tried and I am still unable to finish even the most basic .NET Core walkthrough without issues. How are MS dreaming of getting linux/OSS folk onto their platform when even the most basic shit doesn't work? Even their own captive audience / C# people are mostly sticking with .NET classic 4.x, as far as I can tell.



  • @cartman82 said in How to stop dotnet?:

    It's amazing this is the third time I tried and I am still unable to finish even the most basic .NET Core walkthrough without issues. How are MS dreaming of getting linux/OSS folk onto their platform when even the most basic shit doesn't work?

    (troll icon whichever one you like)

    Maybe because since the OSS stuff also doesn't work, they think that's a desirable trait to pull those people in?

    @cartman82 said in How to stop dotnet?:

    Even their own captive audience / C# people are mostly sticking with .NET classic 4.x, as far as I can tell.

    Don't worry, it gets worse every year and it won't be long before .NET Classic also doesn't fucking work at all. It'll catch up.



  • @cartman82 said in How to stop dotnet?:

    How are MS dreaming of getting linux/OSS folk onto their platform when even the most basic shit doesn't work?

    Those people are happy to find hacky workarounds for everything. They expect things to be broken all the time.

    @cartman82 said in How to stop dotnet?:

    Even their own captive audience / C# people are mostly sticking with .NET classic 4.x, as far as I can tell.

    Because it's better. Core only exists because of tinkery linux people who love broken software.



  • @Magus said in How to stop dotnet?:

    Core only exists because of tinkery linux people who love broken software.

    If I loved broken software, I would move back to Windows where I could enjoy Windows Update 🍹



  • @Magus said in How to stop dotnet?:

    Because it's better. Core only exists because of tinkery linux people who love broken software.

    I had some vague ideas of maybe including some C# stuff in my company's current projects. C# is an excellent language, it's strongly typed, well optimized and has powerful tooling. All good things.

    But Windows is a deal breaker. The time of getting Windows Server and SQL Server and Windows admin to manage it has passed, at least for startups. It's not gonna happen. If I can't get reliable C# working on nix, .NET out of the picture. We'll probably use golang instead.



  • @TimeBandit Have fun running games in a prerelease version of a library that only works on a newer kernel than your distro officially supports I guess.



  • @cartman82 Sadly I don't think there are any good languages that do what C# does. Java's closest, but. Java.

    I think Rust is kind of aiming towards that area, but my understanding is that it's far from production-ready.



  • @cartman82 Have fun turning the world into broken Javascript like everyone else, then.



  • @Magus said in How to stop dotnet?:

    Have fun running games in a prerelease version of a library that only works on a newer kernel than your distro officially supports I guess.

    When I want to play games, I boot the toy OS :trollface:



  • @TimeBandit Yeah, it's really great how it has all these features you don't, but you can still think of it as a toy.



  • @blakeyrat said in How to stop dotnet?:

    @cartman82 Sadly I don't think there are any good languages that do what C# does. Java's closest, but. Java.
    I think Rust is kind of aiming towards that area, but my understanding is that it's far from production-ready.

    Rust is completely different IMO. They are trying to do uber low levelly speed and safety at the same time. C# is much more practical in terms of speed, taking the hit of garbage collection for the sake of developer ergonomics. Also, rust tooling is absolutely atrocious.



  • @Magus said in How to stop dotnet?:

    @cartman82 Have fun turning the world into broken Javascript like everyone else, then.

    I already am, it's a blast. Thanks.



  • @Magus said in How to stop dotnet?:

    it's really great how it has all these features you don't

    What features?

    A task manager that can't kill a process?
    File locking only a reboot will fix?

    Thanks, but I can live without it 🐠



  • @PleegWat said in How to stop dotnet?:

    NFS

    NFS is always a bitch if the server goes away. 99% of the times I was asked to reboot a server, NFS was the culprit.



  • @TimeBandit The software doing that is broken on every OS, in one way or another. .Net Core is bad.



  • @Magus said in How to stop dotnet?:

    The software doing that is broken on every OS, in one way or another. .Net Core is bad.

    Not disputing that .NET Core is bad, but if a rogue process can lock a file and nothing can kill it beside a reboot, the OS is broken 🤷🏻♂

    FileUnder: kill -9


  • BINNED

    @TimeBandit said in How to stop dotnet?:

    @Magus said in How to stop dotnet?:

    The software doing that is broken on every OS, in one way or another. .Net Core is bad.

    Not disputing that .NET Core is bad, but if a rogue process can lock a file and nothing can kill it beside a reboot, the OS is broken 🤷🏻♂

    FileUnder: kill -9

    Hey, if we're in trolling territory anyway:
    At least in Windows I can write the equivalent of malloc(100000000000); and get an out of memory exception I can catch and handle, instead of OOM killer deciding my Firefox process has been running for too long already.
    Talk about broken.



  • @topspin said in How to stop dotnet?:

    At least in Windows I can write the equivalent of malloc(100000000000); and get an out of memory exception I can catch and handle, instead of OOM killer deciding my Firefox process has been running for too long already.

    I did this "successfully" once on both Windows and Linux. The size was some sort of worst-case that we'd estimated. We'd ask for memory, and it happened to work under 32-bit Windows, and 64-bit Linux. On 64-bit Windows, we'd get a hard error ... and, of course, it was an external person who found this.

    Turns out that our worst-cast estimate was a bit pessimistic. Pessimistic enough to overflow a 32-bit integer and end up with something that was still sufficiently large in practice. Linux on the other hand would happily reserve that amount of address space, and since we'd never touch most of it, there were no real consequences to that either.

    (Yes, yes, the random anecdotes thread is :arrows: .)



  • @cartman82 you're late to the game. Had a ".NET Core is fucking broken" thread around here somewhere. It sucks that you wasted your time but stay the fuck away from anything MS for your own good. .NET Core fuckups are nothing compared to Azure fuckery. They could have made .NET better but instead they had to go the OSS way. What a waste of C#.


  • Discourse touched me in a no-no place

    @ben_lubar said in How to stop dotnet?:

    @Bulb said in How to stop dotnet?:

    But what the hell could SWIG generate so poisonous.

    Imagine the worst generated wrapper code you've ever seen in a file that's like 300 megabytes.

    Generated code tends to be hell to handle. If there are parser bugs, that's where you'll see them. If there are weird optimiser limits, that's where they'll show up.


  • Discourse touched me in a no-no place

    @topspin said in How to stop dotnet?:

    At least in Windows I can write the equivalent of malloc(100000000000); and get an out of memory exception I can catch and handle, instead of OOM killer deciding my Firefox process has been running for too long already.

    I've got a server at work with enough memory in it that the VMs it runs could all do that size of allocation at once and everything would keep running. ;)



  • @blakeyrat said in How to stop dotnet?:

    I think Rust is kind of aiming towards that area, but my understanding is that it's far from production-ready.

    Rust itself is perfectly production ready, but the libraries obviously have quite a few years to catch up, so there is fewer of them and/or they have fewer features.


Log in to reply