https://bugs.kde.org/show_bug.cgi?id=518464

            Bug ID: 518464
           Summary: Logging race condition
    Classification: Applications
           Product: krita
      Version First 5.1.5
       Reported In:
          Platform: Other
                OS: Microsoft Windows
            Status: REPORTED
          Severity: crash
          Priority: NOR
         Component: * Unknown
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

SUMMARY
A friend had Krita crash a seemingly randomly while he's drawing, often while
saving files.
His Krita version is a bit older, but the issue I identified hasn't changed
between versions. 
I've looked at his logs, and one line had signs of a race condition:

"30 Mar 30 Mar 2026 16:02:32 -0400: Importing application/x-krita to
application/x-krita. Location: "

I have a theory - logFile.write() functions in KisUsageLogger aren't
thread-safe, so I used QMutexLocker to lock the writes.

STEPS TO REPRODUCE
1. Race conditions aren't easily reproduced, and I can't reproduce it on my
machine (my drives might be too fast for this to ever manifest)

OBSERVED RESULT
Random crashes, often during exporting animations.

EXPECTED RESULT
No random crashes

SOFTWARE/OS VERSIONS
Windows: 10

ADDITIONAL INFORMATION
I don't have an account on invent.kde.org, and I'm not sure my code quality is
up to KDE standards, so I'm going to attach my proposed patch here.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to