Code Monkey home page Code Monkey logo

Comments (10)

Lithopsian avatar Lithopsian commented on July 23, 2024

When I said "reliably", I may have been a bit too optimistic. I can reproduce it every time with that exact directory, but on others the cleanup works without crashing. I haven't been able to spot which ones cause a crash and which ones don't, but it seems consistent: directories which crash once crash every time; those that don't crash never crash.

from qdirstat.

shundhammer avatar shundhammer commented on July 23, 2024

Hm - I use that cleanup all the time (with its default refresh policy), but also quite some that use assume deleted, and I never got a crash.

For debugging, you can also simply use a cleanup that does nothing (a command like echo hello) and a refresh policy of assume deleted; that makes it a lot easier.

from qdirstat.

Lithopsian avatar Lithopsian commented on July 23, 2024

Here is the stack trace from the debug build at the offending line. Can't be good that this is 0x00.
Screenshot_2024-01-26_14-59-42
Don't know if this tells you anything new, but it shows which call is responsible.
Screenshot_2024-01-26_15-00-11
This is the non-debug stack trace at the crash. Maybe there is something in there that helps.
Screenshot_2024-01-26_15-05-24

from qdirstat.

shundhammer avatar shundhammer commented on July 23, 2024

I wonder if that is connected to the recent changes to the future selection.

from qdirstat.

shundhammer avatar shundhammer commented on July 23, 2024

I added this cleanup that only deletes an item from the in-memory DirTree:

[Cleanup_99]
Active=true
AskForConfirmation=false
Command=echo %n
Hotkey=F8
OutputWindowAutoClose=false
OutputWindowPolicy=ShowNever
Recurse=false
RefreshPolicy=AssumeDeleted
Title=Ghost-kill
WorksForDir=true
WorksForDotEntry=true
WorksForFile=true

So far, I could not reproduce the problem.

from qdirstat.

shundhammer avatar shundhammer commented on July 23, 2024

I also tried it with Recurse=true, but that still doesn't change anything.

But maybe it does sometimes; because that "Delete Junk files" cleanup is called recursively, and it's called top-down. That might actually be a problem when the call to the subtree root is removed first from the DirTree. Please check.

from qdirstat.

shundhammer avatar shundhammer commented on July 23, 2024

I added a sleep 1 to the command, and now it does crash.

AFAICS the order of actions is wrong: It deletes the in-memory subtree too early, and then it recurses into any subdirectories - with the pointers to those subdirectories and/or the subtree root already being invalidated.

Probably both the recursing and the cleanup taking a little while are the key here.

from qdirstat.

shundhammer avatar shundhammer commented on July 23, 2024

Now preventing recursion together with refresh policy "Assume Deleted".

Since this is a completely artificial scenario anyway, I am not going to add a ton of code to do something complex like the delayed Refresher which triggers a subtree refresh after the processes that might still be in the queue of the OutputWindow are all done.

You can now select either recursion or the "Assume Deleted" refresh policy, but not both. The cleanup config page now checks that and disables the "Recurse" checkbox if "Assume Deleted" is selected, and posts a warning pop-up.

On the execution side, the cleanup itself now checks the same thing and logs an error if needed and does not recurse: The user can still edit the config file manually, so it needs to be checked when the cleanup is actually used.

from qdirstat.

shundhammer avatar shundhammer commented on July 23, 2024

no-recursion

from qdirstat.

Lithopsian avatar Lithopsian commented on July 23, 2024

Maybe a little late, but I already tested if recursion was the culprit. It seemed like a good candidate, but it doesn't make any difference here. I still don't have a definite combination of circumstances that will cause the crash, but being deeper in the directory tree seems to help.

So likewise, after these fixes, I still get the same crash after the same steps.

from qdirstat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.