Discussion:
[Audacity-devel] bug1567-tidy is updated
Paul Licameli
2017-01-23 13:16:20 UTC
Permalink
I did git push -f to my origin. There are now three commits in the
branch. New branch head is:

https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b57cd075d9cd226cb591b939e5fc6c

The head includes the fork-and-crash fix, but could it be that we don't
need it, and the changes for cleanup of temporary files are enough?

To test whether that is so, you can checkout one or two commits before the
head. Using caret notation, you can name those as

4059b2ae^ and 4059b2ae^^

Two commits before head, you get just the change to the folder cleanup that
I wrote yesterday.

After seeing Gale's log messages, which suggest that removal of folders
does not succeed if done too soon after removal of the contents of the
folder, I added the other commit one before head. This inserts code to
delay between removing files and removing folders. As submitted, it simply
sleeps by a number that you can tune. But if you change #if 1 to #if 0,
then instead it tests in a loop whether it can detect completion of removal
of the files, but not exceeding the time limit.

So I suggest this testing:

1. See if 4059b2ae^^ is sufficient fo fix the problem of closing without
saving
2. If not, see if 4059b2ae^ does it, with a long enough sleep that is
not unreasonable
3. If #2 succeeds, verify that it also works when changing #if 1 to #if
0, but that the delays are now variable and shorter
4. If #1, #2, or #3 is enough to fix closing without saving, determine
whether it is enough for all symptoms of bug1567.

Also check that the log file no longer routinely contains (as master does,
even on my computer) error messages related to the temporary files.

PRL
Gale Andrews
2017-01-23 14:18:36 UTC
Permalink
Thanks, Paul. Are Peter or Cliff seeing the project folders in SessionData
get left behind? If so they should test too, after I figure out what combination
best deals with bug 1567 and we get that committed (all subject to RM
approval of course).


Gale
I did git push -f to my origin. There are now three commits in the branch.
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b57cd075d9cd226cb591b939e5fc6c
The head includes the fork-and-crash fix, but could it be that we don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of folders does
not succeed if done too soon after removal of the contents of the folder, I
added the other commit one before head. This inserts code to delay between
removing files and removing folders. As submitted, it simply sleeps by a
number that you can tune. But if you change #if 1 to #if 0, then instead it
tests in a loop whether it can detect completion of removal of the files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing without saving
If not, see if 4059b2ae^ does it, with a long enough sleep that is not
unreasonable
If #2 succeeds, verify that it also works when changing #if 1 to #if 0, but
that the delays are now variable and shorter
If #1, #2, or #3 is enough to fix closing without saving, determine whether
it is enough for all symptoms of bug1567.
Also check that the log file no longer routinely contains (as master does,
even on my computer) error messages related to the temporary files.
PRL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Peter Sampson
2017-01-23 14:38:21 UTC
Permalink
Post by Gale Andrews
Thanks, Paul. Are Peter or Cliff seeing the project folders in SessionData
get left behind? If so they should test too, after I figure out what combination
best deals with bug 1567 and we get that committed (all subject to RM
approval of course).
Can this be tested with the alpha nightlies Gale, or do we need a special
build?

Peter
Gale Andrews
2017-01-23 16:36:45 UTC
Permalink
On 23 January 2017 at 14:38, Peter Sampson
Post by Peter Sampson
Post by Gale Andrews
Thanks, Paul. Are Peter or Cliff seeing the project folders in SessionData
get left behind? If so they should test too, after I figure out what combination
best deals with bug 1567 and we get that committed (all subject to RM
approval of course).
Can this be tested with the alpha nightlies Gale, or do we need a special
build?
By all means you could test what I suggested to Cliff in the nightlies.

And when hopefully we commit the final solution, check that there are
no errors in the log (and no empty folders in SessionData, if you had
them using the nightlies).


Gale
Peter Sampson
2017-01-23 18:17:02 UTC
Permalink
Gale,

following the steps you gave for Cliff, testing on alpha built 23Jan
I get nothing left behind in the SessionData folderwhen I quit without
the save it all gets cleaned up nicely.

All seems fine on my Macbook Sierra 10.12.2 with this alpha.

Peter.
Cliff Scott
2017-01-23 15:19:41 UTC
Permalink
Last one I built was Jan. 16th Master and the SessionData contents are totally empty after quitting Audacity. Is there some special sequence that I need to test?

Cliff
Post by Gale Andrews
Thanks, Paul. Are Peter or Cliff seeing the project folders in SessionData
get left behind? If so they should test too, after I figure out what combination
best deals with bug 1567 and we get that committed (all subject to RM
approval of course).
Gale
I did git push -f to my origin. There are now three commits in the branch.
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b57cd075d9cd226cb591b939e5fc6c
The head includes the fork-and-crash fix, but could it be that we don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of folders does
not succeed if done too soon after removal of the contents of the folder, I
added the other commit one before head. This inserts code to delay between
removing files and removing folders. As submitted, it simply sleeps by a
number that you can tune. But if you change #if 1 to #if 0, then instead it
tests in a loop whether it can detect completion of removal of the files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing without saving
If not, see if 4059b2ae^ does it, with a long enough sleep that is not
unreasonable
If #2 succeeds, verify that it also works when changing #if 1 to #if 0, but
that the delays are now variable and shorter
If #1, #2, or #3 is enough to fix closing without saving, determine whether
it is enough for all symptoms of bug1567.
Also check that the log file no longer routinely contains (as master does,
even on my computer) error messages related to the temporary files.
PRL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Gale Andrews
2017-01-23 16:29:46 UTC
Permalink
Post by Cliff Scott
Last one I built was Jan. 16th Master and the SessionData contents
are totally empty after quitting Audacity. Is there some special sequence
that I need to test?
Just record, File > Close, don't save. New Project, record,
File > Close, don't save. I predicted you wouldn't have the
problem, being on a fast machine.


Gale
Post by Cliff Scott
Post by Gale Andrews
Thanks, Paul. Are Peter or Cliff seeing the project folders in SessionData
get left behind? If so they should test too, after I figure out what combination
best deals with bug 1567 and we get that committed (all subject to RM
approval of course).
Gale
I did git push -f to my origin. There are now three commits in the branch.
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b57cd075d9cd226cb591b939e5fc6c
The head includes the fork-and-crash fix, but could it be that we don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of folders does
not succeed if done too soon after removal of the contents of the folder, I
added the other commit one before head. This inserts code to delay between
removing files and removing folders. As submitted, it simply sleeps by a
number that you can tune. But if you change #if 1 to #if 0, then instead it
tests in a loop whether it can detect completion of removal of the files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing without saving
If not, see if 4059b2ae^ does it, with a long enough sleep that is not
unreasonable
If #2 succeeds, verify that it also works when changing #if 1 to #if 0, but
that the delays are now variable and shorter
If #1, #2, or #3 is enough to fix closing without saving, determine whether
it is enough for all symptoms of bug1567.
Also check that the log file no longer routinely contains (as master does,
even on my computer) error messages related to the temporary files.
PRL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Cliff Scott
2017-01-23 20:36:59 UTC
Permalink
Post by Gale Andrews
Post by Cliff Scott
Last one I built was Jan. 16th Master and the SessionData contents
are totally empty after quitting Audacity. Is there some special sequence
that I need to test?
Just record, File > Close, don't save. New Project, record,
File > Close, don't save. I predicted you wouldn't have the
problem, being on a fast machine.
You're correct. No problem. As soon as the window closes the project files disappear.

Cliff
Post by Gale Andrews
Gale
Post by Cliff Scott
Post by Gale Andrews
Thanks, Paul. Are Peter or Cliff seeing the project folders in SessionData
get left behind? If so they should test too, after I figure out what combination
best deals with bug 1567 and we get that committed (all subject to RM
approval of course).
Gale
I did git push -f to my origin. There are now three commits in the branch.
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b57cd075d9cd226cb591b939e5fc6c
The head includes the fork-and-crash fix, but could it be that we don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of folders does
not succeed if done too soon after removal of the contents of the folder, I
added the other commit one before head. This inserts code to delay between
removing files and removing folders. As submitted, it simply sleeps by a
number that you can tune. But if you change #if 1 to #if 0, then instead it
tests in a loop whether it can detect completion of removal of the files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing without saving
If not, see if 4059b2ae^ does it, with a long enough sleep that is not
unreasonable
If #2 succeeds, verify that it also works when changing #if 1 to #if 0, but
that the delays are now variable and shorter
If #1, #2, or #3 is enough to fix closing without saving, determine whether
it is enough for all symptoms of bug1567.
Also check that the log file no longer routinely contains (as master does,
even on my computer) error messages related to the temporary files.
PRL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
David Bailes
2017-01-24 13:48:12 UTC
Permalink
Post by Paul Licameli
I did git push -f to my origin. There are now three commits in the
https://github.com/Paul-Licameli/audacity/commit/
4059b2ae48b57cd075d9cd226cb591b939e5fc6c
The head includes the fork-and-crash fix, but could it be that we don't
need it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder cleanup
that I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of folders
does not succeed if done too soon after removal of the contents of the
folder, I added the other commit one before head. This inserts code to
delay between removing files and removing folders. As submitted, it simply
sleeps by a number that you can tune. But if you change #if 1 to #if 0,
then instead it tests in a loop whether it can detect completion of removal
of the files, but not exceeding the time limit.
1. See if 4059b2ae^^ is sufficient fo fix the problem of closing
without saving
2. If not, see if 4059b2ae^ does it, with a long enough sleep that is
not unreasonable
3. If #2 succeeds, verify that it also works when changing #if 1 to
#if 0, but that the delays are now variable and shorter
4. If #1, #2, or #3 is enough to fix closing without saving, determine
whether it is enough for all symptoms of bug1567.
Also check that the log file no longer routinely contains (as master does,
even on my computer) error messages related to the temporary files.
On Windows it's easy to monitor the file activity of a program using
sysinternal's process monitor. I had a quick look round to see if there was
something equivalent on Macs, and found this:
https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/Instrument-FileActivity.html

Those working on Macs may well be already be aware of this, but I thought
I'd mention it, just in case it was of any use in tracking down any
remaining issues on Sierra.

David.
Post by Paul Licameli
PRL
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Gale Andrews
2017-01-24 18:21:11 UTC
Permalink
Sigh. No effect on cleaning up folders or preventing 1567 occurring
on close without save.
I did git push -f to my origin. There are now three commits in the branch.
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b57cd075d9cd226cb591b939e5fc6c
The head includes the fork-and-crash fix, but could it be that we don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of folders does
not succeed if done too soon after removal of the contents of the folder, I
added the other commit one before head. This inserts code to delay between
removing files and removing folders. As submitted, it simply sleeps by a
number that you can tune. But if you change #if 1 to #if 0, then instead it
tests in a loop whether it can detect completion of removal of the files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing without saving
It doesn't stop bug 1567 occurring on close without save, even if the close
is on the final project window.

It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.

I see these two lines of this type in the log for each project:

16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559' couldn't
be deleted (error 66: Directory not empty)
If not, see if 4059b2ae^ does it, with a long enough sleep that is not
unreasonable
As submitted, does not clean up empty folders, same message in log.

The only change is the spinning beach ball for 5 seconds presumably while
the sleep is performed. So we know that the sleep there will have an
undesirable visual consequence and I did not bother extending the sleep.
If #2 succeeds, verify that it also works when changing #if 1 to #if 0, but
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on pressing "No" to
"Save changes?" with no beach ball. Log messages are unchanged.
If #1, #2, or #3 is enough to fix closing without saving, determine whether
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now launch
Audacity guaranteed not to have bug 1567 present, but 1567 can still
occur on close without saving.

At any of those three commits, manually deleting old project folders before
close without save still stops 1567 occurring, even if there are two or more
project windows open. But if SessionData contains any project folders
which are not in use, then 1567 can trigger on close without save.


Gale
Also check that the log file no longer routinely contains (as master does,
even on my computer) error messages related to the temporary files.
PRL
Paul Licameli
2017-01-24 21:20:55 UTC
Permalink
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567 occurring
on close without save.
Post by Paul Licameli
I did git push -f to my origin. There are now three commits in the
branch.
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/
4059b2ae48b57cd075d9cd226cb591b939e5fc6c
Post by Paul Licameli
The head includes the fork-and-crash fix, but could it be that we don't
need
Post by Paul Licameli
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits before
the
Post by Paul Licameli
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder cleanup
that
Post by Paul Licameli
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of folders
does
Post by Paul Licameli
not succeed if done too soon after removal of the contents of the
folder, I
Post by Paul Licameli
added the other commit one before head. This inserts code to delay
between
Post by Paul Licameli
removing files and removing folders. As submitted, it simply sleeps by a
number that you can tune. But if you change #if 1 to #if 0, then
instead it
Post by Paul Licameli
tests in a loop whether it can detect completion of removal of the files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing without
saving
It doesn't stop bug 1567 occurring on close without save, even if the close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder? No .au files
left in them? Could there be hidden files? Does ls -a from terminal list
anything else in them?
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559' couldn't
be deleted (error 66: Directory not empty)
Formerly there were more and different log messages, even on my computer.
You alone get these messages that the directory is not empty. But at this
point in the program, the call to delete the .au files has completed.
Post by Gale Andrews
Post by Paul Licameli
If not, see if 4059b2ae^ does it, with a long enough sleep that is not
unreasonable
As submitted, does not clean up empty folders, same message in log.
The only change is the spinning beach ball for 5 seconds presumably while
the sleep is performed. So we know that the sleep there will have an
undesirable visual consequence and I did not bother extending the sleep.
Post by Paul Licameli
If #2 succeeds, verify that it also works when changing #if 1 to #if 0,
but
Post by Paul Licameli
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on pressing "No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the .au files,
and then asks the file system whether the .au files are really gone, then
the answer it gets is yes, they are really gone.

So what could explain the anomaly that the log tells us the directories are
not empty? Some extraneous files are somehow added to the folders?

PRL
Post by Gale Andrews
Post by Paul Licameli
If #1, #2, or #3 is enough to fix closing without saving, determine
whether
Post by Paul Licameli
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now launch
Audacity guaranteed not to have bug 1567 present, but 1567 can still
occur on close without saving.
At any of those three commits, manually deleting old project folders before
close without save still stops 1567 occurring, even if there are two or more
project windows open. But if SessionData contains any project folders
which are not in use, then 1567 can trigger on close without save.
Gale
Post by Paul Licameli
Also check that the log file no longer routinely contains (as master
does,
Post by Paul Licameli
even on my computer) error messages related to the temporary files.
PRL
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Paul Licameli
2017-01-24 21:46:28 UTC
Permalink
Post by Paul Licameli
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567 occurring
on close without save.
Post by Paul Licameli
I did git push -f to my origin. There are now three commits in the
branch.
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b
57cd075d9cd226cb591b939e5fc6c
Post by Paul Licameli
The head includes the fork-and-crash fix, but could it be that we don't
need
Post by Paul Licameli
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits before
the
Post by Paul Licameli
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder cleanup
that
Post by Paul Licameli
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of folders
does
Post by Paul Licameli
not succeed if done too soon after removal of the contents of the
folder, I
Post by Paul Licameli
added the other commit one before head. This inserts code to delay
between
Post by Paul Licameli
removing files and removing folders. As submitted, it simply sleeps by
a
Post by Paul Licameli
number that you can tune. But if you change #if 1 to #if 0, then
instead it
Post by Paul Licameli
tests in a loop whether it can detect completion of removal of the
files,
Post by Paul Licameli
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing without
saving
It doesn't stop bug 1567 occurring on close without save, even if the close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder? No .au
files left in them? Could there be hidden files? Does ls -a from terminal
list anything else in them?
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559' couldn't
be deleted (error 66: Directory not empty)
Specifically there used to be "operation not permitted" messages in the
log, but now no longer, right? It is something, that the log is tidier,
even on my machine which does not suffer bug 1567.

Is this list of log messages complete?

I now notice this: you did NOT see a log message for the etc/e00/d00
directory. There should have been such a directory in the tree. So it may
not be that .au files are not cleaned up (in fact they should normally be
deleted already at this point), but rather that the d00 folder was not
removed.

So now I don't know what is going wrong:

Audacity did not attempt to remove d00.
Or it did, but that failed silently without a log message.
Or it did, but a sleep is needed before attempting to remove the folder
above it.

But this means I have not run out of experiments for you yet.

PRL
Post by Paul Licameli
Formerly there were more and different log messages, even on my computer.
You alone get these messages that the directory is not empty. But at this
point in the program, the call to delete the .au files has completed.
Post by Gale Andrews
Post by Paul Licameli
If not, see if 4059b2ae^ does it, with a long enough sleep that is not
unreasonable
As submitted, does not clean up empty folders, same message in log.
The only change is the spinning beach ball for 5 seconds presumably while
the sleep is performed. So we know that the sleep there will have an
undesirable visual consequence and I did not bother extending the sleep.
Post by Paul Licameli
If #2 succeeds, verify that it also works when changing #if 1 to #if 0,
but
Post by Paul Licameli
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on pressing "No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the .au
files, and then asks the file system whether the .au files are really gone,
then the answer it gets is yes, they are really gone.
So what could explain the anomaly that the log tells us the directories
are not empty? Some extraneous files are somehow added to the folders?
PRL
Post by Gale Andrews
Post by Paul Licameli
If #1, #2, or #3 is enough to fix closing without saving, determine
whether
Post by Paul Licameli
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now launch
Audacity guaranteed not to have bug 1567 present, but 1567 can still
occur on close without saving.
At any of those three commits, manually deleting old project folders before
close without save still stops 1567 occurring, even if there are two or more
project windows open. But if SessionData contains any project folders
which are not in use, then 1567 can trigger on close without save.
Gale
Post by Paul Licameli
Also check that the log file no longer routinely contains (as master
does,
Post by Paul Licameli
even on my computer) error messages related to the temporary files.
PRL
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Paul Licameli
2017-01-24 21:57:34 UTC
Permalink
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567 occurring
on close without save.
Post by Paul Licameli
I did git push -f to my origin. There are now three commits in the
branch.
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b
57cd075d9cd226cb591b939e5fc6c
Post by Paul Licameli
The head includes the fork-and-crash fix, but could it be that we
don't need
Post by Paul Licameli
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits before
the
Post by Paul Licameli
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder cleanup
that
Post by Paul Licameli
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of
folders does
Post by Paul Licameli
not succeed if done too soon after removal of the contents of the
folder, I
Post by Paul Licameli
added the other commit one before head. This inserts code to delay
between
Post by Paul Licameli
removing files and removing folders. As submitted, it simply sleeps
by a
Post by Paul Licameli
number that you can tune. But if you change #if 1 to #if 0, then
instead it
Post by Paul Licameli
tests in a loop whether it can detect completion of removal of the
files,
Post by Paul Licameli
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing without
saving
It doesn't stop bug 1567 occurring on close without save, even if the close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder? No .au
files left in them? Could there be hidden files? Does ls -a from terminal
list anything else in them?
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559' couldn't
be deleted (error 66: Directory not empty)
Specifically there used to be "operation not permitted" messages in the
log, but now no longer, right? It is something, that the log is tidier,
even on my machine which does not suffer bug 1567.
Is this list of log messages complete?
I now notice this: you did NOT see a log message for the etc/e00/d00
directory. There should have been such a directory in the tree. So it may
not be that .au files are not cleaned up (in fact they should normally be
deleted already at this point), but rather that the d00 folder was not
removed.
Audacity did not attempt to remove d00.
Or it did, but that failed silently without a log message.
Or it did, but a sleep is needed before attempting to remove the folder
above it.
But this means I have not run out of experiments for you yet.
PRL
So here is what you can do while I write something else: Verify that
folder .../e00/d00 exists before you close without saving. Do the close
without saving in HEAD, with its failed, incomplete cleanup. Is e00 still
present but e00/d00 removed?

If that is so, then this would suggest to me that Audacity did in fact
successfully find and remove the lowest-level folder, but the removal of it
is somehow asynchronously completed on Sierra, and Audacity should pause a
bit after removing each folder, before trying to remove its parent. There
may be many folders, so this must be a small pause at most, but maybe only
a few milliseconds after each is what we need.

PRL
Post by Paul Licameli
Post by Paul Licameli
Formerly there were more and different log messages, even on my
computer. You alone get these messages that the directory is not empty.
But at this point in the program, the call to delete the .au files has
completed.
Post by Gale Andrews
Post by Paul Licameli
If not, see if 4059b2ae^ does it, with a long enough sleep that is not
unreasonable
As submitted, does not clean up empty folders, same message in log.
The only change is the spinning beach ball for 5 seconds presumably while
the sleep is performed. So we know that the sleep there will have an
undesirable visual consequence and I did not bother extending the sleep.
Post by Paul Licameli
If #2 succeeds, verify that it also works when changing #if 1 to #if
0, but
Post by Paul Licameli
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on pressing "No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the .au
files, and then asks the file system whether the .au files are really gone,
then the answer it gets is yes, they are really gone.
So what could explain the anomaly that the log tells us the directories
are not empty? Some extraneous files are somehow added to the folders?
PRL
Post by Gale Andrews
Post by Paul Licameli
If #1, #2, or #3 is enough to fix closing without saving, determine
whether
Post by Paul Licameli
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now launch
Audacity guaranteed not to have bug 1567 present, but 1567 can still
occur on close without saving.
At any of those three commits, manually deleting old project folders before
close without save still stops 1567 occurring, even if there are two or more
project windows open. But if SessionData contains any project folders
which are not in use, then 1567 can trigger on close without save.
Gale
Post by Paul Licameli
Also check that the log file no longer routinely contains (as master
does,
Post by Paul Licameli
even on my computer) error messages related to the temporary files.
PRL
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Paul Licameli
2017-01-24 23:01:58 UTC
Permalink
Updated again:

https://github.com/Paul-Licameli/audacity/commit/0988c427b9efd31f26491712f01cc15b46dac085

Now there are four commits. The first should not fix the bugs but will be
desirable to avoid log messages about "operation not permitted." The
second does the insufficient, probably unnecessary, but harmless loop to
verify that .au files are removed, waiting at most one second.

What is interesting now is the third commit, which you can call 0988c427^
. Again, it adds a sleep that you can tune, but only 100 ms as written,
after removal of each folder. Again, you can change #if 0 to #if 1 so that
this number is an upper bound on the wait, which may be shorter. Again, I
want to know if this turns out to be sufficient to fix bug 1567, without
the branch tip commit, 0988c427.

PRL
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567 occurring
on close without save.
Post by Paul Licameli
I did git push -f to my origin. There are now three commits in the
branch.
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b
57cd075d9cd226cb591b939e5fc6c
Post by Paul Licameli
The head includes the fork-and-crash fix, but could it be that we
don't need
Post by Paul Licameli
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits
before the
Post by Paul Licameli
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder
cleanup that
Post by Paul Licameli
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of
folders does
Post by Paul Licameli
not succeed if done too soon after removal of the contents of the
folder, I
Post by Paul Licameli
added the other commit one before head. This inserts code to delay
between
Post by Paul Licameli
removing files and removing folders. As submitted, it simply sleeps
by a
Post by Paul Licameli
number that you can tune. But if you change #if 1 to #if 0, then
instead it
Post by Paul Licameli
tests in a loop whether it can detect completion of removal of the
files,
Post by Paul Licameli
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing without
saving
It doesn't stop bug 1567 occurring on close without save, even if the close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder? No .au
files left in them? Could there be hidden files? Does ls -a from terminal
list anything else in them?
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559' couldn't
be deleted (error 66: Directory not empty)
Specifically there used to be "operation not permitted" messages in the
log, but now no longer, right? It is something, that the log is tidier,
even on my machine which does not suffer bug 1567.
Is this list of log messages complete?
I now notice this: you did NOT see a log message for the etc/e00/d00
directory. There should have been such a directory in the tree. So it may
not be that .au files are not cleaned up (in fact they should normally be
deleted already at this point), but rather that the d00 folder was not
removed.
Audacity did not attempt to remove d00.
Or it did, but that failed silently without a log message.
Or it did, but a sleep is needed before attempting to remove the folder
above it.
But this means I have not run out of experiments for you yet.
PRL
So here is what you can do while I write something else: Verify that
folder .../e00/d00 exists before you close without saving. Do the close
without saving in HEAD, with its failed, incomplete cleanup. Is e00 still
present but e00/d00 removed?
If that is so, then this would suggest to me that Audacity did in fact
successfully find and remove the lowest-level folder, but the removal of it
is somehow asynchronously completed on Sierra, and Audacity should pause a
bit after removing each folder, before trying to remove its parent. There
may be many folders, so this must be a small pause at most, but maybe only
a few milliseconds after each is what we need.
PRL
Post by Paul Licameli
Post by Paul Licameli
Formerly there were more and different log messages, even on my
computer. You alone get these messages that the directory is not empty.
But at this point in the program, the call to delete the .au files has
completed.
Post by Gale Andrews
Post by Paul Licameli
If not, see if 4059b2ae^ does it, with a long enough sleep that is not
unreasonable
As submitted, does not clean up empty folders, same message in log.
The only change is the spinning beach ball for 5 seconds presumably while
the sleep is performed. So we know that the sleep there will have an
undesirable visual consequence and I did not bother extending the sleep.
Post by Paul Licameli
If #2 succeeds, verify that it also works when changing #if 1 to #if
0, but
Post by Paul Licameli
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on pressing "No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the .au
files, and then asks the file system whether the .au files are really gone,
then the answer it gets is yes, they are really gone.
So what could explain the anomaly that the log tells us the directories
are not empty? Some extraneous files are somehow added to the folders?
PRL
Post by Gale Andrews
Post by Paul Licameli
If #1, #2, or #3 is enough to fix closing without saving, determine
whether
Post by Paul Licameli
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now launch
Audacity guaranteed not to have bug 1567 present, but 1567 can still
occur on close without saving.
At any of those three commits, manually deleting old project folders before
close without save still stops 1567 occurring, even if there are two or more
project windows open. But if SessionData contains any project folders
which are not in use, then 1567 can trigger on close without save.
Gale
Post by Paul Licameli
Also check that the log file no longer routinely contains (as master
does,
Post by Paul Licameli
even on my computer) error messages related to the temporary files.
PRL
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Gale Andrews
2017-01-25 02:39:40 UTC
Permalink
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/0988c427b9efd31f26491712f01cc15b46dac085
Now there are four commits. The first should not fix the bugs but will be
desirable to avoid log messages about "operation not permitted." The second
does the insufficient, probably unnecessary, but harmless loop to verify
that .au files are removed, waiting at most one second.
What is interesting now is the third commit, which you can call 0988c427^ .
Again, it adds a sleep that you can tune, but only 100 ms as written, after
removal of each folder.
The only new behaviour with this commit is the progress dialogue for
cleaning up temporary files. This takes 75 seconds to complete. SessionData
contains six old projects, each with an empty e00 folder, plus the one
project which is the project just closed.

All the project*/e00 folders remain after this cleanup attempt.

Log (I added the line breaks for readability):

01:57:55: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344' couldn't be deleted
(error 66: Directory not empty)

01:58:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:10: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342' couldn't be deleted
(error 66: Directory not empty)

01:58:15: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:20: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621' couldn't be deleted
(error 66: Directory not empty)

01:58:25: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:30: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723' couldn't be deleted
(error 66: Directory not empty)

01:58:35: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:40: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266' couldn't be deleted
(error 66: Directory not empty)

01:58:45: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:50: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422' couldn't be deleted
(error 66: Directory not empty)

01:59:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528/e00' couldn't be
deleted (error 66: Directory not empty)
01:59:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528' couldn't be deleted
(error 66: Directory not empty)
Post by Paul Licameli
gain, you can change #if 0 to #if 1 so that this number is an upper bound
on the wait, which may be shorter.
This just adds the spinning beach ball lasting as long as the specified wait,
before the progress dialogue appears. I tried 5000 ms with no difference.
Post by Paul Licameli
Again, I want to know if this turns out to be sufficient to fix bug 1567, without the
branch tip commit, 0988c427.
No - it does not.

I tried deleting these same e00 and project* folders, one at a time in FileZilla
3.24.0, which uses wxWidgets 3.0.3. This deletion went without problem and
was instantaneous.

Manually deleting the .DS_Store files in the project* folders before asking
Audacity to delete the folders does not change anything.


Gale
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567 occurring
on close without save.
I did git push -f to my origin. There are now three commits in the branch.
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b57cd075d9cd226cb591b939e5fc6c
The head includes the fork-and-crash fix, but could it be that we don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of folders does
not succeed if done too soon after removal of the contents of the folder, I
added the other commit one before head. This inserts code to delay between
removing files and removing folders. As submitted, it simply sleeps by a
number that you can tune. But if you change #if 1 to #if 0, then instead it
tests in a loop whether it can detect completion of removal of the files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing without saving
It doesn't stop bug 1567 occurring on close without save, even if the close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder? No .au
files left in them? Could there be hidden files? Does ls -a from terminal
list anything else in them?
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559' couldn't
be deleted (error 66: Directory not empty)
Specifically there used to be "operation not permitted" messages in the
log, but now no longer, right? It is something, that the log is tidier,
even on my machine which does not suffer bug 1567.
Is this list of log messages complete?
I now notice this: you did NOT see a log message for the etc/e00/d00
directory. There should have been such a directory in the tree. So it may
not be that .au files are not cleaned up (in fact they should normally be
deleted already at this point), but rather that the d00 folder was not
removed.
Audacity did not attempt to remove d00.
Or it did, but that failed silently without a log message.
Or it did, but a sleep is needed before attempting to remove the folder
above it.
But this means I have not run out of experiments for you yet.
PRL
So here is what you can do while I write something else: Verify that
folder .../e00/d00 exists before you close without saving. Do the close
without saving in HEAD, with its failed, incomplete cleanup. Is e00 still
present but e00/d00 removed?
If that is so, then this would suggest to me that Audacity did in fact
successfully find and remove the lowest-level folder, but the removal of it
is somehow asynchronously completed on Sierra, and Audacity should pause a
bit after removing each folder, before trying to remove its parent. There
may be many folders, so this must be a small pause at most, but maybe only a
few milliseconds after each is what we need.
PRL
Post by Paul Licameli
Post by Paul Licameli
Formerly there were more and different log messages, even on my
computer. You alone get these messages that the directory is not empty.
But at this point in the program, the call to delete the .au files has
completed.
Post by Gale Andrews
If not, see if 4059b2ae^ does it, with a long enough sleep that is not
unreasonable
As submitted, does not clean up empty folders, same message in log.
The only change is the spinning beach ball for 5 seconds presumably while
the sleep is performed. So we know that the sleep there will have an
undesirable visual consequence and I did not bother extending the sleep.
If #2 succeeds, verify that it also works when changing #if 1 to #if 0, but
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on pressing "No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the .au
files, and then asks the file system whether the .au files are really gone,
then the answer it gets is yes, they are really gone.
So what could explain the anomaly that the log tells us the directories
are not empty? Some extraneous files are somehow added to the folders?
PRL
Post by Gale Andrews
If #1, #2, or #3 is enough to fix closing without saving, determine whether
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now launch
Audacity guaranteed not to have bug 1567 present, but 1567 can still
occur on close without saving.
At any of those three commits, manually deleting old project folders before
close without save still stops 1567 occurring, even if there are two or more
project windows open. But if SessionData contains any project folders
which are not in use, then 1567 can trigger on close without save.
Gale
Also check that the log file no longer routinely contains (as master does,
even on my computer) error messages related to the temporary files.
PRL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Paul Licameli
2017-01-25 03:20:45 UTC
Permalink
Post by Paul Licameli
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/
0988c427b9efd31f26491712f01cc15b46dac085
Post by Paul Licameli
Now there are four commits. The first should not fix the bugs but will
be
Post by Paul Licameli
desirable to avoid log messages about "operation not permitted." The
second
Post by Paul Licameli
does the insufficient, probably unnecessary, but harmless loop to verify
that .au files are removed, waiting at most one second.
What is interesting now is the third commit, which you can call
0988c427^ .
Post by Paul Licameli
Again, it adds a sleep that you can tune, but only 100 ms as written,
after
Post by Paul Licameli
removal of each folder.
The only new behaviour with this commit is the progress dialogue for
cleaning up temporary files. This takes 75 seconds to complete. SessionData
contains six old projects, each with an empty e00 folder, plus the one
project which is the project just closed.
All the project*/e00 folders remain after this cleanup attempt.
01:57:55: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344' couldn't be deleted
(error 66: Directory not empty)
01:58:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:10: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342' couldn't be deleted
(error 66: Directory not empty)
01:58:15: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:20: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621' couldn't be deleted
(error 66: Directory not empty)
01:58:25: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:30: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723' couldn't be deleted
(error 66: Directory not empty)
01:58:35: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:40: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266' couldn't be deleted
(error 66: Directory not empty)
01:58:45: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:50: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422' couldn't be deleted
(error 66: Directory not empty)
01:59:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528/e00' couldn't be
deleted (error 66: Directory not empty)
01:59:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528' couldn't be deleted
(error 66: Directory not empty)
Post by Paul Licameli
gain, you can change #if 0 to #if 1 so that this number is an upper
bound
Post by Paul Licameli
on the wait, which may be shorter.
This just adds the spinning beach ball lasting as long as the specified wait,
before the progress dialogue appears. I tried 5000 ms with no difference.
Post by Paul Licameli
Again, I want to know if this turns out to be sufficient to fix bug
1567, without the
Post by Paul Licameli
branch tip commit, 0988c427.
No - it does not.
I tried deleting these same e00 and project* folders, one at a time in FileZilla
3.24.0, which uses wxWidgets 3.0.3. This deletion went without problem and
was instantaneous.
Manually deleting the .DS_Store files in the project* folders before asking
Audacity to delete the folders does not change anything.
Well, this makes no sense. It appears the Audacity program is told that
the folder is not empty, when other programs tell us that it is.

The only other thing I can think of, is that you use terminal, and type
ls -a .../e00

with whatever substitution for ... and this might tell us about certain
hidden files that Finder might not be showing.

PRL
Post by Paul Licameli
Gale
Post by Paul Licameli
Post by Paul Licameli
On Tue, Jan 24, 2017 at 4:20 PM, Paul Licameli <
Post by Paul Licameli
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567 occurring
on close without save.
I did git push -f to my origin. There are now three commits in the branch.
https://github.com/Paul-Licameli/audacity/commit/
4059b2ae48b57cd075d9cd226cb591b939e5fc6c
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
The head includes the fork-and-crash fix, but could it be that we
don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of
folders does
not succeed if done too soon after removal of the contents of the folder, I
added the other commit one before head. This inserts code to delay between
removing files and removing folders. As submitted, it simply
sleeps
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
by a
number that you can tune. But if you change #if 1 to #if 0, then
instead it
tests in a loop whether it can detect completion of removal of the files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing
without
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
saving
It doesn't stop bug 1567 occurring on close without save, even if the close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder? No .au
files left in them? Could there be hidden files? Does ls -a from
terminal
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
list anything else in them?
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559'
couldn't
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
be deleted (error 66: Directory not empty)
Specifically there used to be "operation not permitted" messages in the
log, but now no longer, right? It is something, that the log is
tidier,
Post by Paul Licameli
Post by Paul Licameli
even on my machine which does not suffer bug 1567.
Is this list of log messages complete?
I now notice this: you did NOT see a log message for the etc/e00/d00
directory. There should have been such a directory in the tree. So
it may
Post by Paul Licameli
Post by Paul Licameli
not be that .au files are not cleaned up (in fact they should normally
be
Post by Paul Licameli
Post by Paul Licameli
deleted already at this point), but rather that the d00 folder was not
removed.
Audacity did not attempt to remove d00.
Or it did, but that failed silently without a log message.
Or it did, but a sleep is needed before attempting to remove the folder
above it.
But this means I have not run out of experiments for you yet.
PRL
So here is what you can do while I write something else: Verify that
folder .../e00/d00 exists before you close without saving. Do the close
without saving in HEAD, with its failed, incomplete cleanup. Is e00
still
Post by Paul Licameli
Post by Paul Licameli
present but e00/d00 removed?
If that is so, then this would suggest to me that Audacity did in fact
successfully find and remove the lowest-level folder, but the removal
of it
Post by Paul Licameli
Post by Paul Licameli
is somehow asynchronously completed on Sierra, and Audacity should
pause a
Post by Paul Licameli
Post by Paul Licameli
bit after removing each folder, before trying to remove its parent.
There
Post by Paul Licameli
Post by Paul Licameli
may be many folders, so this must be a small pause at most, but maybe
only a
Post by Paul Licameli
Post by Paul Licameli
few milliseconds after each is what we need.
PRL
Post by Paul Licameli
Formerly there were more and different log messages, even on my
computer. You alone get these messages that the directory is not
empty.
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
But at this point in the program, the call to delete the .au files has
completed.
Post by Gale Andrews
If not, see if 4059b2ae^ does it, with a long enough sleep that is not
unreasonable
As submitted, does not clean up empty folders, same message in log.
The only change is the spinning beach ball for 5 seconds presumably while
the sleep is performed. So we know that the sleep there will have an
undesirable visual consequence and I did not bother extending the sleep.
If #2 succeeds, verify that it also works when changing #if 1 to
#if
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
0, but
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on pressing "No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the .au
files, and then asks the file system whether the .au files are really
gone,
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
then the answer it gets is yes, they are really gone.
So what could explain the anomaly that the log tells us the
directories
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
are not empty? Some extraneous files are somehow added to the
folders?
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
PRL
Post by Gale Andrews
If #1, #2, or #3 is enough to fix closing without saving, determine whether
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now
launch
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Audacity guaranteed not to have bug 1567 present, but 1567 can still
occur on close without saving.
At any of those three commits, manually deleting old project folders before
close without save still stops 1567 occurring, even if there are two
or
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
more
project windows open. But if SessionData contains any project folders
which are not in use, then 1567 can trigger on close without save.
Gale
Also check that the log file no longer routinely contains (as
master
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
does,
even on my computer) error messages related to the temporary files.
PRL
------------------------------------------------------------
------------------
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Post by Paul Licameli
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Paul Licameli
2017-01-25 04:14:16 UTC
Permalink
I pushed another commit, a1b6aadf, which should write something to the log
when there is a failure to remove one of these folders. Though after
closing the last window, you must open a new window, in order to have the
Help menu available so you can see the log again.

There should either be messages that the folder that did not delete can't
be enumerated, or else, a list of the files that wxWidgets still detects
inside it.

(I'm feeling very frustrated with this, Gale. You?)

PRL
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/0988c427b9e
fd31f26491712f01cc15b46dac085
Post by Paul Licameli
Now there are four commits. The first should not fix the bugs but will
be
Post by Paul Licameli
desirable to avoid log messages about "operation not permitted." The
second
Post by Paul Licameli
does the insufficient, probably unnecessary, but harmless loop to verify
that .au files are removed, waiting at most one second.
What is interesting now is the third commit, which you can call
0988c427^ .
Post by Paul Licameli
Again, it adds a sleep that you can tune, but only 100 ms as written,
after
Post by Paul Licameli
removal of each folder.
The only new behaviour with this commit is the progress dialogue for
cleaning up temporary files. This takes 75 seconds to complete. SessionData
contains six old projects, each with an empty e00 folder, plus the one
project which is the project just closed.
All the project*/e00 folders remain after this cleanup attempt.
01:57:55: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344' couldn't be deleted
(error 66: Directory not empty)
01:58:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:10: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342' couldn't be deleted
(error 66: Directory not empty)
01:58:15: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:20: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621' couldn't be deleted
(error 66: Directory not empty)
01:58:25: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:30: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723' couldn't be deleted
(error 66: Directory not empty)
01:58:35: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:40: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266' couldn't be deleted
(error 66: Directory not empty)
01:58:45: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:50: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422' couldn't be deleted
(error 66: Directory not empty)
01:59:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528/e00' couldn't be
deleted (error 66: Directory not empty)
01:59:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528' couldn't be deleted
(error 66: Directory not empty)
Post by Paul Licameli
gain, you can change #if 0 to #if 1 so that this number is an upper
bound
Post by Paul Licameli
on the wait, which may be shorter.
This just adds the spinning beach ball lasting as long as the specified wait,
before the progress dialogue appears. I tried 5000 ms with no difference.
Post by Paul Licameli
Again, I want to know if this turns out to be sufficient to fix bug
1567, without the
Post by Paul Licameli
branch tip commit, 0988c427.
No - it does not.
I tried deleting these same e00 and project* folders, one at a time in FileZilla
3.24.0, which uses wxWidgets 3.0.3. This deletion went without problem and
was instantaneous.
Manually deleting the .DS_Store files in the project* folders before asking
Audacity to delete the folders does not change anything.
Well, this makes no sense. It appears the Audacity program is told that
the folder is not empty, when other programs tell us that it is.
The only other thing I can think of, is that you use terminal, and type
ls -a .../e00
with whatever substitution for ... and this might tell us about certain
hidden files that Finder might not be showing.
PRL
Post by Paul Licameli
Gale
Post by Paul Licameli
On Tue, Jan 24, 2017 at 4:46 PM, Paul Licameli <
On Tue, Jan 24, 2017 at 4:20 PM, Paul Licameli <
Post by Paul Licameli
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567 occurring
on close without save.
Post by Paul Licameli
I did git push -f to my origin. There are now three commits in
the
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
branch.
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b
57cd075d9cd226cb591b939e5fc6c
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
The head includes the fork-and-crash fix, but could it be that we
don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits
before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder
cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of
folders does
not succeed if done too soon after removal of the contents of the
folder, I
added the other commit one before head. This inserts code to
delay
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
between
removing files and removing folders. As submitted, it simply
sleeps
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
by a
number that you can tune. But if you change #if 1 to #if 0, then
instead it
tests in a loop whether it can detect completion of removal of the files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing
without
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
saving
It doesn't stop bug 1567 occurring on close without save, even if
the
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder? No .au
files left in them? Could there be hidden files? Does ls -a from
terminal
Post by Paul Licameli
Post by Paul Licameli
list anything else in them?
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559'
couldn't
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
be deleted (error 66: Directory not empty)
Specifically there used to be "operation not permitted" messages in
the
Post by Paul Licameli
log, but now no longer, right? It is something, that the log is
tidier,
Post by Paul Licameli
even on my machine which does not suffer bug 1567.
Is this list of log messages complete?
I now notice this: you did NOT see a log message for the etc/e00/d00
directory. There should have been such a directory in the tree. So
it may
Post by Paul Licameli
not be that .au files are not cleaned up (in fact they should
normally be
Post by Paul Licameli
deleted already at this point), but rather that the d00 folder was not
removed.
Audacity did not attempt to remove d00.
Or it did, but that failed silently without a log message.
Or it did, but a sleep is needed before attempting to remove the
folder
Post by Paul Licameli
above it.
But this means I have not run out of experiments for you yet.
PRL
So here is what you can do while I write something else: Verify that
folder .../e00/d00 exists before you close without saving. Do the
close
Post by Paul Licameli
without saving in HEAD, with its failed, incomplete cleanup. Is e00
still
Post by Paul Licameli
present but e00/d00 removed?
If that is so, then this would suggest to me that Audacity did in fact
successfully find and remove the lowest-level folder, but the removal
of it
Post by Paul Licameli
is somehow asynchronously completed on Sierra, and Audacity should
pause a
Post by Paul Licameli
bit after removing each folder, before trying to remove its parent.
There
Post by Paul Licameli
may be many folders, so this must be a small pause at most, but maybe
only a
Post by Paul Licameli
few milliseconds after each is what we need.
PRL
Post by Paul Licameli
Formerly there were more and different log messages, even on my
computer. You alone get these messages that the directory is not
empty.
Post by Paul Licameli
Post by Paul Licameli
But at this point in the program, the call to delete the .au files
has
Post by Paul Licameli
Post by Paul Licameli
completed.
Post by Gale Andrews
Post by Paul Licameli
If not, see if 4059b2ae^ does it, with a long enough sleep that is not
unreasonable
As submitted, does not clean up empty folders, same message in log.
The only change is the spinning beach ball for 5 seconds presumably while
the sleep is performed. So we know that the sleep there will have an
undesirable visual consequence and I did not bother extending the sleep.
Post by Paul Licameli
If #2 succeeds, verify that it also works when changing #if 1 to
#if
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
0, but
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on pressing "No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the .au
files, and then asks the file system whether the .au files are
really gone,
Post by Paul Licameli
Post by Paul Licameli
then the answer it gets is yes, they are really gone.
So what could explain the anomaly that the log tells us the
directories
Post by Paul Licameli
Post by Paul Licameli
are not empty? Some extraneous files are somehow added to the
folders?
Post by Paul Licameli
Post by Paul Licameli
PRL
Post by Gale Andrews
Post by Paul Licameli
If #1, #2, or #3 is enough to fix closing without saving,
determine
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
whether
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now
launch
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Audacity guaranteed not to have bug 1567 present, but 1567 can still
occur on close without saving.
At any of those three commits, manually deleting old project folders before
close without save still stops 1567 occurring, even if there are
two or
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
more
project windows open. But if SessionData contains any project
folders
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
which are not in use, then 1567 can trigger on close without save.
Gale
Post by Paul Licameli
Also check that the log file no longer routinely contains (as
master
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
does,
even on my computer) error messages related to the temporary
files.
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
PRL
------------------------------------------------------------
------------------
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Post by Paul Licameli
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Paul Licameli
2017-01-25 14:57:37 UTC
Permalink
A second fork and crash?

What if Audacity forked and crashed again when the last project is closed,
and cleaned up the temp directory after that? It might fix the remaining
problem.

Some work would be needed to stop creation of an empty project as happens
at startup, and without other work, some global state would be lost, such
as the clipboard, and the memory of the last used effect for command + R.

No, I don't like this idea, but it is a possibility I thought of.

PRL
Post by Paul Licameli
I pushed another commit, a1b6aadf, which should write something to the log
when there is a failure to remove one of these folders. Though after
closing the last window, you must open a new window, in order to have the
Help menu available so you can see the log again.
There should either be messages that the folder that did not delete can't
be enumerated, or else, a list of the files that wxWidgets still detects
inside it.
(I'm feeling very frustrated with this, Gale. You?)
PRL
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/0988c427b9e
fd31f26491712f01cc15b46dac085
Post by Paul Licameli
Now there are four commits. The first should not fix the bugs but
will be
Post by Paul Licameli
desirable to avoid log messages about "operation not permitted." The
second
Post by Paul Licameli
does the insufficient, probably unnecessary, but harmless loop to
verify
Post by Paul Licameli
that .au files are removed, waiting at most one second.
What is interesting now is the third commit, which you can call
0988c427^ .
Post by Paul Licameli
Again, it adds a sleep that you can tune, but only 100 ms as written,
after
Post by Paul Licameli
removal of each folder.
The only new behaviour with this commit is the progress dialogue for
cleaning up temporary files. This takes 75 seconds to complete. SessionData
contains six old projects, each with an empty e00 folder, plus the one
project which is the project just closed.
All the project*/e00 folders remain after this cleanup attempt.
01:57:55: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344' couldn't be deleted
(error 66: Directory not empty)
01:58:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:10: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342' couldn't be deleted
(error 66: Directory not empty)
01:58:15: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:20: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621' couldn't be deleted
(error 66: Directory not empty)
01:58:25: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:30: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723' couldn't be deleted
(error 66: Directory not empty)
01:58:35: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:40: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266' couldn't be deleted
(error 66: Directory not empty)
01:58:45: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:50: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422' couldn't be deleted
(error 66: Directory not empty)
01:59:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528/e00' couldn't be
deleted (error 66: Directory not empty)
01:59:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528' couldn't be deleted
(error 66: Directory not empty)
Post by Paul Licameli
gain, you can change #if 0 to #if 1 so that this number is an upper
bound
Post by Paul Licameli
on the wait, which may be shorter.
This just adds the spinning beach ball lasting as long as the specified wait,
before the progress dialogue appears. I tried 5000 ms with no difference.
Post by Paul Licameli
Again, I want to know if this turns out to be sufficient to fix bug
1567, without the
Post by Paul Licameli
branch tip commit, 0988c427.
No - it does not.
I tried deleting these same e00 and project* folders, one at a time in FileZilla
3.24.0, which uses wxWidgets 3.0.3. This deletion went without problem and
was instantaneous.
Manually deleting the .DS_Store files in the project* folders before asking
Audacity to delete the folders does not change anything.
Well, this makes no sense. It appears the Audacity program is told that
the folder is not empty, when other programs tell us that it is.
The only other thing I can think of, is that you use terminal, and type
ls -a .../e00
with whatever substitution for ... and this might tell us about certain
hidden files that Finder might not be showing.
PRL
Post by Paul Licameli
Gale
Post by Paul Licameli
On Tue, Jan 24, 2017 at 4:57 PM, Paul Licameli <
On Tue, Jan 24, 2017 at 4:46 PM, Paul Licameli <
On Tue, Jan 24, 2017 at 4:20 PM, Paul Licameli <
On Tue, Jan 24, 2017 at 1:21 PM, Gale Andrews <
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567 occurring
on close without save.
On 23 January 2017 at 13:16, Paul Licameli <
Post by Paul Licameli
I did git push -f to my origin. There are now three commits in
the
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
branch.
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b
57cd075d9cd226cb591b939e5fc6c
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
The head includes the fork-and-crash fix, but could it be that we
don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits
before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder
cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of
folders does
not succeed if done too soon after removal of the contents of the
folder, I
added the other commit one before head. This inserts code to
delay
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
between
removing files and removing folders. As submitted, it simply
sleeps
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
by a
number that you can tune. But if you change #if 1 to #if 0, then
instead it
tests in a loop whether it can detect completion of removal of
the
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing
without
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
saving
It doesn't stop bug 1567 occurring on close without save, even if
the
Post by Paul Licameli
Post by Gale Andrews
close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder? No
.au
Post by Paul Licameli
files left in them? Could there be hidden files? Does ls -a from
terminal
Post by Paul Licameli
list anything else in them?
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559'
couldn't
Post by Paul Licameli
Post by Gale Andrews
be deleted (error 66: Directory not empty)
Specifically there used to be "operation not permitted" messages in
the
Post by Paul Licameli
log, but now no longer, right? It is something, that the log is
tidier,
Post by Paul Licameli
even on my machine which does not suffer bug 1567.
Is this list of log messages complete?
I now notice this: you did NOT see a log message for the etc/e00/d00
directory. There should have been such a directory in the tree. So
it may
Post by Paul Licameli
not be that .au files are not cleaned up (in fact they should
normally be
Post by Paul Licameli
deleted already at this point), but rather that the d00 folder was
not
Post by Paul Licameli
removed.
Audacity did not attempt to remove d00.
Or it did, but that failed silently without a log message.
Or it did, but a sleep is needed before attempting to remove the
folder
Post by Paul Licameli
above it.
But this means I have not run out of experiments for you yet.
PRL
So here is what you can do while I write something else: Verify that
folder .../e00/d00 exists before you close without saving. Do the
close
Post by Paul Licameli
without saving in HEAD, with its failed, incomplete cleanup. Is e00
still
Post by Paul Licameli
present but e00/d00 removed?
If that is so, then this would suggest to me that Audacity did in fact
successfully find and remove the lowest-level folder, but the removal
of it
Post by Paul Licameli
is somehow asynchronously completed on Sierra, and Audacity should
pause a
Post by Paul Licameli
bit after removing each folder, before trying to remove its parent.
There
Post by Paul Licameli
may be many folders, so this must be a small pause at most, but maybe
only a
Post by Paul Licameli
few milliseconds after each is what we need.
PRL
Formerly there were more and different log messages, even on my
computer. You alone get these messages that the directory is not
empty.
Post by Paul Licameli
But at this point in the program, the call to delete the .au files
has
Post by Paul Licameli
completed.
Post by Gale Andrews
Post by Paul Licameli
If not, see if 4059b2ae^ does it, with a long enough sleep that
is
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
not
unreasonable
As submitted, does not clean up empty folders, same message in log.
The only change is the spinning beach ball for 5 seconds presumably while
the sleep is performed. So we know that the sleep there will have
an
Post by Paul Licameli
Post by Gale Andrews
undesirable visual consequence and I did not bother extending the sleep.
Post by Paul Licameli
If #2 succeeds, verify that it also works when changing #if 1 to
#if
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
0, but
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on pressing "No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the .au
files, and then asks the file system whether the .au files are
really gone,
Post by Paul Licameli
then the answer it gets is yes, they are really gone.
So what could explain the anomaly that the log tells us the
directories
Post by Paul Licameli
are not empty? Some extraneous files are somehow added to the
folders?
Post by Paul Licameli
PRL
Post by Gale Andrews
Post by Paul Licameli
If #1, #2, or #3 is enough to fix closing without saving,
determine
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
whether
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now
launch
Post by Paul Licameli
Post by Gale Andrews
Audacity guaranteed not to have bug 1567 present, but 1567 can
still
Post by Paul Licameli
Post by Gale Andrews
occur on close without saving.
At any of those three commits, manually deleting old project
folders
Post by Paul Licameli
Post by Gale Andrews
before
close without save still stops 1567 occurring, even if there are
two or
Post by Paul Licameli
Post by Gale Andrews
more
project windows open. But if SessionData contains any project
folders
Post by Paul Licameli
Post by Gale Andrews
which are not in use, then 1567 can trigger on close without save.
Gale
Post by Paul Licameli
Also check that the log file no longer routinely contains (as
master
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
does,
even on my computer) error messages related to the temporary
files.
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
PRL
------------------------------------------------------------
------------------
Post by Paul Licameli
Post by Gale Andrews
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Post by Paul Licameli
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
David Bailes
2017-01-25 17:50:39 UTC
Permalink
Post by Paul Licameli
A second fork and crash?
What if Audacity forked and crashed again when the last project is closed,
and cleaned up the temp directory after that? It might fix the remaining
problem.
Some work would be needed to stop creation of an empty project as happens
at startup, and without other work, some global state would be lost, such
as the clipboard, and the memory of the last used effect for command + R.
No, I don't like this idea, but it is a possibility I thought of.
Without knowing precisely what the problem is, (and part of the problem
could be specific to Gale's install of Sierra), there's a danger that
intuitive fixes may fix a problem on Gale's computer, but not on any other,
and just end up going nowhere.

David.
Post by Paul Licameli
PRL
Post by Paul Licameli
I pushed another commit, a1b6aadf, which should write something to the
log when there is a failure to remove one of these folders. Though after
closing the last window, you must open a new window, in order to have the
Help menu available so you can see the log again.
There should either be messages that the folder that did not delete can't
be enumerated, or else, a list of the files that wxWidgets still detects
inside it.
(I'm feeling very frustrated with this, Gale. You?)
PRL
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/0988c427b9e
fd31f26491712f01cc15b46dac085
Post by Paul Licameli
Now there are four commits. The first should not fix the bugs but
will be
Post by Paul Licameli
desirable to avoid log messages about "operation not permitted." The
second
Post by Paul Licameli
does the insufficient, probably unnecessary, but harmless loop to
verify
Post by Paul Licameli
that .au files are removed, waiting at most one second.
What is interesting now is the third commit, which you can call
0988c427^ .
Post by Paul Licameli
Again, it adds a sleep that you can tune, but only 100 ms as written,
after
Post by Paul Licameli
removal of each folder.
The only new behaviour with this commit is the progress dialogue for
cleaning up temporary files. This takes 75 seconds to complete. SessionData
contains six old projects, each with an empty e00 folder, plus the one
project which is the project just closed.
All the project*/e00 folders remain after this cleanup attempt.
01:57:55: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344' couldn't be deleted
(error 66: Directory not empty)
01:58:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:10: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342' couldn't be deleted
(error 66: Directory not empty)
01:58:15: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:20: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621' couldn't be deleted
(error 66: Directory not empty)
01:58:25: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:30: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723' couldn't be deleted
(error 66: Directory not empty)
01:58:35: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:40: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266' couldn't be deleted
(error 66: Directory not empty)
01:58:45: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:50: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422' couldn't be deleted
(error 66: Directory not empty)
01:59:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528/e00' couldn't be
deleted (error 66: Directory not empty)
01:59:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528' couldn't be deleted
(error 66: Directory not empty)
Post by Paul Licameli
gain, you can change #if 0 to #if 1 so that this number is an upper
bound
Post by Paul Licameli
on the wait, which may be shorter.
This just adds the spinning beach ball lasting as long as the specified wait,
before the progress dialogue appears. I tried 5000 ms with no difference.
Post by Paul Licameli
Again, I want to know if this turns out to be sufficient to fix bug
1567, without the
Post by Paul Licameli
branch tip commit, 0988c427.
No - it does not.
I tried deleting these same e00 and project* folders, one at a time in FileZilla
3.24.0, which uses wxWidgets 3.0.3. This deletion went without problem and
was instantaneous.
Manually deleting the .DS_Store files in the project* folders before asking
Audacity to delete the folders does not change anything.
Well, this makes no sense. It appears the Audacity program is told that
the folder is not empty, when other programs tell us that it is.
The only other thing I can think of, is that you use terminal, and type
ls -a .../e00
with whatever substitution for ... and this might tell us about certain
hidden files that Finder might not be showing.
PRL
Post by Paul Licameli
Gale
Post by Paul Licameli
On Tue, Jan 24, 2017 at 4:57 PM, Paul Licameli <
On Tue, Jan 24, 2017 at 4:46 PM, Paul Licameli <
On Tue, Jan 24, 2017 at 4:20 PM, Paul Licameli <
On Tue, Jan 24, 2017 at 1:21 PM, Gale Andrews <
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567
occurring
Post by Paul Licameli
Post by Gale Andrews
on close without save.
On 23 January 2017 at 13:16, Paul Licameli <
Post by Paul Licameli
I did git push -f to my origin. There are now three commits in
the
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
branch.
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b
57cd075d9cd226cb591b939e5fc6c
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
The head includes the fork-and-crash fix, but could it be that
we
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits
before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder
cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of
folders does
not succeed if done too soon after removal of the contents of
the
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
folder, I
added the other commit one before head. This inserts code to
delay
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
between
removing files and removing folders. As submitted, it simply
sleeps
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
by a
number that you can tune. But if you change #if 1 to #if 0,
then
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
instead it
tests in a loop whether it can detect completion of removal of
the
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing
without
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
saving
It doesn't stop bug 1567 occurring on close without save, even if
the
Post by Paul Licameli
Post by Gale Andrews
close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder? No
.au
Post by Paul Licameli
files left in them? Could there be hidden files? Does ls -a from
terminal
Post by Paul Licameli
list anything else in them?
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559'
couldn't
Post by Paul Licameli
Post by Gale Andrews
be deleted (error 66: Directory not empty)
Specifically there used to be "operation not permitted" messages in
the
Post by Paul Licameli
log, but now no longer, right? It is something, that the log is
tidier,
Post by Paul Licameli
even on my machine which does not suffer bug 1567.
Is this list of log messages complete?
I now notice this: you did NOT see a log message for the
etc/e00/d00
Post by Paul Licameli
directory. There should have been such a directory in the tree.
So it may
Post by Paul Licameli
not be that .au files are not cleaned up (in fact they should
normally be
Post by Paul Licameli
deleted already at this point), but rather that the d00 folder was
not
Post by Paul Licameli
removed.
Audacity did not attempt to remove d00.
Or it did, but that failed silently without a log message.
Or it did, but a sleep is needed before attempting to remove the
folder
Post by Paul Licameli
above it.
But this means I have not run out of experiments for you yet.
PRL
So here is what you can do while I write something else: Verify that
folder .../e00/d00 exists before you close without saving. Do the
close
Post by Paul Licameli
without saving in HEAD, with its failed, incomplete cleanup. Is e00
still
Post by Paul Licameli
present but e00/d00 removed?
If that is so, then this would suggest to me that Audacity did in
fact
Post by Paul Licameli
successfully find and remove the lowest-level folder, but the
removal of it
Post by Paul Licameli
is somehow asynchronously completed on Sierra, and Audacity should
pause a
Post by Paul Licameli
bit after removing each folder, before trying to remove its parent.
There
Post by Paul Licameli
may be many folders, so this must be a small pause at most, but
maybe only a
Post by Paul Licameli
few milliseconds after each is what we need.
PRL
Formerly there were more and different log messages, even on my
computer. You alone get these messages that the directory is not
empty.
Post by Paul Licameli
But at this point in the program, the call to delete the .au files
has
Post by Paul Licameli
completed.
Post by Gale Andrews
Post by Paul Licameli
If not, see if 4059b2ae^ does it, with a long enough sleep that
is
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
not
unreasonable
As submitted, does not clean up empty folders, same message in
log.
Post by Paul Licameli
Post by Gale Andrews
The only change is the spinning beach ball for 5 seconds
presumably
Post by Paul Licameli
Post by Gale Andrews
while
the sleep is performed. So we know that the sleep there will have
an
Post by Paul Licameli
Post by Gale Andrews
undesirable visual consequence and I did not bother extending the sleep.
Post by Paul Licameli
If #2 succeeds, verify that it also works when changing #if 1
to #if
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
0, but
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on
pressing
Post by Paul Licameli
Post by Gale Andrews
"No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the
.au
Post by Paul Licameli
files, and then asks the file system whether the .au files are
really gone,
Post by Paul Licameli
then the answer it gets is yes, they are really gone.
So what could explain the anomaly that the log tells us the
directories
Post by Paul Licameli
are not empty? Some extraneous files are somehow added to the
folders?
Post by Paul Licameli
PRL
Post by Gale Andrews
Post by Paul Licameli
If #1, #2, or #3 is enough to fix closing without saving,
determine
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
whether
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now
launch
Post by Paul Licameli
Post by Gale Andrews
Audacity guaranteed not to have bug 1567 present, but 1567 can
still
Post by Paul Licameli
Post by Gale Andrews
occur on close without saving.
At any of those three commits, manually deleting old project
folders
Post by Paul Licameli
Post by Gale Andrews
before
close without save still stops 1567 occurring, even if there are
two or
Post by Paul Licameli
Post by Gale Andrews
more
project windows open. But if SessionData contains any project
folders
Post by Paul Licameli
Post by Gale Andrews
which are not in use, then 1567 can trigger on close without save.
Gale
Post by Paul Licameli
Also check that the log file no longer routinely contains (as
master
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
does,
even on my computer) error messages related to the temporary
files.
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
PRL
------------------------------------------------------------
------------------
Post by Paul Licameli
Post by Gale Andrews
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Post by Paul Licameli
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Gale Andrews
2017-01-25 19:16:36 UTC
Permalink
Post by David Bailes
Post by Paul Licameli
A second fork and crash?
What if Audacity forked and crashed again when the last project is closed,
and cleaned up the temp directory after that? It might fix the remaining
problem.
Some work would be needed to stop creation of an empty project as happens
at startup, and without other work, some global state would be lost, such as
the clipboard, and the memory of the last used effect for command + R.
No, I don't like this idea, but it is a possibility I thought of.
Without knowing precisely what the problem is, (and part of the problem
could be specific to Gale's install of Sierra), there's a danger that
intuitive fixes may fix a problem on Gale's computer, but not on any other,
and just end up going nowhere.
Indeed that could be a problem with the fork and crash on launch that we
already have, but I suspect only on affected machines that might do
something other than mine does, if the bug has other facets we've not
seen yet.

I've suggested that we ask users on Paul's Facebook page and
Forum users who saw 1567 in 2.1.2 to test RC1 for us.

I don't think it's a problem with my Sierra install. One partition has
10.12.2 upgraded from El Capitan, but I am working now with a new
10.12.2 in a fresh partition (and I had tried the same on an external
drive). The behaviour is the same in all these installs.

However, 10.12.3 is out yesterday so I will update existing 10.12.2
partitions to that. If the problem is still there then we should (attempt
to) involve Apple. I have not written anything out along those lines
yet, but we might be able to use our new Wiki page for that.



Gale
Post by David Bailes
Post by Paul Licameli
Post by Paul Licameli
I pushed another commit, a1b6aadf, which should write something to the
log when there is a failure to remove one of these folders. Though after
closing the last window, you must open a new window, in order to have the
Help menu available so you can see the log again.
There should either be messages that the folder that did not delete can't
be enumerated, or else, a list of the files that wxWidgets still detects
inside it.
(I'm feeling very frustrated with this, Gale. You?)
PRL
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/0988c427b9efd31f26491712f01cc15b46dac085
Now there are four commits. The first should not fix the bugs but will be
desirable to avoid log messages about "operation not permitted." The second
does the insufficient, probably unnecessary, but harmless loop to verify
that .au files are removed, waiting at most one second.
What is interesting now is the third commit, which you can call 0988c427^ .
Again, it adds a sleep that you can tune, but only 100 ms as written, after
removal of each folder.
The only new behaviour with this commit is the progress dialogue for
cleaning up temporary files. This takes 75 seconds to complete. SessionData
contains six old projects, each with an empty e00 folder, plus the one
project which is the project just closed.
All the project*/e00 folders remain after this cleanup attempt.
01:57:55: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344' couldn't be deleted
(error 66: Directory not empty)
01:58:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:10: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342' couldn't be deleted
(error 66: Directory not empty)
01:58:15: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:20: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621' couldn't be deleted
(error 66: Directory not empty)
01:58:25: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:30: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723' couldn't be deleted
(error 66: Directory not empty)
01:58:35: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:40: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266' couldn't be deleted
(error 66: Directory not empty)
01:58:45: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:50: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422' couldn't be deleted
(error 66: Directory not empty)
01:59:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528/e00' couldn't be
deleted (error 66: Directory not empty)
01:59:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528' couldn't be deleted
(error 66: Directory not empty)
Post by Paul Licameli
gain, you can change #if 0 to #if 1 so that this number is an upper bound
on the wait, which may be shorter.
This just adds the spinning beach ball lasting as long as the specified wait,
before the progress dialogue appears. I tried 5000 ms with no difference.
Post by Paul Licameli
Again, I want to know if this turns out to be sufficient to fix bug
1567, without the
branch tip commit, 0988c427.
No - it does not.
I tried deleting these same e00 and project* folders, one at a time in FileZilla
3.24.0, which uses wxWidgets 3.0.3. This deletion went without problem and
was instantaneous.
Manually deleting the .DS_Store files in the project* folders before asking
Audacity to delete the folders does not change anything.
Well, this makes no sense. It appears the Audacity program is told that
the folder is not empty, when other programs tell us that it is.
The only other thing I can think of, is that you use terminal, and type
ls -a .../e00
with whatever substitution for ... and this might tell us about certain
hidden files that Finder might not be showing.
PRL
Post by Gale Andrews
Gale
Post by Paul Licameli
On Tue, Jan 24, 2017 at 4:57 PM, Paul Licameli
On Tue, Jan 24, 2017 at 4:46 PM, Paul Licameli
On Tue, Jan 24, 2017 at 4:20 PM, Paul Licameli
On Tue, Jan 24, 2017 at 1:21 PM, Gale Andrews
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567 occurring
on close without save.
On 23 January 2017 at 13:16, Paul Licameli
Post by Paul Licameli
I did git push -f to my origin. There are now three commits in the
branch.
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b57cd075d9cd226cb591b939e5fc6c
The head includes the fork-and-crash fix, but could it be that we
don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits
before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder
cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of
folders does
not succeed if done too soon after removal of the contents of the
folder, I
added the other commit one before head. This inserts code to delay
between
removing files and removing folders. As submitted, it simply
sleeps
by a
number that you can tune. But if you change #if 1 to #if 0, then
instead it
tests in a loop whether it can detect completion of removal of the
files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing
without
saving
It doesn't stop bug 1567 occurring on close without save, even if
the
close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder? No .au
files left in them? Could there be hidden files? Does ls -a from
terminal
list anything else in them?
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559' couldn't
be deleted (error 66: Directory not empty)
Specifically there used to be "operation not permitted" messages in the
log, but now no longer, right? It is something, that the log is tidier,
even on my machine which does not suffer bug 1567.
Is this list of log messages complete?
I now notice this: you did NOT see a log message for the etc/e00/d00
directory. There should have been such a directory in the tree.
So it may
not be that .au files are not cleaned up (in fact they should normally be
deleted already at this point), but rather that the d00 folder was not
removed.
Audacity did not attempt to remove d00.
Or it did, but that failed silently without a log message.
Or it did, but a sleep is needed before attempting to remove the folder
above it.
But this means I have not run out of experiments for you yet.
PRL
So here is what you can do while I write something else: Verify that
folder .../e00/d00 exists before you close without saving. Do the close
without saving in HEAD, with its failed, incomplete cleanup. Is e00 still
present but e00/d00 removed?
If that is so, then this would suggest to me that Audacity did in fact
successfully find and remove the lowest-level folder, but the removal of it
is somehow asynchronously completed on Sierra, and Audacity should pause a
bit after removing each folder, before trying to remove its parent.
There
may be many folders, so this must be a small pause at most, but maybe only a
few milliseconds after each is what we need.
PRL
Formerly there were more and different log messages, even on my
computer. You alone get these messages that the directory is not empty.
But at this point in the program, the call to delete the .au files has
completed.
Post by Gale Andrews
Post by Paul Licameli
If not, see if 4059b2ae^ does it, with a long enough sleep that
is
not
unreasonable
As submitted, does not clean up empty folders, same message in log.
The only change is the spinning beach ball for 5 seconds
presumably
while
the sleep is performed. So we know that the sleep there will have an
undesirable visual consequence and I did not bother extending the
sleep.
Post by Paul Licameli
If #2 succeeds, verify that it also works when changing #if 1
to #if
0, but
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on
pressing
"No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the .au
files, and then asks the file system whether the .au files are
really gone,
then the answer it gets is yes, they are really gone.
So what could explain the anomaly that the log tells us the directories
are not empty? Some extraneous files are somehow added to the folders?
PRL
Post by Gale Andrews
Post by Paul Licameli
If #1, #2, or #3 is enough to fix closing without saving, determine
whether
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now launch
Audacity guaranteed not to have bug 1567 present, but 1567 can still
occur on close without saving.
At any of those three commits, manually deleting old project
folders
before
close without save still stops 1567 occurring, even if there are
two or
more
project windows open. But if SessionData contains any project folders
which are not in use, then 1567 can trigger on close without save.
Gale
Post by Paul Licameli
Also check that the log file no longer routinely contains (as
master
does,
even on my computer) error messages related to the temporary files.
PRL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Gale Andrews
2017-01-25 17:52:40 UTC
Permalink
Yes Paul I'm frustrated with it and the large number of hours it's
taking to test.

I can see that 1567 doesn't recur on close without save, as long
as SessionData only contains project folders that Audacity is
currently using. Does this suggest a fix (for 1567, not 1521) of
Audacity recognising or handling the old, non-current project
folders in some way?

In one of my messages last night I said that ls -a showed that
project*/e00 was empty, but that the project* folder had a
.DS_Store file. I now see that "sometimes" project*/e00 has a
.DS_Store file as well.

My last log posted was actually for when I changed to #if 1 with
5000 ms wait. Regardless, even with #if 0, I still see a progress
bar for removing temporary files which lasts 15 or 20 seconds.
This behaviour was new in this set of commits, but as I understood
it, with seven project* folders to delete, I should only be seeing
a 700 ms wait. Correct?

Fork and crash on closing last project? Perhaps, though 1567 does
sometimes recur other than on the last project window - it's just rather
less often.

Paul, is there any mileage looking at file processes that are going on
in the sort of tool David mentioned? I might need instruction on this,
if so. I'll also look in the Console app, just in case.



Gale
Post by Paul Licameli
A second fork and crash?
What if Audacity forked and crashed again when the last project is closed,
and cleaned up the temp directory after that? It might fix the remaining
problem.
Some work would be needed to stop creation of an empty project as happens at
startup, and without other work, some global state would be lost, such as
the clipboard, and the memory of the last used effect for command + R.
No, I don't like this idea, but it is a possibility I thought of.
PRL
Post by Paul Licameli
I pushed another commit, a1b6aadf, which should write something to the log
when there is a failure to remove one of these folders. Though after
closing the last window, you must open a new window, in order to have the
Help menu available so you can see the log again.
There should either be messages that the folder that did not delete can't
be enumerated, or else, a list of the files that wxWidgets still detects
inside it.
(I'm feeling very frustrated with this, Gale. You?)
PRL
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/0988c427b9efd31f26491712f01cc15b46dac085
Now there are four commits. The first should not fix the bugs but will be
desirable to avoid log messages about "operation not permitted." The second
does the insufficient, probably unnecessary, but harmless loop to verify
that .au files are removed, waiting at most one second.
What is interesting now is the third commit, which you can call 0988c427^ .
Again, it adds a sleep that you can tune, but only 100 ms as written, after
removal of each folder.
The only new behaviour with this commit is the progress dialogue for
cleaning up temporary files. This takes 75 seconds to complete. SessionData
contains six old projects, each with an empty e00 folder, plus the one
project which is the project just closed.
All the project*/e00 folders remain after this cleanup attempt.
01:57:55: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344' couldn't be deleted
(error 66: Directory not empty)
01:58:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:10: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342' couldn't be deleted
(error 66: Directory not empty)
01:58:15: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:20: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621' couldn't be deleted
(error 66: Directory not empty)
01:58:25: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:30: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723' couldn't be deleted
(error 66: Directory not empty)
01:58:35: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:40: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266' couldn't be deleted
(error 66: Directory not empty)
01:58:45: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:50: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422' couldn't be deleted
(error 66: Directory not empty)
01:59:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528/e00' couldn't be
deleted (error 66: Directory not empty)
01:59:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528' couldn't be deleted
(error 66: Directory not empty)
Post by Paul Licameli
gain, you can change #if 0 to #if 1 so that this number is an upper bound
on the wait, which may be shorter.
This just adds the spinning beach ball lasting as long as the specified wait,
before the progress dialogue appears. I tried 5000 ms with no difference.
Post by Paul Licameli
Again, I want to know if this turns out to be sufficient to fix bug
1567, without the
branch tip commit, 0988c427.
No - it does not.
I tried deleting these same e00 and project* folders, one at a time in FileZilla
3.24.0, which uses wxWidgets 3.0.3. This deletion went without problem and
was instantaneous.
Manually deleting the .DS_Store files in the project* folders before asking
Audacity to delete the folders does not change anything.
Well, this makes no sense. It appears the Audacity program is told that
the folder is not empty, when other programs tell us that it is.
The only other thing I can think of, is that you use terminal, and type
ls -a .../e00
with whatever substitution for ... and this might tell us about certain
hidden files that Finder might not be showing.
PRL
Post by Gale Andrews
Gale
Post by Paul Licameli
On Tue, Jan 24, 2017 at 4:57 PM, Paul Licameli
On Tue, Jan 24, 2017 at 4:46 PM, Paul Licameli
On Tue, Jan 24, 2017 at 4:20 PM, Paul Licameli
On Tue, Jan 24, 2017 at 1:21 PM, Gale Andrews
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567 occurring
on close without save.
On 23 January 2017 at 13:16, Paul Licameli
Post by Paul Licameli
I did git push -f to my origin. There are now three commits in the
branch.
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b57cd075d9cd226cb591b939e5fc6c
The head includes the fork-and-crash fix, but could it be that we
don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits
before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder
cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of
folders does
not succeed if done too soon after removal of the contents of the
folder, I
added the other commit one before head. This inserts code to delay
between
removing files and removing folders. As submitted, it simply sleeps
by a
number that you can tune. But if you change #if 1 to #if 0, then
instead it
tests in a loop whether it can detect completion of removal of the
files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing without
saving
It doesn't stop bug 1567 occurring on close without save, even if
the
close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder? No .au
files left in them? Could there be hidden files? Does ls -a from terminal
list anything else in them?
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559' couldn't
be deleted (error 66: Directory not empty)
Specifically there used to be "operation not permitted" messages in the
log, but now no longer, right? It is something, that the log is tidier,
even on my machine which does not suffer bug 1567.
Is this list of log messages complete?
I now notice this: you did NOT see a log message for the etc/e00/d00
directory. There should have been such a directory in the tree. So it may
not be that .au files are not cleaned up (in fact they should normally be
deleted already at this point), but rather that the d00 folder was not
removed.
Audacity did not attempt to remove d00.
Or it did, but that failed silently without a log message.
Or it did, but a sleep is needed before attempting to remove the folder
above it.
But this means I have not run out of experiments for you yet.
PRL
So here is what you can do while I write something else: Verify that
folder .../e00/d00 exists before you close without saving. Do the close
without saving in HEAD, with its failed, incomplete cleanup. Is e00 still
present but e00/d00 removed?
If that is so, then this would suggest to me that Audacity did in fact
successfully find and remove the lowest-level folder, but the removal of it
is somehow asynchronously completed on Sierra, and Audacity should pause a
bit after removing each folder, before trying to remove its parent.
There
may be many folders, so this must be a small pause at most, but maybe only a
few milliseconds after each is what we need.
PRL
Formerly there were more and different log messages, even on my
computer. You alone get these messages that the directory is not empty.
But at this point in the program, the call to delete the .au files has
completed.
Post by Gale Andrews
Post by Paul Licameli
If not, see if 4059b2ae^ does it, with a long enough sleep that
is
not
unreasonable
As submitted, does not clean up empty folders, same message in log.
The only change is the spinning beach ball for 5 seconds
presumably
while
the sleep is performed. So we know that the sleep there will have an
undesirable visual consequence and I did not bother extending the sleep.
Post by Paul Licameli
If #2 succeeds, verify that it also works when changing #if 1 to #if
0, but
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on
pressing
"No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the .au
files, and then asks the file system whether the .au files are really gone,
then the answer it gets is yes, they are really gone.
So what could explain the anomaly that the log tells us the directories
are not empty? Some extraneous files are somehow added to the folders?
PRL
Post by Gale Andrews
Post by Paul Licameli
If #1, #2, or #3 is enough to fix closing without saving, determine
whether
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now launch
Audacity guaranteed not to have bug 1567 present, but 1567 can still
occur on close without saving.
At any of those three commits, manually deleting old project
folders
before
close without save still stops 1567 occurring, even if there are
two or
more
project windows open. But if SessionData contains any project folders
which are not in use, then 1567 can trigger on close without save.
Gale
Post by Paul Licameli
Also check that the log file no longer routinely contains (as master
does,
even on my computer) error messages related to the temporary files.
PRL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Paul Licameli
2017-01-25 18:13:06 UTC
Permalink
Post by Gale Andrews
Yes Paul I'm frustrated with it and the large number of hours it's
taking to test.
I can see that 1567 doesn't recur on close without save, as long
as SessionData only contains project folders that Audacity is
currently using. Does this suggest a fix (for 1567, not 1521) of
Audacity recognising or handling the old, non-current project
folders in some way?
In one of my messages last night I said that ls -a showed that
project*/e00 was empty, but that the project* folder had a
.DS_Store file. I now see that "sometimes" project*/e00 has a
.DS_Store file as well.
.DS_Store files are created by Finder itself.

Do you have Finder windows open into SessionData or its sub-folders when
you test? Could that be the mystery variable? Could Finder be
repopulating the folders that we thought the program had emptied?

I told you about the new commit that writes more diagnostics to the log.
It might answer the question whether it is a .DS_Store file that is
interfering with the cleanup.
Post by Gale Andrews
My last log posted was actually for when I changed to #if 1 with
5000 ms wait. Regardless, even with #if 0, I still see a progress
bar for removing temporary files which lasts 15 or 20 seconds.
This behaviour was new in this set of commits, but as I understood
it, with seven project* folders to delete, I should only be seeing
a 700 ms wait. Correct?
For each project that contained any audio, at least three folders are
destroyed if cleanup completes. I added a 100 ms wait after each. There
are the .project file, the eXX folders under it, and the dXX folders under
those. There should be at least three folders if any audio is generated,
and there may be more. When I generate 30 s of noise, I get e00 and d00
and six .au files.

So seven projects completely cleaned up would account for 2100 ms at least
of sleeping.
Post by Gale Andrews
Fork and crash on closing last project? Perhaps, though 1567 does
sometimes recur other than on the last project window - it's just rather
less often.
Paul, is there any mileage looking at file processes that are going on
in the sort of tool David mentioned? I might need instruction on this,
if so. I'll also look in the Console app, just in case.
I am not yet familiar with such tools on macOS.

PRL
Post by Gale Andrews
Gale
Post by Paul Licameli
A second fork and crash?
What if Audacity forked and crashed again when the last project is
closed,
Post by Paul Licameli
and cleaned up the temp directory after that? It might fix the remaining
problem.
Some work would be needed to stop creation of an empty project as
happens at
Post by Paul Licameli
startup, and without other work, some global state would be lost, such as
the clipboard, and the memory of the last used effect for command + R.
No, I don't like this idea, but it is a possibility I thought of.
PRL
Post by Paul Licameli
I pushed another commit, a1b6aadf, which should write something to the
log
Post by Paul Licameli
Post by Paul Licameli
when there is a failure to remove one of these folders. Though after
closing the last window, you must open a new window, in order to have
the
Post by Paul Licameli
Post by Paul Licameli
Help menu available so you can see the log again.
There should either be messages that the folder that did not delete
can't
Post by Paul Licameli
Post by Paul Licameli
be enumerated, or else, a list of the files that wxWidgets still detects
inside it.
(I'm feeling very frustrated with this, Gale. You?)
PRL
On Tue, Jan 24, 2017 at 10:20 PM, Paul Licameli <
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/
0988c427b9efd31f26491712f01cc15b46dac085
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Now there are four commits. The first should not fix the bugs but will be
desirable to avoid log messages about "operation not permitted."
The
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
second
does the insufficient, probably unnecessary, but harmless loop to verify
that .au files are removed, waiting at most one second.
What is interesting now is the third commit, which you can call 0988c427^ .
Again, it adds a sleep that you can tune, but only 100 ms as
written,
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
after
removal of each folder.
The only new behaviour with this commit is the progress dialogue for
cleaning up temporary files. This takes 75 seconds to complete. SessionData
contains six old projects, each with an empty e00 folder, plus the one
project which is the project just closed.
All the project*/e00 folders remain after this cleanup attempt.
01:57:55: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344' couldn't be deleted
(error 66: Directory not empty)
01:58:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:10: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342' couldn't be deleted
(error 66: Directory not empty)
01:58:15: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:20: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621' couldn't be deleted
(error 66: Directory not empty)
01:58:25: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:30: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723' couldn't be deleted
(error 66: Directory not empty)
01:58:35: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:40: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266' couldn't be deleted
(error 66: Directory not empty)
01:58:45: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:50: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422' couldn't be deleted
(error 66: Directory not empty)
01:59:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528/e00' couldn't be
deleted (error 66: Directory not empty)
01:59:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528' couldn't be deleted
(error 66: Directory not empty)
Post by Paul Licameli
gain, you can change #if 0 to #if 1 so that this number is an
upper
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
bound
on the wait, which may be shorter.
This just adds the spinning beach ball lasting as long as the
specified
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
wait,
before the progress dialogue appears. I tried 5000 ms with no difference.
Post by Paul Licameli
Again, I want to know if this turns out to be sufficient to fix bug
1567, without the
branch tip commit, 0988c427.
No - it does not.
I tried deleting these same e00 and project* folders, one at a time in FileZilla
3.24.0, which uses wxWidgets 3.0.3. This deletion went without problem and
was instantaneous.
Manually deleting the .DS_Store files in the project* folders before asking
Audacity to delete the folders does not change anything.
Well, this makes no sense. It appears the Audacity program is told
that
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
the folder is not empty, when other programs tell us that it is.
The only other thing I can think of, is that you use terminal, and type
ls -a .../e00
with whatever substitution for ... and this might tell us about certain
hidden files that Finder might not be showing.
PRL
Post by Gale Andrews
Gale
Post by Paul Licameli
On Tue, Jan 24, 2017 at 4:57 PM, Paul Licameli
On Tue, Jan 24, 2017 at 4:46 PM, Paul Licameli
On Tue, Jan 24, 2017 at 4:20 PM, Paul Licameli
On Tue, Jan 24, 2017 at 1:21 PM, Gale Andrews
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567 occurring
on close without save.
On 23 January 2017 at 13:16, Paul Licameli
Post by Paul Licameli
I did git push -f to my origin. There are now three commits
in
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
the
branch.
https://github.com/Paul-Licameli/audacity/commit/
4059b2ae48b57cd075d9cd226cb591b939e5fc6c
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
The head includes the fork-and-crash fix, but could it be that we
don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two
commits
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder
cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal
of
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
folders does
not succeed if done too soon after removal of the contents of the
folder, I
added the other commit one before head. This inserts code to
delay
between
removing files and removing folders. As submitted, it simply
sleeps
by a
number that you can tune. But if you change #if 1 to #if 0, then
instead it
tests in a loop whether it can detect completion of removal of
the
files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing
without
saving
It doesn't stop bug 1567 occurring on close without save, even
if
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
the
close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder? No .au
files left in them? Could there be hidden files? Does ls -a
from
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
terminal
list anything else in them?
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/
e00'
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559' couldn't
be deleted (error 66: Directory not empty)
Specifically there used to be "operation not permitted" messages
in
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
the
log, but now no longer, right? It is something, that the log is tidier,
even on my machine which does not suffer bug 1567.
Is this list of log messages complete?
I now notice this: you did NOT see a log message for the etc/e00/d00
directory. There should have been such a directory in the tree.
So
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
it may
not be that .au files are not cleaned up (in fact they should normally be
deleted already at this point), but rather that the d00 folder was not
removed.
Audacity did not attempt to remove d00.
Or it did, but that failed silently without a log message.
Or it did, but a sleep is needed before attempting to remove the folder
above it.
But this means I have not run out of experiments for you yet.
PRL
So here is what you can do while I write something else: Verify
that
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
folder .../e00/d00 exists before you close without saving. Do the close
without saving in HEAD, with its failed, incomplete cleanup. Is
e00
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
still
present but e00/d00 removed?
If that is so, then this would suggest to me that Audacity did in fact
successfully find and remove the lowest-level folder, but the
removal
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
of it
is somehow asynchronously completed on Sierra, and Audacity should pause a
bit after removing each folder, before trying to remove its parent.
There
may be many folders, so this must be a small pause at most, but
maybe
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
only a
few milliseconds after each is what we need.
PRL
Formerly there were more and different log messages, even on my
computer. You alone get these messages that the directory is not
empty.
But at this point in the program, the call to delete the .au
files
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
has
completed.
Post by Gale Andrews
Post by Paul Licameli
If not, see if 4059b2ae^ does it, with a long enough sleep
that
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
is
not
unreasonable
As submitted, does not clean up empty folders, same message in log.
The only change is the spinning beach ball for 5 seconds
presumably
while
the sleep is performed. So we know that the sleep there will
have
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
an
undesirable visual consequence and I did not bother extending
the
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
sleep.
Post by Paul Licameli
If #2 succeeds, verify that it also works when changing #if 1
to
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
#if
0, but
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on
pressing
"No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the .au
files, and then asks the file system whether the .au files are
really gone,
then the answer it gets is yes, they are really gone.
So what could explain the anomaly that the log tells us the directories
are not empty? Some extraneous files are somehow added to the folders?
PRL
Post by Gale Andrews
Post by Paul Licameli
If #1, #2, or #3 is enough to fix closing without saving,
determine
whether
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now
launch
Audacity guaranteed not to have bug 1567 present, but 1567 can still
occur on close without saving.
At any of those three commits, manually deleting old project
folders
before
close without save still stops 1567 occurring, even if there are
two or
more
project windows open. But if SessionData contains any project folders
which are not in use, then 1567 can trigger on close without
save.
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Gale
Post by Paul Licameli
Also check that the log file no longer routinely contains (as
master
does,
even on my computer) error messages related to the temporary
files.
PRL
------------------------------------------------------------
------------------
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Post by Paul Licameli
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Gale Andrews
2017-01-25 19:41:10 UTC
Permalink
Post by Paul Licameli
Post by Gale Andrews
Yes Paul I'm frustrated with it and the large number of hours it's
taking to test.
I can see that 1567 doesn't recur on close without save, as long
as SessionData only contains project folders that Audacity is
currently using. Does this suggest a fix (for 1567, not 1521) of
Audacity recognising or handling the old, non-current project
folders in some way?
In one of my messages last night I said that ls -a showed that
project*/e00 was empty, but that the project* folder had a
.DS_Store file. I now see that "sometimes" project*/e00 has a
.DS_Store file as well.
.DS_Store files are created by Finder itself.
Do you have Finder windows open into SessionData or its sub-folders when you
test? Could that be the mystery variable? Could Finder be repopulating the
folders that we thought the program had emptied?
It's a while since I tested without a Finder tab/window open at
SessionData, so I'll try again without. If that fixes it, it didn't before.
Post by Paul Licameli
I told you about the new commit that writes more diagnostics to the log. It
might answer the question whether it is a .DS_Store file that is interfering
with the cleanup.
Post by Gale Andrews
My last log posted was actually for when I changed to #if 1 with
5000 ms wait. Regardless, even with #if 0, I still see a progress
bar for removing temporary files which lasts 15 or 20 seconds.
This behaviour was new in this set of commits, but as I understood
it, with seven project* folders to delete, I should only be seeing
a 700 ms wait. Correct?
For each project that contained any audio, at least three folders are
destroyed if cleanup completes. I added a 100 ms wait after each. There
are the .project file, the eXX folders under it, and the dXX folders under
those. There should be at least three folders if any audio is generated,
and there may be more. When I generate 30 s of noise, I get e00 and d00 and
six .au files.
So seven projects completely cleaned up would account for 2100 ms at least
of sleeping.
OK and I guess that is sufficient to case a progress dialogue to appear.

But that new succession of waits seems to have caused an excessive
cleanup time on my machine for folders only containing a few AU files.

That delay isn't there without the wait after each folder deletion.

If these waits are not fixing the bug, I suspect we don't want them in.


Gale
Post by Paul Licameli
Post by Gale Andrews
Fork and crash on closing last project? Perhaps, though 1567 does
sometimes recur other than on the last project window - it's just rather
less often.
Paul, is there any mileage looking at file processes that are going on
in the sort of tool David mentioned? I might need instruction on this,
if so. I'll also look in the Console app, just in case.
I am not yet familiar with such tools on macOS.
PRL
Post by Gale Andrews
Gale
Post by Paul Licameli
A second fork and crash?
What if Audacity forked and crashed again when the last project is closed,
and cleaned up the temp directory after that? It might fix the remaining
problem.
Some work would be needed to stop creation of an empty project as happens at
startup, and without other work, some global state would be lost, such as
the clipboard, and the memory of the last used effect for command + R.
No, I don't like this idea, but it is a possibility I thought of.
PRL
On Tue, Jan 24, 2017 at 11:14 PM, Paul Licameli
Post by Paul Licameli
I pushed another commit, a1b6aadf, which should write something to the log
when there is a failure to remove one of these folders. Though after
closing the last window, you must open a new window, in order to have the
Help menu available so you can see the log again.
There should either be messages that the folder that did not delete can't
be enumerated, or else, a list of the files that wxWidgets still detects
inside it.
(I'm feeling very frustrated with this, Gale. You?)
PRL
On Tue, Jan 24, 2017 at 10:20 PM, Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/0988c427b9efd31f26491712f01cc15b46dac085
Now there are four commits. The first should not fix the bugs but will be
desirable to avoid log messages about "operation not permitted."
The
second
does the insufficient, probably unnecessary, but harmless loop to verify
that .au files are removed, waiting at most one second.
What is interesting now is the third commit, which you can call 0988c427^ .
Again, it adds a sleep that you can tune, but only 100 ms as written,
after
removal of each folder.
The only new behaviour with this commit is the progress dialogue for
cleaning up temporary files. This takes 75 seconds to complete. SessionData
contains six old projects, each with an empty e00 folder, plus the one
project which is the project just closed.
All the project*/e00 folders remain after this cleanup attempt.
01:57:55: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344' couldn't be deleted
(error 66: Directory not empty)
01:58:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:10: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342' couldn't be deleted
(error 66: Directory not empty)
01:58:15: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:20: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621' couldn't be deleted
(error 66: Directory not empty)
01:58:25: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:30: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723' couldn't be deleted
(error 66: Directory not empty)
01:58:35: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:40: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266' couldn't be deleted
(error 66: Directory not empty)
01:58:45: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:50: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422' couldn't be deleted
(error 66: Directory not empty)
01:59:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528/e00' couldn't be
deleted (error 66: Directory not empty)
01:59:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528' couldn't be deleted
(error 66: Directory not empty)
Post by Paul Licameli
gain, you can change #if 0 to #if 1 so that this number is an upper
bound
on the wait, which may be shorter.
This just adds the spinning beach ball lasting as long as the
specified
wait,
before the progress dialogue appears. I tried 5000 ms with no difference.
Post by Paul Licameli
Again, I want to know if this turns out to be sufficient to fix bug
1567, without the
branch tip commit, 0988c427.
No - it does not.
I tried deleting these same e00 and project* folders, one at a time
in
FileZilla
3.24.0, which uses wxWidgets 3.0.3. This deletion went without
problem
and
was instantaneous.
Manually deleting the .DS_Store files in the project* folders before asking
Audacity to delete the folders does not change anything.
Well, this makes no sense. It appears the Audacity program is told that
the folder is not empty, when other programs tell us that it is.
The only other thing I can think of, is that you use terminal, and type
ls -a .../e00
with whatever substitution for ... and this might tell us about certain
hidden files that Finder might not be showing.
PRL
Post by Gale Andrews
Gale
Post by Paul Licameli
On Tue, Jan 24, 2017 at 4:57 PM, Paul Licameli
On Tue, Jan 24, 2017 at 4:46 PM, Paul Licameli
On Tue, Jan 24, 2017 at 4:20 PM, Paul Licameli
On Tue, Jan 24, 2017 at 1:21 PM, Gale Andrews
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567 occurring
on close without save.
On 23 January 2017 at 13:16, Paul Licameli
Post by Paul Licameli
I did git push -f to my origin. There are now three commits in
the
branch.
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b57cd075d9cd226cb591b939e5fc6c
The head includes the fork-and-crash fix, but could it be
that
we
don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits
before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder
cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of
folders does
not succeed if done too soon after removal of the contents of
the
folder, I
added the other commit one before head. This inserts code to
delay
between
removing files and removing folders. As submitted, it simply
sleeps
by a
number that you can tune. But if you change #if 1 to #if 0,
then
instead it
tests in a loop whether it can detect completion of removal of
the
files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing
without
saving
It doesn't stop bug 1567 occurring on close without save, even if
the
close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder?
No
.au
files left in them? Could there be hidden files? Does ls -a from
terminal
list anything else in them?
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559'
couldn't
be deleted (error 66: Directory not empty)
Specifically there used to be "operation not permitted" messages in
the
log, but now no longer, right? It is something, that the log is
tidier,
even on my machine which does not suffer bug 1567.
Is this list of log messages complete?
I now notice this: you did NOT see a log message for the etc/e00/d00
directory. There should have been such a directory in the tree.
So
it may
not be that .au files are not cleaned up (in fact they should
normally be
deleted already at this point), but rather that the d00 folder was
not
removed.
Audacity did not attempt to remove d00.
Or it did, but that failed silently without a log message.
Or it did, but a sleep is needed before attempting to remove the folder
above it.
But this means I have not run out of experiments for you yet.
PRL
So here is what you can do while I write something else: Verify that
folder .../e00/d00 exists before you close without saving. Do the close
without saving in HEAD, with its failed, incomplete cleanup. Is e00
still
present but e00/d00 removed?
If that is so, then this would suggest to me that Audacity did in fact
successfully find and remove the lowest-level folder, but the removal
of it
is somehow asynchronously completed on Sierra, and Audacity should
pause a
bit after removing each folder, before trying to remove its parent.
There
may be many folders, so this must be a small pause at most, but maybe
only a
few milliseconds after each is what we need.
PRL
Formerly there were more and different log messages, even on my
computer. You alone get these messages that the directory is not
empty.
But at this point in the program, the call to delete the .au files
has
completed.
Post by Gale Andrews
Post by Paul Licameli
If not, see if 4059b2ae^ does it, with a long enough sleep that
is
not
unreasonable
As submitted, does not clean up empty folders, same message in log.
The only change is the spinning beach ball for 5 seconds
presumably
while
the sleep is performed. So we know that the sleep there will have
an
undesirable visual consequence and I did not bother extending
the
sleep.
Post by Paul Licameli
If #2 succeeds, verify that it also works when changing #if 1
to
#if
0, but
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on
pressing
"No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the .au
files, and then asks the file system whether the .au files are
really gone,
then the answer it gets is yes, they are really gone.
So what could explain the anomaly that the log tells us the
directories
are not empty? Some extraneous files are somehow added to the
folders?
PRL
Post by Gale Andrews
Post by Paul Licameli
If #1, #2, or #3 is enough to fix closing without saving,
determine
whether
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now
launch
Audacity guaranteed not to have bug 1567 present, but 1567 can
still
occur on close without saving.
At any of those three commits, manually deleting old project
folders
before
close without save still stops 1567 occurring, even if there are
two or
more
project windows open. But if SessionData contains any project
folders
which are not in use, then 1567 can trigger on close without save.
Gale
Post by Paul Licameli
Also check that the log file no longer routinely contains (as
master
does,
even on my computer) error messages related to the temporary
files.
PRL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Gale Andrews
2017-01-27 20:01:21 UTC
Permalink
Summary: Sierra 10.12.3 doesn't do anything for 1567, but I've
attached file monitoring output for clicking "Record" then File >
Close without saving.

Paul's diagnostic and the file monitoring seem to show that Finder
creating .DS_Store files is what causes Audacity to not delete the
project folder. Finder always creates .DS_Store files in 10.12.2 on my
machine, and less often in 10.12.3, whether a Finder window is
watching SessionData or not.
Post by Paul Licameli
I pushed another commit, a1b6aadf, which should write something to the log
when there is a failure to remove one of these folders. Though after
closing the last window, you must open a new window, in order to have the
Help menu available so you can see the log again.
There should either be messages that the folder that did not delete can't be
enumerated, or else, a list of the files that wxWidgets still detects inside
it.
I updated to Sierra 10.12.3. The fork and crash on launch is still needed
there.

The failure to delete project folders (bug 1521) seems slightly improved
in 10.12.3.

Before 10.12.3 I can never delete any project folders. It makes no
difference whether I am watching the SessionData folder in Finder, or
whether I have Xcode IDE open or not. Even if according to ls -a the
folder is empty, Audacity cannot delete the folder and sees in the log
messages Paul added that the folder still contains .DS_STORE. After
the failed folder deletion, ls-a confirms that .DS_STORE is there.

In 10.12.3, "sometimes" the project folder for the project being closed
gets deleted (but older project folders containing .DS_STORE do not).
Again, "sometimes" doesn't relate to whether Finder is watching
SessionData or not. "Sometimes" relates to whether Finder adds a
.DS_Store file or not - if it does so add, Audacity can't delete the folder.

I've attached a "sierra_file_activity.arc" file (rename it to ZIP extension to
unpack it). This contains output on 10.12.3 from two tools, using a
release build from Paul's latest diagnostic commit, recording for a couple
of seconds then File > Close and don't save. The tools are:

* a third-party "filemon" CLI app
( http://newosxbook.com/files/filemon.tgz ) . I think this is not filterable
so I let it run "as is". I only show output from Audacity and Finder in my
attachment because nothing else looked relevant.

* fs_usage which still comes with Sierra:
( https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/fs_usage.1.html
). For that I used the command

sudo fs_usage -w -f filesys <current Audacity PID>

The fs_usage output is vast. Filemon output may be too simple, but it
does show that when Audacity is able to delete the project folder for the
project being closed, Finder does not add a .DS_Store file.

I have not tried fs_usage for Audacity and Finder, and have not tried Xcode
Instruments suggested by David yet.


=== Relationship with bug 1567 ===

As with 10.12.1 and 10.12.2, in 10.12.3, bug 1567 doesn't occur on close
without save if there are no project folders from a previous Audacity session.
This is true even if Audacity has failed to delete the project folder for the
project being closed. 1567 still occurs about one time in three or four on
close without save if there are old folders present.

Still, I have a hunch that trying and failing to delete a folder containing
.DS_Store actually is the key to the remaining 1567 project close
problem. Every other app I tried can delete a folder containing .DS_Store,
even with Finder looking at the folder, so this clear failure to do what is
expected could be triggering 1567 in some way.

Can any of us provoke 1521 by deliberately watching the SessionData
folder in Finder (so encouraging Finder to add a .DS_Store file), and
then on your machines, can Audacity still delete the project folder even if
it contains .DS_Store?

If it helps, here is the current result of
ls -l -a /Users/gale/Library/Application\ Support/Audacity/SessionData/ :

total 24
drwxr-xr-x 8 gale staff 272 Jan 27 17:57 .
drwxr-xr-x 9 gale staff 306 Jan 27 17:57 ..
-rw-r--r--@ 1 gale staff 6148 Jan 27 18:41 .DS_Store
srwx------ 1 gale staff 0 Jan 27 17:57 .audacity.sock
-rw------- 1 gale staff 5 Jan 27 17:57 audacity-lock-gale
drwxr-xr-x 3 gale staff 102 Jan 27 04:43 project12172266
drwxr-xr-x 4 gale staff 136 Jan 27 00:24 project1909113964
drwxr-xr-x 3 gale staff 102 Jan 27 02:47 project2046242277


Gale
Post by Paul Licameli
(I'm feeling very frustrated with this, Gale. You?)
PRL
Paul Licameli
2017-01-27 22:40:32 UTC
Permalink
Gale, your data confirms that Audacity is still detecting .DS_Store

And a close look at the difference between how I enumerate that .DS_Store
in the diagnostic, and on the other hand how files are enumerated to be
removed, suggests that this simple one-line fix may be the remedy:

https://github.com/Paul-Licameli/audacity/commit/10cb8309a7b27cb86a65d4057e8f1c6cd8ba6352

PRL
Post by Gale Andrews
Summary: Sierra 10.12.3 doesn't do anything for 1567, but I've
attached file monitoring output for clicking "Record" then File >
Close without saving.
Paul's diagnostic and the file monitoring seem to show that Finder
creating .DS_Store files is what causes Audacity to not delete the
project folder. Finder always creates .DS_Store files in 10.12.2 on my
machine, and less often in 10.12.3, whether a Finder window is
watching SessionData or not.
Post by Paul Licameli
I pushed another commit, a1b6aadf, which should write something to the
log
Post by Paul Licameli
when there is a failure to remove one of these folders. Though after
closing the last window, you must open a new window, in order to have the
Help menu available so you can see the log again.
There should either be messages that the folder that did not delete
can't be
Post by Paul Licameli
enumerated, or else, a list of the files that wxWidgets still detects
inside
Post by Paul Licameli
it.
I updated to Sierra 10.12.3. The fork and crash on launch is still needed
there.
The failure to delete project folders (bug 1521) seems slightly improved
in 10.12.3.
Before 10.12.3 I can never delete any project folders. It makes no
difference whether I am watching the SessionData folder in Finder, or
whether I have Xcode IDE open or not. Even if according to ls -a the
folder is empty, Audacity cannot delete the folder and sees in the log
messages Paul added that the folder still contains .DS_STORE. After
the failed folder deletion, ls-a confirms that .DS_STORE is there.
In 10.12.3, "sometimes" the project folder for the project being closed
gets deleted (but older project folders containing .DS_STORE do not).
Again, "sometimes" doesn't relate to whether Finder is watching
SessionData or not. "Sometimes" relates to whether Finder adds a
.DS_Store file or not - if it does so add, Audacity can't delete the folder.
I've attached a "sierra_file_activity.arc" file (rename it to ZIP extension to
unpack it). This contains output on 10.12.3 from two tools, using a
release build from Paul's latest diagnostic commit, recording for a couple
* a third-party "filemon" CLI app
( http://newosxbook.com/files/filemon.tgz ) . I think this is not filterable
so I let it run "as is". I only show output from Audacity and Finder in my
attachment because nothing else looked relevant.
( https://developer.apple.com/legacy/library/documentation/
Darwin/Reference/ManPages/man1/fs_usage.1.html
). For that I used the command
sudo fs_usage -w -f filesys <current Audacity PID>
The fs_usage output is vast. Filemon output may be too simple, but it
does show that when Audacity is able to delete the project folder for the
project being closed, Finder does not add a .DS_Store file.
I have not tried fs_usage for Audacity and Finder, and have not tried Xcode
Instruments suggested by David yet.
=== Relationship with bug 1567 ===
As with 10.12.1 and 10.12.2, in 10.12.3, bug 1567 doesn't occur on close
without save if there are no project folders from a previous Audacity session.
This is true even if Audacity has failed to delete the project folder for the
project being closed. 1567 still occurs about one time in three or four on
close without save if there are old folders present.
Still, I have a hunch that trying and failing to delete a folder containing
.DS_Store actually is the key to the remaining 1567 project close
problem. Every other app I tried can delete a folder containing .DS_Store,
even with Finder looking at the folder, so this clear failure to do what is
expected could be triggering 1567 in some way.
Can any of us provoke 1521 by deliberately watching the SessionData
folder in Finder (so encouraging Finder to add a .DS_Store file), and
then on your machines, can Audacity still delete the project folder even if
it contains .DS_Store?
If it helps, here is the current result of
total 24
drwxr-xr-x 8 gale staff 272 Jan 27 17:57 .
drwxr-xr-x 9 gale staff 306 Jan 27 17:57 ..
srwx------ 1 gale staff 0 Jan 27 17:57 .audacity.sock
-rw------- 1 gale staff 5 Jan 27 17:57 audacity-lock-gale
drwxr-xr-x 3 gale staff 102 Jan 27 04:43 project12172266
drwxr-xr-x 4 gale staff 136 Jan 27 00:24 project1909113964
drwxr-xr-x 3 gale staff 102 Jan 27 02:47 project2046242277
Gale
Post by Paul Licameli
(I'm feeling very frustrated with this, Gale. You?)
PRL
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
James Crook
2017-01-28 11:36:53 UTC
Permalink
Whether or not it fixes the issue, it is more correct with respect to
.DS_Store, so I cherry picked it.
Thanks Paul. At the very least it's a good idea.

--James.
Post by Paul Licameli
Gale, your data confirms that Audacity is still detecting .DS_Store
And a close look at the difference between how I enumerate that .DS_Store
in the diagnostic, and on the other hand how files are enumerated to be
https://github.com/Paul-Licameli/audacity/commit/10cb8309a7b27cb86a65d4057e8f1c6cd8ba6352
PRL
Post by Gale Andrews
Summary: Sierra 10.12.3 doesn't do anything for 1567, but I've
attached file monitoring output for clicking "Record" then File >
Close without saving.
Paul's diagnostic and the file monitoring seem to show that Finder
creating .DS_Store files is what causes Audacity to not delete the
project folder. Finder always creates .DS_Store files in 10.12.2 on my
machine, and less often in 10.12.3, whether a Finder window is
watching SessionData or not.
Post by Paul Licameli
I pushed another commit, a1b6aadf, which should write something to the
log
Post by Paul Licameli
when there is a failure to remove one of these folders. Though after
closing the last window, you must open a new window, in order to have the
Help menu available so you can see the log again.
There should either be messages that the folder that did not delete
can't be
Post by Paul Licameli
enumerated, or else, a list of the files that wxWidgets still detects
inside
Post by Paul Licameli
it.
I updated to Sierra 10.12.3. The fork and crash on launch is still needed
there.
The failure to delete project folders (bug 1521) seems slightly improved
in 10.12.3.
Before 10.12.3 I can never delete any project folders. It makes no
difference whether I am watching the SessionData folder in Finder, or
whether I have Xcode IDE open or not. Even if according to ls -a the
folder is empty, Audacity cannot delete the folder and sees in the log
messages Paul added that the folder still contains .DS_STORE. After
the failed folder deletion, ls-a confirms that .DS_STORE is there.
In 10.12.3, "sometimes" the project folder for the project being closed
gets deleted (but older project folders containing .DS_STORE do not).
Again, "sometimes" doesn't relate to whether Finder is watching
SessionData or not. "Sometimes" relates to whether Finder adds a
.DS_Store file or not - if it does so add, Audacity can't delete the folder.
I've attached a "sierra_file_activity.arc" file (rename it to ZIP extension to
unpack it). This contains output on 10.12.3 from two tools, using a
release build from Paul's latest diagnostic commit, recording for a couple
* a third-party "filemon" CLI app
( http://newosxbook.com/files/filemon.tgz ) . I think this is not filterable
so I let it run "as is". I only show output from Audacity and Finder in my
attachment because nothing else looked relevant.
( https://developer.apple.com/legacy/library/documentation/
Darwin/Reference/ManPages/man1/fs_usage.1.html
). For that I used the command
sudo fs_usage -w -f filesys <current Audacity PID>
The fs_usage output is vast. Filemon output may be too simple, but it
does show that when Audacity is able to delete the project folder for the
project being closed, Finder does not add a .DS_Store file.
I have not tried fs_usage for Audacity and Finder, and have not tried Xcode
Instruments suggested by David yet.
=== Relationship with bug 1567 ===
As with 10.12.1 and 10.12.2, in 10.12.3, bug 1567 doesn't occur on close
without save if there are no project folders from a previous Audacity session.
This is true even if Audacity has failed to delete the project folder for the
project being closed. 1567 still occurs about one time in three or four on
close without save if there are old folders present.
Still, I have a hunch that trying and failing to delete a folder containing
.DS_Store actually is the key to the remaining 1567 project close
problem. Every other app I tried can delete a folder containing .DS_Store,
even with Finder looking at the folder, so this clear failure to do what is
expected could be triggering 1567 in some way.
Can any of us provoke 1521 by deliberately watching the SessionData
folder in Finder (so encouraging Finder to add a .DS_Store file), and
then on your machines, can Audacity still delete the project folder even if
it contains .DS_Store?
If it helps, here is the current result of
total 24
drwxr-xr-x 8 gale staff 272 Jan 27 17:57 .
drwxr-xr-x 9 gale staff 306 Jan 27 17:57 ..
srwx------ 1 gale staff 0 Jan 27 17:57 .audacity.sock
-rw------- 1 gale staff 5 Jan 27 17:57 audacity-lock-gale
drwxr-xr-x 3 gale staff 102 Jan 27 04:43 project12172266
drwxr-xr-x 4 gale staff 136 Jan 27 00:24 project1909113964
drwxr-xr-x 3 gale staff 102 Jan 27 02:47 project2046242277
Gale
Post by Paul Licameli
(I'm feeling very frustrated with this, Gale. You?)
PRL
Gale Andrews
2017-01-28 20:33:35 UTC
Permalink
Summary: Thanks, Paul. Folders containing .DS_Store can now be
deleted on closing the last project window and I don't get 1567 in
that scenario.

However when saving a project, any .DS_Store file in its SessionData
project folder prevents deletion of that folder, and 1567 can then occur
after the project save.

Also I now get 1567 if there are two or more unsaved projects then I
close any of them without saving (unless I'm closing the last project).
More on this below.
Post by Paul Licameli
Gale, your data confirms that Audacity is still detecting .DS_Store
And a close look at the difference between how I enumerate that .DS_Store in
the diagnostic, and on the other hand how files are enumerated to be
https://github.com/Paul-Licameli/audacity/commit/10cb8309a7b27cb86a65d4057e8f1c6cd8ba6352
PRL
Paul, I'm now trying HEAD, given it has the fixes we think we want (minus
the added sleeps that don't help with 1567).

With Finder looking at SessionData, I launched HEAD, recorded two seconds,
then File > Close... and did not save changes. The project folder for the
recording, and the old project folders containing .DS_Store files from previous
Audacity sessions, were all removed with no errors in the log and 1567 did
not occur. The filemon tool shows that Finder did add a .DS_Store file to
the newly recorded project. The .DS_Store file and .audacity.sock file in root
of SessionData were left alone.

So that all seems good. I also tried adding a backup of one of the old project
folders containing .DS_Store back into SessionData, as a user perhaps
might if they have some problem with Automatic Crash Recovery, then did
File > Close (or recorded then File > Close) without saving. I tried one or
other of those five times, and the old project was removed and Bug 1567
did not occur. So this seems good too.

Then I recorded and did File > Exit without saving instead of File > Close.
The new project folder was deleted and 1567 did not occur on launch
(not that I expected it to).

Then I relaunched Audacity and iterated record, close without saving,
File > New and repeated that, twenty times. Bug 1567 did not occur.

There are still two issues. When saving a project, any .DS_Store file in
its SessionData project folder prevents deletion of that folder, as proved
by the Audacity log. Every few times I save a project and the SessionData
project folder can't be deleted, 1567 occurs. This was the case before
the latest commit, even with no old project folders present - I just never
tested it sufficient times.

Also 1567 occurs every few times if I record, stop, File > New, record,
stop then File > Close one of the projects without saving (provided the
project being closed is not the last). This did not seem to occur before
if there were no old project folders present. However that could just be
red herring, and perhaps we should persist with our efforts to stop doing
things to the file system that fail, or are unexpected.

Note that when we close without save on projects other than the last one,
we delete the AUTOSAVE file of the closed project, but we let its project
folder remain until we close the last project. This does not produce an
error in the log, but is there a reason we retain the temp data for the
closed project?

The only case I can think of when this might help a user is if it was an
unedited recording, and they closed in error. They would then be able
to manually recover the recording using the old 1.2 Recovery Tools.
OTOH if the user is short of space this is unhelpful behaviour and I
must now wonder if it might be directly triggering 1567 on my machine.

Of course it may be a risk to change this behaviour now for 2.1.3, even
if we wanted to.



Gale
Post by Paul Licameli
Post by Gale Andrews
Summary: Sierra 10.12.3 doesn't do anything for 1567, but I've
attached file monitoring output for clicking "Record" then File >
Close without saving.
Paul's diagnostic and the file monitoring seem to show that Finder
creating .DS_Store files is what causes Audacity to not delete the
project folder. Finder always creates .DS_Store files in 10.12.2 on my
machine, and less often in 10.12.3, whether a Finder window is
watching SessionData or not.
Post by Paul Licameli
I pushed another commit, a1b6aadf, which should write something to the log
when there is a failure to remove one of these folders. Though after
closing the last window, you must open a new window, in order to have the
Help menu available so you can see the log again.
There should either be messages that the folder that did not delete can't be
enumerated, or else, a list of the files that wxWidgets still detects inside
it.
I updated to Sierra 10.12.3. The fork and crash on launch is still needed
there.
The failure to delete project folders (bug 1521) seems slightly improved
in 10.12.3.
Before 10.12.3 I can never delete any project folders. It makes no
difference whether I am watching the SessionData folder in Finder, or
whether I have Xcode IDE open or not. Even if according to ls -a the
folder is empty, Audacity cannot delete the folder and sees in the log
messages Paul added that the folder still contains .DS_STORE. After
the failed folder deletion, ls-a confirms that .DS_STORE is there.
In 10.12.3, "sometimes" the project folder for the project being closed
gets deleted (but older project folders containing .DS_STORE do not).
Again, "sometimes" doesn't relate to whether Finder is watching
SessionData or not. "Sometimes" relates to whether Finder adds a
.DS_Store file or not - if it does so add, Audacity can't delete the folder.
I've attached a "sierra_file_activity.arc" file (rename it to ZIP extension to
unpack it). This contains output on 10.12.3 from two tools, using a
release build from Paul's latest diagnostic commit, recording for a couple
* a third-party "filemon" CLI app
( http://newosxbook.com/files/filemon.tgz ) . I think this is not filterable
so I let it run "as is". I only show output from Audacity and Finder in my
attachment because nothing else looked relevant.
(
https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/fs_usage.1.html
). For that I used the command
sudo fs_usage -w -f filesys <current Audacity PID>
The fs_usage output is vast. Filemon output may be too simple, but it
does show that when Audacity is able to delete the project folder for the
project being closed, Finder does not add a .DS_Store file.
I have not tried fs_usage for Audacity and Finder, and have not tried Xcode
Instruments suggested by David yet.
=== Relationship with bug 1567 ===
As with 10.12.1 and 10.12.2, in 10.12.3, bug 1567 doesn't occur on close
without save if there are no project folders from a previous Audacity session.
This is true even if Audacity has failed to delete the project folder for the
project being closed. 1567 still occurs about one time in three or four on
close without save if there are old folders present.
Still, I have a hunch that trying and failing to delete a folder containing
.DS_Store actually is the key to the remaining 1567 project close
problem. Every other app I tried can delete a folder containing .DS_Store,
even with Finder looking at the folder, so this clear failure to do what is
expected could be triggering 1567 in some way.
Can any of us provoke 1521 by deliberately watching the SessionData
folder in Finder (so encouraging Finder to add a .DS_Store file), and
then on your machines, can Audacity still delete the project folder even if
it contains .DS_Store?
If it helps, here is the current result of
total 24
drwxr-xr-x 8 gale staff 272 Jan 27 17:57 .
drwxr-xr-x 9 gale staff 306 Jan 27 17:57 ..
srwx------ 1 gale staff 0 Jan 27 17:57 .audacity.sock
-rw------- 1 gale staff 5 Jan 27 17:57 audacity-lock-gale
drwxr-xr-x 3 gale staff 102 Jan 27 04:43 project12172266
drwxr-xr-x 4 gale staff 136 Jan 27 00:24 project1909113964
drwxr-xr-x 3 gale staff 102 Jan 27 02:47 project2046242277
Gale
Post by Paul Licameli
(I'm feeling very frustrated with this, Gale. You?)
PRL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Paul Licameli
2017-01-28 22:32:07 UTC
Permalink
https://github.com/Paul-Licameli/audacity/commit/6b65375ee5b3990ec6764dbd71c02b7d9931b660

Gale, this is progress, and your report make me think I can fix the saving
problem finally with the commit above.

I do not understand though why you would have the problem when recording in
two projects.

PRL
Post by Gale Andrews
Summary: Thanks, Paul. Folders containing .DS_Store can now be
deleted on closing the last project window and I don't get 1567 in
that scenario.
However when saving a project, any .DS_Store file in its SessionData
project folder prevents deletion of that folder, and 1567 can then occur
after the project save.
Also I now get 1567 if there are two or more unsaved projects then I
close any of them without saving (unless I'm closing the last project).
More on this below.
Post by Paul Licameli
Gale, your data confirms that Audacity is still detecting .DS_Store
And a close look at the difference between how I enumerate that
.DS_Store in
Post by Paul Licameli
the diagnostic, and on the other hand how files are enumerated to be
https://github.com/Paul-Licameli/audacity/commit/
10cb8309a7b27cb86a65d4057e8f1c6cd8ba6352
Post by Paul Licameli
PRL
Paul, I'm now trying HEAD, given it has the fixes we think we want (minus
the added sleeps that don't help with 1567).
With Finder looking at SessionData, I launched HEAD, recorded two seconds,
then File > Close... and did not save changes. The project folder for the
recording, and the old project folders containing .DS_Store files from previous
Audacity sessions, were all removed with no errors in the log and 1567 did
not occur. The filemon tool shows that Finder did add a .DS_Store file to
the newly recorded project. The .DS_Store file and .audacity.sock file in root
of SessionData were left alone.
So that all seems good. I also tried adding a backup of one of the old project
folders containing .DS_Store back into SessionData, as a user perhaps
might if they have some problem with Automatic Crash Recovery, then did
File > Close (or recorded then File > Close) without saving. I tried one or
other of those five times, and the old project was removed and Bug 1567
did not occur. So this seems good too.
Then I recorded and did File > Exit without saving instead of File > Close.
The new project folder was deleted and 1567 did not occur on launch
(not that I expected it to).
Then I relaunched Audacity and iterated record, close without saving,
File > New and repeated that, twenty times. Bug 1567 did not occur.
There are still two issues. When saving a project, any .DS_Store file in
its SessionData project folder prevents deletion of that folder, as proved
by the Audacity log. Every few times I save a project and the SessionData
project folder can't be deleted, 1567 occurs. This was the case before
the latest commit, even with no old project folders present - I just never
tested it sufficient times.
Also 1567 occurs every few times if I record, stop, File > New, record,
stop then File > Close one of the projects without saving (provided the
project being closed is not the last). This did not seem to occur before
if there were no old project folders present. However that could just be
red herring, and perhaps we should persist with our efforts to stop doing
things to the file system that fail, or are unexpected.
Note that when we close without save on projects other than the last one,
we delete the AUTOSAVE file of the closed project, but we let its project
folder remain until we close the last project. This does not produce an
error in the log, but is there a reason we retain the temp data for the
closed project?
The only case I can think of when this might help a user is if it was an
unedited recording, and they closed in error. They would then be able
to manually recover the recording using the old 1.2 Recovery Tools.
OTOH if the user is short of space this is unhelpful behaviour and I
must now wonder if it might be directly triggering 1567 on my machine.
Of course it may be a risk to change this behaviour now for 2.1.3, even
if we wanted to.
Gale
Post by Paul Licameli
Post by Gale Andrews
Summary: Sierra 10.12.3 doesn't do anything for 1567, but I've
attached file monitoring output for clicking "Record" then File >
Close without saving.
Paul's diagnostic and the file monitoring seem to show that Finder
creating .DS_Store files is what causes Audacity to not delete the
project folder. Finder always creates .DS_Store files in 10.12.2 on my
machine, and less often in 10.12.3, whether a Finder window is
watching SessionData or not.
Post by Paul Licameli
I pushed another commit, a1b6aadf, which should write something to the log
when there is a failure to remove one of these folders. Though after
closing the last window, you must open a new window, in order to have the
Help menu available so you can see the log again.
There should either be messages that the folder that did not delete can't be
enumerated, or else, a list of the files that wxWidgets still detects inside
it.
I updated to Sierra 10.12.3. The fork and crash on launch is still
needed
Post by Paul Licameli
Post by Gale Andrews
there.
The failure to delete project folders (bug 1521) seems slightly improved
in 10.12.3.
Before 10.12.3 I can never delete any project folders. It makes no
difference whether I am watching the SessionData folder in Finder, or
whether I have Xcode IDE open or not. Even if according to ls -a the
folder is empty, Audacity cannot delete the folder and sees in the log
messages Paul added that the folder still contains .DS_STORE. After
the failed folder deletion, ls-a confirms that .DS_STORE is there.
In 10.12.3, "sometimes" the project folder for the project being closed
gets deleted (but older project folders containing .DS_STORE do not).
Again, "sometimes" doesn't relate to whether Finder is watching
SessionData or not. "Sometimes" relates to whether Finder adds a
.DS_Store file or not - if it does so add, Audacity can't delete the folder.
I've attached a "sierra_file_activity.arc" file (rename it to ZIP extension to
unpack it). This contains output on 10.12.3 from two tools, using a
release build from Paul's latest diagnostic commit, recording for a
couple
Post by Paul Licameli
Post by Gale Andrews
* a third-party "filemon" CLI app
( http://newosxbook.com/files/filemon.tgz ) . I think this is not filterable
so I let it run "as is". I only show output from Audacity and Finder
in
Post by Paul Licameli
Post by Gale Andrews
my
attachment because nothing else looked relevant.
(
https://developer.apple.com/legacy/library/documentation/
Darwin/Reference/ManPages/man1/fs_usage.1.html
Post by Paul Licameli
Post by Gale Andrews
). For that I used the command
sudo fs_usage -w -f filesys <current Audacity PID>
The fs_usage output is vast. Filemon output may be too simple, but it
does show that when Audacity is able to delete the project folder for
the
Post by Paul Licameli
Post by Gale Andrews
project being closed, Finder does not add a .DS_Store file.
I have not tried fs_usage for Audacity and Finder, and have not tried Xcode
Instruments suggested by David yet.
=== Relationship with bug 1567 ===
As with 10.12.1 and 10.12.2, in 10.12.3, bug 1567 doesn't occur on close
without save if there are no project folders from a previous Audacity session.
This is true even if Audacity has failed to delete the project folder
for
Post by Paul Licameli
Post by Gale Andrews
the
project being closed. 1567 still occurs about one time in three or four
on
Post by Paul Licameli
Post by Gale Andrews
close without save if there are old folders present.
Still, I have a hunch that trying and failing to delete a folder containing
.DS_Store actually is the key to the remaining 1567 project close
problem. Every other app I tried can delete a folder containing
.DS_Store,
Post by Paul Licameli
Post by Gale Andrews
even with Finder looking at the folder, so this clear failure to do what is
expected could be triggering 1567 in some way.
Can any of us provoke 1521 by deliberately watching the SessionData
folder in Finder (so encouraging Finder to add a .DS_Store file), and
then on your machines, can Audacity still delete the project folder even if
it contains .DS_Store?
If it helps, here is the current result of
ls -l -a /Users/gale/Library/Application\
total 24
drwxr-xr-x 8 gale staff 272 Jan 27 17:57 .
drwxr-xr-x 9 gale staff 306 Jan 27 17:57 ..
srwx------ 1 gale staff 0 Jan 27 17:57 .audacity.sock
-rw------- 1 gale staff 5 Jan 27 17:57 audacity-lock-gale
drwxr-xr-x 3 gale staff 102 Jan 27 04:43 project12172266
drwxr-xr-x 4 gale staff 136 Jan 27 00:24 project1909113964
drwxr-xr-x 3 gale staff 102 Jan 27 02:47 project2046242277
Gale
Post by Paul Licameli
(I'm feeling very frustrated with this, Gale. You?)
PRL
------------------------------------------------------------
------------------
Post by Paul Licameli
Post by Gale Andrews
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Post by Paul Licameli
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Gale Andrews
2017-01-31 16:39:30 UTC
Permalink
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/6b65375ee5b3990ec6764dbd71c02b7d9931b660
Gale, this is progress, and your report make me think I can fix the saving
problem finally with the commit above.
Thanks, Paul. Sorry it's taken a few days to test. It isn't quite fixed.
When saving, the root project* folder in SessionData always gets
left behind (e* and d* folders are removed). There are no errors in
the log for the left behind folder, so the presence of a .DS_Store
file is not the cause of the folder getting left behind.

The left-behind project* folder does get removed on closing the
project *if* it's the only remaining project, otherwise it still gets left
behind on close.

Save Project can still trigger 1567, if a .DS_Store file gets added to
the left-behind root project* folder in SessionData immediately after
the save removes the original .DS_Store file. If Finder does not add
the new .DS_Store file quickly enough e.g. a few seconds after the
save, then 1567 doesn't occur.

So can we just get rid of the root project* folder when we save?
Post by Paul Licameli
I do not understand though why you would have the problem when
recording in two projects.
I think I now do understand. I remarked that when there are two or more
projects, File > Close does not remove the data for the closed project.
I was wrong about that, because I was not automatically seeing the
refreshed file structure when I tested on Windows.

What does happen in the case of two or more projects is that the project
folder and its d* and e* subfolders are left behind, emptied of the AU files.
The same thing then happens to trigger 1567 as happens with Save
Project. The folders are there for Finder to add a new .DS_Store file to,
and if this happens soon enough after the close, 1567 triggers.

I would predict if we remove these un-necessary empty folders (on all
platforms of course) then the residual symptoms of 1567 will be gone -
on my machine, anyway.


Gale
Post by Paul Licameli
Post by Gale Andrews
Summary: Thanks, Paul. Folders containing .DS_Store can now be
deleted on closing the last project window and I don't get 1567 in
that scenario.
However when saving a project, any .DS_Store file in its SessionData
project folder prevents deletion of that folder, and 1567 can then occur
after the project save.
Also I now get 1567 if there are two or more unsaved projects then I
close any of them without saving (unless I'm closing the last project).
More on this below.
Post by Paul Licameli
Gale, your data confirms that Audacity is still detecting .DS_Store
And a close look at the difference between how I enumerate that .DS_Store in
the diagnostic, and on the other hand how files are enumerated to be
https://github.com/Paul-Licameli/audacity/commit/10cb8309a7b27cb86a65d4057e8f1c6cd8ba6352
PRL
Paul, I'm now trying HEAD, given it has the fixes we think we want (minus
the added sleeps that don't help with 1567).
With Finder looking at SessionData, I launched HEAD, recorded two seconds,
then File > Close... and did not save changes. The project folder for the
recording, and the old project folders containing .DS_Store files from previous
Audacity sessions, were all removed with no errors in the log and 1567 did
not occur. The filemon tool shows that Finder did add a .DS_Store file to
the newly recorded project. The .DS_Store file and .audacity.sock file in root
of SessionData were left alone.
So that all seems good. I also tried adding a backup of one of the old project
folders containing .DS_Store back into SessionData, as a user perhaps
might if they have some problem with Automatic Crash Recovery, then did
File > Close (or recorded then File > Close) without saving. I tried one or
other of those five times, and the old project was removed and Bug 1567
did not occur. So this seems good too.
Then I recorded and did File > Exit without saving instead of File > Close.
The new project folder was deleted and 1567 did not occur on launch
(not that I expected it to).
Then I relaunched Audacity and iterated record, close without saving,
File > New and repeated that, twenty times. Bug 1567 did not occur.
There are still two issues. When saving a project, any .DS_Store file in
its SessionData project folder prevents deletion of that folder, as proved
by the Audacity log. Every few times I save a project and the SessionData
project folder can't be deleted, 1567 occurs. This was the case before
the latest commit, even with no old project folders present - I just never
tested it sufficient times.
Also 1567 occurs every few times if I record, stop, File > New, record,
stop then File > Close one of the projects without saving (provided the
project being closed is not the last). This did not seem to occur before
if there were no old project folders present. However that could just be
red herring, and perhaps we should persist with our efforts to stop doing
things to the file system that fail, or are unexpected.
Note that when we close without save on projects other than the last one,
we delete the AUTOSAVE file of the closed project, but we let its project
folder remain until we close the last project. This does not produce an
error in the log, but is there a reason we retain the temp data for the
closed project?
The only case I can think of when this might help a user is if it was an
unedited recording, and they closed in error. They would then be able
to manually recover the recording using the old 1.2 Recovery Tools.
OTOH if the user is short of space this is unhelpful behaviour and I
must now wonder if it might be directly triggering 1567 on my machine.
Of course it may be a risk to change this behaviour now for 2.1.3, even
if we wanted to.
Gale
Post by Paul Licameli
Post by Gale Andrews
Summary: Sierra 10.12.3 doesn't do anything for 1567, but I've
attached file monitoring output for clicking "Record" then File >
Close without saving.
Paul's diagnostic and the file monitoring seem to show that Finder
creating .DS_Store files is what causes Audacity to not delete the
project folder. Finder always creates .DS_Store files in 10.12.2 on my
machine, and less often in 10.12.3, whether a Finder window is
watching SessionData or not.
Post by Paul Licameli
I pushed another commit, a1b6aadf, which should write something to the
log
when there is a failure to remove one of these folders. Though after
closing the last window, you must open a new window, in order to have the
Help menu available so you can see the log again.
There should either be messages that the folder that did not delete can't be
enumerated, or else, a list of the files that wxWidgets still detects inside
it.
I updated to Sierra 10.12.3. The fork and crash on launch is still needed
there.
The failure to delete project folders (bug 1521) seems slightly improved
in 10.12.3.
Before 10.12.3 I can never delete any project folders. It makes no
difference whether I am watching the SessionData folder in Finder, or
whether I have Xcode IDE open or not. Even if according to ls -a the
folder is empty, Audacity cannot delete the folder and sees in the log
messages Paul added that the folder still contains .DS_STORE. After
the failed folder deletion, ls-a confirms that .DS_STORE is there.
In 10.12.3, "sometimes" the project folder for the project being closed
gets deleted (but older project folders containing .DS_STORE do not).
Again, "sometimes" doesn't relate to whether Finder is watching
SessionData or not. "Sometimes" relates to whether Finder adds a
.DS_Store file or not - if it does so add, Audacity can't delete the folder.
I've attached a "sierra_file_activity.arc" file (rename it to ZIP extension to
unpack it). This contains output on 10.12.3 from two tools, using a
release build from Paul's latest diagnostic commit, recording for a couple
* a third-party "filemon" CLI app
( http://newosxbook.com/files/filemon.tgz ) . I think this is not filterable
so I let it run "as is". I only show output from Audacity and Finder
in
my
attachment because nothing else looked relevant.
(
https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/fs_usage.1.html
). For that I used the command
sudo fs_usage -w -f filesys <current Audacity PID>
The fs_usage output is vast. Filemon output may be too simple, but it
does show that when Audacity is able to delete the project folder for the
project being closed, Finder does not add a .DS_Store file.
I have not tried fs_usage for Audacity and Finder, and have not tried Xcode
Instruments suggested by David yet.
=== Relationship with bug 1567 ===
As with 10.12.1 and 10.12.2, in 10.12.3, bug 1567 doesn't occur on close
without save if there are no project folders from a previous Audacity session.
This is true even if Audacity has failed to delete the project folder
for
the
project being closed. 1567 still occurs about one time in three or four on
close without save if there are old folders present.
Still, I have a hunch that trying and failing to delete a folder containing
.DS_Store actually is the key to the remaining 1567 project close
problem. Every other app I tried can delete a folder containing .DS_Store,
even with Finder looking at the folder, so this clear failure to do
what
is
expected could be triggering 1567 in some way.
Can any of us provoke 1521 by deliberately watching the SessionData
folder in Finder (so encouraging Finder to add a .DS_Store file), and
then on your machines, can Audacity still delete the project folder
even
if
it contains .DS_Store?
If it helps, here is the current result of
ls -l -a /Users/gale/Library/Application\
total 24
drwxr-xr-x 8 gale staff 272 Jan 27 17:57 .
drwxr-xr-x 9 gale staff 306 Jan 27 17:57 ..
srwx------ 1 gale staff 0 Jan 27 17:57 .audacity.sock
-rw------- 1 gale staff 5 Jan 27 17:57 audacity-lock-gale
drwxr-xr-x 3 gale staff 102 Jan 27 04:43 project12172266
drwxr-xr-x 4 gale staff 136 Jan 27 00:24 project1909113964
drwxr-xr-x 3 gale staff 102 Jan 27 02:47 project2046242277
Gale
Post by Paul Licameli
(I'm feeling very frustrated with this, Gale. You?)
PRL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Paul Licameli
2017-01-31 18:02:52 UTC
Permalink
Post by Paul Licameli
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/
6b65375ee5b3990ec6764dbd71c02b7d9931b660
Post by Paul Licameli
Gale, this is progress, and your report make me think I can fix the
saving
Post by Paul Licameli
problem finally with the commit above.
Thanks, Paul. Sorry it's taken a few days to test. It isn't quite fixed.
When saving, the root project* folder in SessionData always gets
left behind (e* and d* folders are removed). There are no errors in
the log for the left behind folder, so the presence of a .DS_Store
file is not the cause of the folder getting left behind.
You caught me. The fix that was submitted had this unintended effect. I
have written the fix for the fix. See other email thread.
Post by Paul Licameli
The left-behind project* folder does get removed on closing the
project *if* it's the only remaining project, otherwise it still gets left
behind on close.
Do you mean: when the last project closes, then other projects' project*
folders are belatedly removed? That would make sense.
Post by Paul Licameli
Save Project can still trigger 1567, if a .DS_Store file gets added to
the left-behind root project* folder in SessionData immediately after
the save removes the original .DS_Store file. If Finder does not add
the new .DS_Store file quickly enough e.g. a few seconds after the
save, then 1567 doesn't occur.
Maybe my new fix mentioned above decreases the likelihood of this, because
it will remove that folder sooner.
Post by Paul Licameli
So can we just get rid of the root project* folder when we save?
We will.

Now another question arises. If we make the cleanup of temporary projects
work as well as possible, is that fork-and-crash no longer necessary? Or,
does it still contribute something else to the fix?

I would like to avoid the fork-and-crash if possible, because it is just
such a weird thing to do, whereas the other fixes are simply a matter of
doing file system operations in a different sequence from before. The
simple way for you to test is to find and delete these lines from
AudacityApp.h :

#if ! defined(__WXDEBUG__)

#define FIX_BUG1567

#endif
Post by Paul Licameli
Post by Paul Licameli
I do not understand though why you would have the problem when
recording in two projects.
I think I now do understand. I remarked that when there are two or more
projects, File > Close does not remove the data for the closed project.
I was wrong about that, because I was not automatically seeing the
refreshed file structure when I tested on Windows.
What does happen in the case of two or more projects is that the project
folder and its d* and e* subfolders are left behind, emptied of the AU files.
The same thing then happens to trigger 1567 as happens with Save
Project. The folders are there for Finder to add a new .DS_Store file to,
and if this happens soon enough after the close, 1567 triggers.
I would predict if we remove these un-necessary empty folders (on all
platforms of course) then the residual symptoms of 1567 will be gone -
on my machine, anyway.
This explanation has set me thinking about how to fix it. This may suggest
already the negative answer to the question above: "Are these file
management changes sufficient without fork-and-crash?"

Implementing this fix, though, might be diminishing returns as this point.
It might get more involved than the other fixes, and all for a much less
likely use case, recording into each of two simultaneously open projects.

PRL
Post by Paul Licameli
Gale
Post by Paul Licameli
Post by Gale Andrews
Summary: Thanks, Paul. Folders containing .DS_Store can now be
deleted on closing the last project window and I don't get 1567 in
that scenario.
However when saving a project, any .DS_Store file in its SessionData
project folder prevents deletion of that folder, and 1567 can then occur
after the project save.
Also I now get 1567 if there are two or more unsaved projects then I
close any of them without saving (unless I'm closing the last project).
More on this below.
Post by Paul Licameli
Gale, your data confirms that Audacity is still detecting .DS_Store
And a close look at the difference between how I enumerate that .DS_Store in
the diagnostic, and on the other hand how files are enumerated to be
https://github.com/Paul-Licameli/audacity/commit/
10cb8309a7b27cb86a65d4057e8f1c6cd8ba6352
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
PRL
Paul, I'm now trying HEAD, given it has the fixes we think we want
(minus
Post by Paul Licameli
Post by Gale Andrews
the added sleeps that don't help with 1567).
With Finder looking at SessionData, I launched HEAD, recorded two
seconds,
Post by Paul Licameli
Post by Gale Andrews
then File > Close... and did not save changes. The project folder for
the
Post by Paul Licameli
Post by Gale Andrews
recording, and the old project folders containing .DS_Store files from previous
Audacity sessions, were all removed with no errors in the log and 1567
did
Post by Paul Licameli
Post by Gale Andrews
not occur. The filemon tool shows that Finder did add a .DS_Store file
to
Post by Paul Licameli
Post by Gale Andrews
the newly recorded project. The .DS_Store file and .audacity.sock file
in
Post by Paul Licameli
Post by Gale Andrews
root
of SessionData were left alone.
So that all seems good. I also tried adding a backup of one of the old project
folders containing .DS_Store back into SessionData, as a user perhaps
might if they have some problem with Automatic Crash Recovery, then did
File > Close (or recorded then File > Close) without saving. I tried one or
other of those five times, and the old project was removed and Bug 1567
did not occur. So this seems good too.
Then I recorded and did File > Exit without saving instead of File > Close.
The new project folder was deleted and 1567 did not occur on launch
(not that I expected it to).
Then I relaunched Audacity and iterated record, close without saving,
File > New and repeated that, twenty times. Bug 1567 did not occur.
There are still two issues. When saving a project, any .DS_Store file in
its SessionData project folder prevents deletion of that folder, as
proved
Post by Paul Licameli
Post by Gale Andrews
by the Audacity log. Every few times I save a project and the
SessionData
Post by Paul Licameli
Post by Gale Andrews
project folder can't be deleted, 1567 occurs. This was the case before
the latest commit, even with no old project folders present - I just
never
Post by Paul Licameli
Post by Gale Andrews
tested it sufficient times.
Also 1567 occurs every few times if I record, stop, File > New, record,
stop then File > Close one of the projects without saving (provided the
project being closed is not the last). This did not seem to occur before
if there were no old project folders present. However that could just be
red herring, and perhaps we should persist with our efforts to stop
doing
Post by Paul Licameli
Post by Gale Andrews
things to the file system that fail, or are unexpected.
Note that when we close without save on projects other than the last
one,
Post by Paul Licameli
Post by Gale Andrews
we delete the AUTOSAVE file of the closed project, but we let its
project
Post by Paul Licameli
Post by Gale Andrews
folder remain until we close the last project. This does not produce an
error in the log, but is there a reason we retain the temp data for the
closed project?
The only case I can think of when this might help a user is if it was an
unedited recording, and they closed in error. They would then be able
to manually recover the recording using the old 1.2 Recovery Tools.
OTOH if the user is short of space this is unhelpful behaviour and I
must now wonder if it might be directly triggering 1567 on my machine.
Of course it may be a risk to change this behaviour now for 2.1.3, even
if we wanted to.
Gale
Post by Paul Licameli
Post by Gale Andrews
Summary: Sierra 10.12.3 doesn't do anything for 1567, but I've
attached file monitoring output for clicking "Record" then File >
Close without saving.
Paul's diagnostic and the file monitoring seem to show that Finder
creating .DS_Store files is what causes Audacity to not delete the
project folder. Finder always creates .DS_Store files in 10.12.2 on
my
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
machine, and less often in 10.12.3, whether a Finder window is
watching SessionData or not.
Post by Paul Licameli
I pushed another commit, a1b6aadf, which should write something to the
log
when there is a failure to remove one of these folders. Though
after
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
closing the last window, you must open a new window, in order to
have
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
the
Help menu available so you can see the log again.
There should either be messages that the folder that did not delete
can't be
enumerated, or else, a list of the files that wxWidgets still
detects
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
inside
it.
I updated to Sierra 10.12.3. The fork and crash on launch is still needed
there.
The failure to delete project folders (bug 1521) seems slightly improved
in 10.12.3.
Before 10.12.3 I can never delete any project folders. It makes no
difference whether I am watching the SessionData folder in Finder, or
whether I have Xcode IDE open or not. Even if according to ls -a the
folder is empty, Audacity cannot delete the folder and sees in the
log
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
messages Paul added that the folder still contains .DS_STORE. After
the failed folder deletion, ls-a confirms that .DS_STORE is there.
In 10.12.3, "sometimes" the project folder for the project being
closed
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
gets deleted (but older project folders containing .DS_STORE do not).
Again, "sometimes" doesn't relate to whether Finder is watching
SessionData or not. "Sometimes" relates to whether Finder adds a
.DS_Store file or not - if it does so add, Audacity can't delete the folder.
I've attached a "sierra_file_activity.arc" file (rename it to ZIP extension to
unpack it). This contains output on 10.12.3 from two tools, using a
release build from Paul's latest diagnostic commit, recording for a couple
* a third-party "filemon" CLI app
( http://newosxbook.com/files/filemon.tgz ) . I think this is not filterable
so I let it run "as is". I only show output from Audacity and
Finder
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
in
my
attachment because nothing else looked relevant.
(
https://developer.apple.com/legacy/library/documentation/
Darwin/Reference/ManPages/man1/fs_usage.1.html
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
). For that I used the command
sudo fs_usage -w -f filesys <current Audacity PID>
The fs_usage output is vast. Filemon output may be too simple, but it
does show that when Audacity is able to delete the project folder for the
project being closed, Finder does not add a .DS_Store file.
I have not tried fs_usage for Audacity and Finder, and have not tried Xcode
Instruments suggested by David yet.
=== Relationship with bug 1567 ===
As with 10.12.1 and 10.12.2, in 10.12.3, bug 1567 doesn't occur on close
without save if there are no project folders from a previous Audacity session.
This is true even if Audacity has failed to delete the project folder
for
the
project being closed. 1567 still occurs about one time in three or
four
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
on
close without save if there are old folders present.
Still, I have a hunch that trying and failing to delete a folder containing
.DS_Store actually is the key to the remaining 1567 project close
problem. Every other app I tried can delete a folder containing .DS_Store,
even with Finder looking at the folder, so this clear failure to do
what
is
expected could be triggering 1567 in some way.
Can any of us provoke 1521 by deliberately watching the SessionData
folder in Finder (so encouraging Finder to add a .DS_Store file), and
then on your machines, can Audacity still delete the project folder
even
if
it contains .DS_Store?
If it helps, here is the current result of
ls -l -a /Users/gale/Library/Application\
total 24
drwxr-xr-x 8 gale staff 272 Jan 27 17:57 .
drwxr-xr-x 9 gale staff 306 Jan 27 17:57 ..
srwx------ 1 gale staff 0 Jan 27 17:57 .audacity.sock
-rw------- 1 gale staff 5 Jan 27 17:57 audacity-lock-gale
drwxr-xr-x 3 gale staff 102 Jan 27 04:43 project12172266
drwxr-xr-x 4 gale staff 136 Jan 27 00:24 project1909113964
drwxr-xr-x 3 gale staff 102 Jan 27 02:47 project2046242277
Gale
Post by Paul Licameli
(I'm feeling very frustrated with this, Gale. You?)
PRL
------------------------------------------------------------
------------------
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Post by Paul Licameli
Post by Gale Andrews
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Post by Paul Licameli
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Gale Andrews
2017-02-01 01:41:50 UTC
Permalink
I think we're running out of time to progress 1567 further, because jc11
is planned for tomorrow and James prefers jc11 to be turned straight
over into RC1, if possible.

But I'll answer your questions in case it gives us a sense if we really could
vanquish 1567 for 2.1.3 (as seen on my machine anyhow).
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/6b65375ee5b3990ec6764dbd71c02b7d9931b660
Gale, this is progress, and your report make me think I can fix the saving
problem finally with the commit above.
Thanks, Paul. Sorry it's taken a few days to test. It isn't quite fixed.
When saving, the root project* folder in SessionData always gets
left behind (e* and d* folders are removed). There are no errors in
the log for the left behind folder, so the presence of a .DS_Store
file is not the cause of the folder getting left behind.
You caught me. The fix that was submitted had this unintended effect. I
have written the fix for the fix. See other email thread.
Post by Gale Andrews
The left-behind project* folder does get removed on closing the
project *if* it's the only remaining project, otherwise it still gets left
behind on close.
Do you mean: when the last project closes, then other projects' project*
folders are belatedly removed? That would make sense.
Yes, and that is the case whether it's a recording, generated tone or
whatever content, and whether we say Yes or No to saving changes.
Post by Paul Licameli
Post by Gale Andrews
Save Project can still trigger 1567, if a .DS_Store file gets added to
the left-behind root project* folder in SessionData immediately after
the save removes the original .DS_Store file. If Finder does not add
the new .DS_Store file quickly enough e.g. a few seconds after the
save, then 1567 doesn't occur.
Maybe my new fix mentioned above decreases the likelihood of this, because
it will remove that folder sooner.
Post by Gale Andrews
So can we just get rid of the root project* folder when we save?
We will.
Now another question arises. If we make the cleanup of temporary projects
work as well as possible, is that fork-and-crash no longer necessary? Or,
does it still contribute something else to the fix?
I would like to avoid the fork-and-crash if possible, because it is just
such a weird thing to do, whereas the other fixes are simply a matter of
doing file system operations in a different sequence from before. The
simple way for you to test is to find and delete these lines from
#if ! defined(__WXDEBUG__)
#define FIX_BUG1567
#endif
I would be surprised if we can manage without fork and crash, desirable
as it would be. Every time before now that I've tried to do without, I start
getting 1567 when I launch Audacity, even if I just launch and quit
Audacity then iterate that.

Of course I don't know, until we ensure that clearing out block files on
close always gets rid of the project folder too.

Why we need fork and crash may just be a different facet of 1567 that
we don't understand yet.
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
I do not understand though why you would have the problem when
recording in two projects.
I think I now do understand. I remarked that when there are two or more
projects, File > Close does not remove the data for the closed project.
I was wrong about that, because I was not automatically seeing the
refreshed file structure when I tested on Windows.
What does happen in the case of two or more projects is that the project
folder and its d* and e* subfolders are left behind, emptied of the AU files.
The same thing then happens to trigger 1567 as happens with Save
Project. The folders are there for Finder to add a new .DS_Store file to,
and if this happens soon enough after the close, 1567 triggers.
I would predict if we remove these un-necessary empty folders (on all
platforms of course) then the residual symptoms of 1567 will be gone -
on my machine, anyway.
This explanation has set me thinking about how to fix it. This may suggest
already the negative answer to the question above: "Are these file
management changes sufficient without fork-and-crash?"
Implementing this fix, though, might be diminishing returns as this point.
It might get more involved than the other fixes, and all for a much less
likely use case, recording into each of two simultaneously open projects.
Any content, not just recording, to my belief.
Post by Paul Licameli
I observe that when one of the two projects is closed without saving,
the .au files are deleted, though the folder tree is not cleaned up until
later. So there is not enough there to help recovery of lost data.
Do you observe the same and agree with me?
Yes I agree - the empty folders are redundant - not only is there no
data, but we already deleted the AUTOSAVE file too.

And I'm not in favour of leveraging this bug to give users a second
chance if they mistakenly closed without saving. There is a feature
request there to guard against that, and of course users who got
burnt have asked for it. But if we went for it IMO we should do it
properly as an option, with a setting for the disk space that is allowed
to be used for it, and which also allows to get the mistakenly closed
content back after quitting Audacity.
Post by Paul Licameli
Therefore something might be attempted to clean up folders sooner,
and it might be simpler than I anticipated, and worth a try for 2.1.3.
I'm willing having gone so far with this thing already, but of course it is
up to James.



Gale
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Summary: Thanks, Paul. Folders containing .DS_Store can now be
deleted on closing the last project window and I don't get 1567 in
that scenario.
However when saving a project, any .DS_Store file in its SessionData
project folder prevents deletion of that folder, and 1567 can then occur
after the project save.
Also I now get 1567 if there are two or more unsaved projects then I
close any of them without saving (unless I'm closing the last project).
More on this below.
Post by Paul Licameli
Gale, your data confirms that Audacity is still detecting .DS_Store
And a close look at the difference between how I enumerate that .DS_Store in
the diagnostic, and on the other hand how files are enumerated to be
https://github.com/Paul-Licameli/audacity/commit/10cb8309a7b27cb86a65d4057e8f1c6cd8ba6352
PRL
Paul, I'm now trying HEAD, given it has the fixes we think we want (minus
the added sleeps that don't help with 1567).
With Finder looking at SessionData, I launched HEAD, recorded two seconds,
then File > Close... and did not save changes. The project folder for the
recording, and the old project folders containing .DS_Store files from previous
Audacity sessions, were all removed with no errors in the log and 1567 did
not occur. The filemon tool shows that Finder did add a .DS_Store file to
the newly recorded project. The .DS_Store file and .audacity.sock file
in
root
of SessionData were left alone.
So that all seems good. I also tried adding a backup of one of the old project
folders containing .DS_Store back into SessionData, as a user perhaps
might if they have some problem with Automatic Crash Recovery, then did
File > Close (or recorded then File > Close) without saving. I tried
one
or
other of those five times, and the old project was removed and Bug 1567
did not occur. So this seems good too.
Then I recorded and did File > Exit without saving instead of File > Close.
The new project folder was deleted and 1567 did not occur on launch
(not that I expected it to).
Then I relaunched Audacity and iterated record, close without saving,
File > New and repeated that, twenty times. Bug 1567 did not occur.
There are still two issues. When saving a project, any .DS_Store file in
its SessionData project folder prevents deletion of that folder, as proved
by the Audacity log. Every few times I save a project and the SessionData
project folder can't be deleted, 1567 occurs. This was the case before
the latest commit, even with no old project folders present - I just never
tested it sufficient times.
Also 1567 occurs every few times if I record, stop, File > New, record,
stop then File > Close one of the projects without saving (provided the
project being closed is not the last). This did not seem to occur before
if there were no old project folders present. However that could just be
red herring, and perhaps we should persist with our efforts to stop doing
things to the file system that fail, or are unexpected.
Note that when we close without save on projects other than the last one,
we delete the AUTOSAVE file of the closed project, but we let its project
folder remain until we close the last project. This does not produce an
error in the log, but is there a reason we retain the temp data for the
closed project?
The only case I can think of when this might help a user is if it was an
unedited recording, and they closed in error. They would then be able
to manually recover the recording using the old 1.2 Recovery Tools.
OTOH if the user is short of space this is unhelpful behaviour and I
must now wonder if it might be directly triggering 1567 on my machine.
Of course it may be a risk to change this behaviour now for 2.1.3, even
if we wanted to.
Gale
Post by Paul Licameli
Post by Gale Andrews
Summary: Sierra 10.12.3 doesn't do anything for 1567, but I've
attached file monitoring output for clicking "Record" then File >
Close without saving.
Paul's diagnostic and the file monitoring seem to show that Finder
creating .DS_Store files is what causes Audacity to not delete the
project folder. Finder always creates .DS_Store files in 10.12.2 on my
machine, and less often in 10.12.3, whether a Finder window is
watching SessionData or not.
Post by Paul Licameli
I pushed another commit, a1b6aadf, which should write something to the
log
when there is a failure to remove one of these folders. Though after
closing the last window, you must open a new window, in order to
have
the
Help menu available so you can see the log again.
There should either be messages that the folder that did not delete
can't be
enumerated, or else, a list of the files that wxWidgets still detects
inside
it.
I updated to Sierra 10.12.3. The fork and crash on launch is still needed
there.
The failure to delete project folders (bug 1521) seems slightly improved
in 10.12.3.
Before 10.12.3 I can never delete any project folders. It makes no
difference whether I am watching the SessionData folder in Finder, or
whether I have Xcode IDE open or not. Even if according to ls -a the
folder is empty, Audacity cannot delete the folder and sees in the log
messages Paul added that the folder still contains .DS_STORE. After
the failed folder deletion, ls-a confirms that .DS_STORE is there.
In 10.12.3, "sometimes" the project folder for the project being closed
gets deleted (but older project folders containing .DS_STORE do not).
Again, "sometimes" doesn't relate to whether Finder is watching
SessionData or not. "Sometimes" relates to whether Finder adds a
.DS_Store file or not - if it does so add, Audacity can't delete
the
folder.
I've attached a "sierra_file_activity.arc" file (rename it to ZIP
extension to
unpack it). This contains output on 10.12.3 from two tools, using a
release build from Paul's latest diagnostic commit, recording for a couple
* a third-party "filemon" CLI app
( http://newosxbook.com/files/filemon.tgz ) . I think this is not
filterable
so I let it run "as is". I only show output from Audacity and Finder
in
my
attachment because nothing else looked relevant.
(
https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/fs_usage.1.html
). For that I used the command
sudo fs_usage -w -f filesys <current Audacity PID>
The fs_usage output is vast. Filemon output may be too simple, but it
does show that when Audacity is able to delete the project folder for
the
project being closed, Finder does not add a .DS_Store file.
I have not tried fs_usage for Audacity and Finder, and have not
tried
Xcode
Instruments suggested by David yet.
=== Relationship with bug 1567 ===
As with 10.12.1 and 10.12.2, in 10.12.3, bug 1567 doesn't occur on close
without save if there are no project folders from a previous
Audacity
session.
This is true even if Audacity has failed to delete the project folder
for
the
project being closed. 1567 still occurs about one time in three or four
on
close without save if there are old folders present.
Still, I have a hunch that trying and failing to delete a folder containing
.DS_Store actually is the key to the remaining 1567 project close
problem. Every other app I tried can delete a folder containing .DS_Store,
even with Finder looking at the folder, so this clear failure to do
what
is
expected could be triggering 1567 in some way.
Can any of us provoke 1521 by deliberately watching the SessionData
folder in Finder (so encouraging Finder to add a .DS_Store file), and
then on your machines, can Audacity still delete the project folder
even
if
it contains .DS_Store?
If it helps, here is the current result of
ls -l -a /Users/gale/Library/Application\
total 24
drwxr-xr-x 8 gale staff 272 Jan 27 17:57 .
drwxr-xr-x 9 gale staff 306 Jan 27 17:57 ..
srwx------ 1 gale staff 0 Jan 27 17:57 .audacity.sock
-rw------- 1 gale staff 5 Jan 27 17:57 audacity-lock-gale
drwxr-xr-x 3 gale staff 102 Jan 27 04:43 project12172266
drwxr-xr-x 4 gale staff 136 Jan 27 00:24 project1909113964
drwxr-xr-x 3 gale staff 102 Jan 27 02:47 project2046242277
Gale
Post by Paul Licameli
(I'm feeling very frustrated with this, Gale. You?)
PRL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Paul Licameli
2017-01-31 18:33:37 UTC
Permalink
Replying directly again to the pertinent part of Gale's first report of the
recording problem:

On Sat, Jan 28, 2017 at 3:33 PM, Gale Andrews <***@audacityteam.org> wrote:

...
Post by Gale Andrews
Also 1567 occurs every few times if I record, stop, File > New, record,
stop then File > Close one of the projects without saving (provided the
project being closed is not the last). This did not seem to occur before
if there were no old project folders present. However that could just be
red herring, and perhaps we should persist with our efforts to stop doing
things to the file system that fail, or are unexpected.
Note that when we close without save on projects other than the last one,
we delete the AUTOSAVE file of the closed project, but we let its project
folder remain until we close the last project. This does not produce an
error in the log, but is there a reason we retain the temp data for the
closed project?
The only case I can think of when this might help a user is if it was an
unedited recording, and they closed in error. They would then be able
to manually recover the recording using the old 1.2 Recovery Tools.
OTOH if the user is short of space this is unhelpful behaviour and I
must now wonder if it might be directly triggering 1567 on my machine.
Of course it may be a risk to change this behaviour now for 2.1.3, even
if we wanted to.
When you record, Audacity keeps some of the project data for a short time
in memory, before "flusing" to a new .au file. I thought that had
something to do with this. I no longer do.

Is this really specific to recording? Or, can you provoke the same
symptoms by generating some sound, like noise?

I observe that when one of the two projects is closed without saving, the
.au files are deleted, though the folder tree is not cleaned up until
later. So there is not enough there to help recovery of lost data. Do you
observe the same and agree with me?

Therefore something might be attempted to clean up folders sooner, and it
might be simpler than I anticipated, and worth a try for 2.1.3.

PRL
Post by Gale Andrews
Gale
Post by Gale Andrews
Summary: Sierra 10.12.3 doesn't do anything for 1567, but I've
attached file monitoring output for clicking "Record" then File >
Close without saving.
Paul's diagnostic and the file monitoring seem to show that Finder
creating .DS_Store files is what causes Audacity to not delete the
project folder. Finder always creates .DS_Store files in 10.12.2 on my
machine, and less often in 10.12.3, whether a Finder window is
watching SessionData or not.
Post by Paul Licameli
I pushed another commit, a1b6aadf, which should write something to the log
when there is a failure to remove one of these folders. Though after
closing the last window, you must open a new window, in order to have the
Help menu available so you can see the log again.
There should either be messages that the folder that did not delete can't be
enumerated, or else, a list of the files that wxWidgets still detects inside
it.
I updated to Sierra 10.12.3. The fork and crash on launch is still
needed
Post by Gale Andrews
there.
The failure to delete project folders (bug 1521) seems slightly improved
in 10.12.3.
Before 10.12.3 I can never delete any project folders. It makes no
difference whether I am watching the SessionData folder in Finder, or
whether I have Xcode IDE open or not. Even if according to ls -a the
folder is empty, Audacity cannot delete the folder and sees in the log
messages Paul added that the folder still contains .DS_STORE. After
the failed folder deletion, ls-a confirms that .DS_STORE is there.
In 10.12.3, "sometimes" the project folder for the project being closed
gets deleted (but older project folders containing .DS_STORE do not).
Again, "sometimes" doesn't relate to whether Finder is watching
SessionData or not. "Sometimes" relates to whether Finder adds a
.DS_Store file or not - if it does so add, Audacity can't delete the folder.
I've attached a "sierra_file_activity.arc" file (rename it to ZIP extension to
unpack it). This contains output on 10.12.3 from two tools, using a
release build from Paul's latest diagnostic commit, recording for a
couple
Post by Gale Andrews
* a third-party "filemon" CLI app
( http://newosxbook.com/files/filemon.tgz ) . I think this is not filterable
so I let it run "as is". I only show output from Audacity and Finder
in
Post by Gale Andrews
my
attachment because nothing else looked relevant.
(
https://developer.apple.com/legacy/library/documentation/
Darwin/Reference/ManPages/man1/fs_usage.1.html
Post by Gale Andrews
). For that I used the command
sudo fs_usage -w -f filesys <current Audacity PID>
The fs_usage output is vast. Filemon output may be too simple, but it
does show that when Audacity is able to delete the project folder for
the
Post by Gale Andrews
project being closed, Finder does not add a .DS_Store file.
I have not tried fs_usage for Audacity and Finder, and have not tried Xcode
Instruments suggested by David yet.
=== Relationship with bug 1567 ===
As with 10.12.1 and 10.12.2, in 10.12.3, bug 1567 doesn't occur on close
without save if there are no project folders from a previous Audacity session.
This is true even if Audacity has failed to delete the project folder
for
Post by Gale Andrews
the
project being closed. 1567 still occurs about one time in three or four
on
Post by Gale Andrews
close without save if there are old folders present.
Still, I have a hunch that trying and failing to delete a folder containing
.DS_Store actually is the key to the remaining 1567 project close
problem. Every other app I tried can delete a folder containing
.DS_Store,
Post by Gale Andrews
even with Finder looking at the folder, so this clear failure to do what is
expected could be triggering 1567 in some way.
Can any of us provoke 1521 by deliberately watching the SessionData
folder in Finder (so encouraging Finder to add a .DS_Store file), and
then on your machines, can Audacity still delete the project folder even if
it contains .DS_Store?
If it helps, here is the current result of
ls -l -a /Users/gale/Library/Application\
total 24
drwxr-xr-x 8 gale staff 272 Jan 27 17:57 .
drwxr-xr-x 9 gale staff 306 Jan 27 17:57 ..
srwx------ 1 gale staff 0 Jan 27 17:57 .audacity.sock
-rw------- 1 gale staff 5 Jan 27 17:57 audacity-lock-gale
drwxr-xr-x 3 gale staff 102 Jan 27 04:43 project12172266
drwxr-xr-x 4 gale staff 136 Jan 27 00:24 project1909113964
drwxr-xr-x 3 gale staff 102 Jan 27 02:47 project2046242277
Gale
Post by Paul Licameli
(I'm feeling very frustrated with this, Gale. You?)
PRL
------------------------------------------------------------
------------------
Post by Gale Andrews
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
David Bailes
2017-01-25 17:46:27 UTC
Permalink
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/0988c427b9e
fd31f26491712f01cc15b46dac085
Post by Paul Licameli
Now there are four commits. The first should not fix the bugs but will
be
Post by Paul Licameli
desirable to avoid log messages about "operation not permitted." The
second
Post by Paul Licameli
does the insufficient, probably unnecessary, but harmless loop to verify
that .au files are removed, waiting at most one second.
What is interesting now is the third commit, which you can call
0988c427^ .
Post by Paul Licameli
Again, it adds a sleep that you can tune, but only 100 ms as written,
after
Post by Paul Licameli
removal of each folder.
The only new behaviour with this commit is the progress dialogue for
cleaning up temporary files. This takes 75 seconds to complete. SessionData
contains six old projects, each with an empty e00 folder, plus the one
project which is the project just closed.
All the project*/e00 folders remain after this cleanup attempt.
01:57:55: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344' couldn't be deleted
(error 66: Directory not empty)
01:58:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:10: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342' couldn't be deleted
(error 66: Directory not empty)
01:58:15: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:20: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621' couldn't be deleted
(error 66: Directory not empty)
01:58:25: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:30: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723' couldn't be deleted
(error 66: Directory not empty)
01:58:35: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:40: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266' couldn't be deleted
(error 66: Directory not empty)
01:58:45: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:50: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422' couldn't be deleted
(error 66: Directory not empty)
01:59:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528/e00' couldn't be
deleted (error 66: Directory not empty)
01:59:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528' couldn't be deleted
(error 66: Directory not empty)
Post by Paul Licameli
gain, you can change #if 0 to #if 1 so that this number is an upper
bound
Post by Paul Licameli
on the wait, which may be shorter.
This just adds the spinning beach ball lasting as long as the specified wait,
before the progress dialogue appears. I tried 5000 ms with no difference.
Post by Paul Licameli
Again, I want to know if this turns out to be sufficient to fix bug
1567, without the
Post by Paul Licameli
branch tip commit, 0988c427.
No - it does not.
I tried deleting these same e00 and project* folders, one at a time in FileZilla
3.24.0, which uses wxWidgets 3.0.3. This deletion went without problem and
was instantaneous.
Manually deleting the .DS_Store files in the project* folders before asking
Audacity to delete the folders does not change anything.
Well, this makes no sense. It appears the Audacity program is told that
the folder is not empty, when other programs tell us that it is.
The only other thing I can think of, is that you use terminal, and type
ls -a .../e00
with whatever substitution for ... and this might tell us about certain
hidden files that Finder might not be showing.
It appears that on mac, wxRemoveFile uses unlink():
https://linux.die.net/man/2/unlink

Possible that some process has a file open, preventing that file from
actually being deleted? Has Gale's computer got programs running, like
anti-malware, that might be doing this?
A tool equivalent to sysinternal's process monitor could check that.

David.
Post by Paul Licameli
PRL
Post by Paul Licameli
Gale
Post by Paul Licameli
On Tue, Jan 24, 2017 at 4:46 PM, Paul Licameli <
On Tue, Jan 24, 2017 at 4:20 PM, Paul Licameli <
Post by Paul Licameli
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567 occurring
on close without save.
Post by Paul Licameli
I did git push -f to my origin. There are now three commits in
the
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
branch.
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b
57cd075d9cd226cb591b939e5fc6c
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
The head includes the fork-and-crash fix, but could it be that we
don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits
before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder
cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of
folders does
not succeed if done too soon after removal of the contents of the
folder, I
added the other commit one before head. This inserts code to
delay
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
between
removing files and removing folders. As submitted, it simply
sleeps
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
by a
number that you can tune. But if you change #if 1 to #if 0, then
instead it
tests in a loop whether it can detect completion of removal of the files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing
without
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
saving
It doesn't stop bug 1567 occurring on close without save, even if
the
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder? No .au
files left in them? Could there be hidden files? Does ls -a from
terminal
Post by Paul Licameli
Post by Paul Licameli
list anything else in them?
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559'
couldn't
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
be deleted (error 66: Directory not empty)
Specifically there used to be "operation not permitted" messages in
the
Post by Paul Licameli
log, but now no longer, right? It is something, that the log is
tidier,
Post by Paul Licameli
even on my machine which does not suffer bug 1567.
Is this list of log messages complete?
I now notice this: you did NOT see a log message for the etc/e00/d00
directory. There should have been such a directory in the tree. So
it may
Post by Paul Licameli
not be that .au files are not cleaned up (in fact they should
normally be
Post by Paul Licameli
deleted already at this point), but rather that the d00 folder was not
removed.
Audacity did not attempt to remove d00.
Or it did, but that failed silently without a log message.
Or it did, but a sleep is needed before attempting to remove the
folder
Post by Paul Licameli
above it.
But this means I have not run out of experiments for you yet.
PRL
So here is what you can do while I write something else: Verify that
folder .../e00/d00 exists before you close without saving. Do the
close
Post by Paul Licameli
without saving in HEAD, with its failed, incomplete cleanup. Is e00
still
Post by Paul Licameli
present but e00/d00 removed?
If that is so, then this would suggest to me that Audacity did in fact
successfully find and remove the lowest-level folder, but the removal
of it
Post by Paul Licameli
is somehow asynchronously completed on Sierra, and Audacity should
pause a
Post by Paul Licameli
bit after removing each folder, before trying to remove its parent.
There
Post by Paul Licameli
may be many folders, so this must be a small pause at most, but maybe
only a
Post by Paul Licameli
few milliseconds after each is what we need.
PRL
Post by Paul Licameli
Formerly there were more and different log messages, even on my
computer. You alone get these messages that the directory is not
empty.
Post by Paul Licameli
Post by Paul Licameli
But at this point in the program, the call to delete the .au files
has
Post by Paul Licameli
Post by Paul Licameli
completed.
Post by Gale Andrews
Post by Paul Licameli
If not, see if 4059b2ae^ does it, with a long enough sleep that is not
unreasonable
As submitted, does not clean up empty folders, same message in log.
The only change is the spinning beach ball for 5 seconds presumably while
the sleep is performed. So we know that the sleep there will have an
undesirable visual consequence and I did not bother extending the sleep.
Post by Paul Licameli
If #2 succeeds, verify that it also works when changing #if 1 to
#if
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
0, but
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on pressing "No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the .au
files, and then asks the file system whether the .au files are
really gone,
Post by Paul Licameli
Post by Paul Licameli
then the answer it gets is yes, they are really gone.
So what could explain the anomaly that the log tells us the
directories
Post by Paul Licameli
Post by Paul Licameli
are not empty? Some extraneous files are somehow added to the
folders?
Post by Paul Licameli
Post by Paul Licameli
PRL
Post by Gale Andrews
Post by Paul Licameli
If #1, #2, or #3 is enough to fix closing without saving,
determine
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
whether
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now
launch
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Audacity guaranteed not to have bug 1567 present, but 1567 can still
occur on close without saving.
At any of those three commits, manually deleting old project folders before
close without save still stops 1567 occurring, even if there are
two or
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
more
project windows open. But if SessionData contains any project
folders
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
which are not in use, then 1567 can trigger on close without save.
Gale
Post by Paul Licameli
Also check that the log file no longer routinely contains (as
master
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
does,
even on my computer) error messages related to the temporary
files.
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
PRL
------------------------------------------------------------
------------------
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Post by Paul Licameli
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Paul Licameli
2017-01-25 18:00:22 UTC
Permalink
Post by David Bailes
Post by Paul Licameli
Post by Paul Licameli
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/0988c427b9e
fd31f26491712f01cc15b46dac085
Post by Paul Licameli
Now there are four commits. The first should not fix the bugs but
will be
Post by Paul Licameli
desirable to avoid log messages about "operation not permitted." The
second
Post by Paul Licameli
does the insufficient, probably unnecessary, but harmless loop to
verify
Post by Paul Licameli
that .au files are removed, waiting at most one second.
What is interesting now is the third commit, which you can call
0988c427^ .
Post by Paul Licameli
Again, it adds a sleep that you can tune, but only 100 ms as written,
after
Post by Paul Licameli
removal of each folder.
The only new behaviour with this commit is the progress dialogue for
cleaning up temporary files. This takes 75 seconds to complete. SessionData
contains six old projects, each with an empty e00 folder, plus the one
project which is the project just closed.
All the project*/e00 folders remain after this cleanup attempt.
01:57:55: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344' couldn't be deleted
(error 66: Directory not empty)
01:58:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:10: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342' couldn't be deleted
(error 66: Directory not empty)
01:58:15: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:20: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621' couldn't be deleted
(error 66: Directory not empty)
01:58:25: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:30: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723' couldn't be deleted
(error 66: Directory not empty)
01:58:35: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:40: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266' couldn't be deleted
(error 66: Directory not empty)
01:58:45: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:50: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422' couldn't be deleted
(error 66: Directory not empty)
01:59:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528/e00' couldn't be
deleted (error 66: Directory not empty)
01:59:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528' couldn't be deleted
(error 66: Directory not empty)
Post by Paul Licameli
gain, you can change #if 0 to #if 1 so that this number is an upper
bound
Post by Paul Licameli
on the wait, which may be shorter.
This just adds the spinning beach ball lasting as long as the specified wait,
before the progress dialogue appears. I tried 5000 ms with no difference.
Post by Paul Licameli
Again, I want to know if this turns out to be sufficient to fix bug
1567, without the
Post by Paul Licameli
branch tip commit, 0988c427.
No - it does not.
I tried deleting these same e00 and project* folders, one at a time in FileZilla
3.24.0, which uses wxWidgets 3.0.3. This deletion went without problem and
was instantaneous.
Manually deleting the .DS_Store files in the project* folders before asking
Audacity to delete the folders does not change anything.
Well, this makes no sense. It appears the Audacity program is told that
the folder is not empty, when other programs tell us that it is.
The only other thing I can think of, is that you use terminal, and type
ls -a .../e00
with whatever substitution for ... and this might tell us about certain
hidden files that Finder might not be showing.
https://linux.die.net/man/2/unlink
Possible that some process has a file open, preventing that file from
actually being deleted? Has Gale's computer got programs running, like
anti-malware, that might be doing this?
A tool equivalent to sysinternal's process monitor could check that.
David.
wxRemoveFile is used to clean up any .au files in the tree, but normally
there are none at this point. I think it is not important.

wxRmdir is used to destroy the tree of folders, bottom-up, and that calls
rmdir(2). https://linux.die.net/man/2/rmdir

wxRmdir seems to be succeeding on the lowest level folders, but then the
log tells us it fails on the higher level folders, reporting that those
folders are not empty, which contradicts what Gale observes with Finder.

PRL
Post by David Bailes
Post by Paul Licameli
PRL
Post by Paul Licameli
Gale
Post by Paul Licameli
On Tue, Jan 24, 2017 at 4:57 PM, Paul Licameli <
On Tue, Jan 24, 2017 at 4:46 PM, Paul Licameli <
On Tue, Jan 24, 2017 at 4:20 PM, Paul Licameli <
On Tue, Jan 24, 2017 at 1:21 PM, Gale Andrews <
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567 occurring
on close without save.
On 23 January 2017 at 13:16, Paul Licameli <
Post by Paul Licameli
I did git push -f to my origin. There are now three commits in
the
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
branch.
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b
57cd075d9cd226cb591b939e5fc6c
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
The head includes the fork-and-crash fix, but could it be that we
don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits
before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder
cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of
folders does
not succeed if done too soon after removal of the contents of the
folder, I
added the other commit one before head. This inserts code to
delay
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
between
removing files and removing folders. As submitted, it simply
sleeps
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
by a
number that you can tune. But if you change #if 1 to #if 0, then
instead it
tests in a loop whether it can detect completion of removal of
the
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing
without
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
saving
It doesn't stop bug 1567 occurring on close without save, even if
the
Post by Paul Licameli
Post by Gale Andrews
close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder? No
.au
Post by Paul Licameli
files left in them? Could there be hidden files? Does ls -a from
terminal
Post by Paul Licameli
list anything else in them?
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559'
couldn't
Post by Paul Licameli
Post by Gale Andrews
be deleted (error 66: Directory not empty)
Specifically there used to be "operation not permitted" messages in
the
Post by Paul Licameli
log, but now no longer, right? It is something, that the log is
tidier,
Post by Paul Licameli
even on my machine which does not suffer bug 1567.
Is this list of log messages complete?
I now notice this: you did NOT see a log message for the etc/e00/d00
directory. There should have been such a directory in the tree. So
it may
Post by Paul Licameli
not be that .au files are not cleaned up (in fact they should
normally be
Post by Paul Licameli
deleted already at this point), but rather that the d00 folder was
not
Post by Paul Licameli
removed.
Audacity did not attempt to remove d00.
Or it did, but that failed silently without a log message.
Or it did, but a sleep is needed before attempting to remove the
folder
Post by Paul Licameli
above it.
But this means I have not run out of experiments for you yet.
PRL
So here is what you can do while I write something else: Verify that
folder .../e00/d00 exists before you close without saving. Do the
close
Post by Paul Licameli
without saving in HEAD, with its failed, incomplete cleanup. Is e00
still
Post by Paul Licameli
present but e00/d00 removed?
If that is so, then this would suggest to me that Audacity did in fact
successfully find and remove the lowest-level folder, but the removal
of it
Post by Paul Licameli
is somehow asynchronously completed on Sierra, and Audacity should
pause a
Post by Paul Licameli
bit after removing each folder, before trying to remove its parent.
There
Post by Paul Licameli
may be many folders, so this must be a small pause at most, but maybe
only a
Post by Paul Licameli
few milliseconds after each is what we need.
PRL
Formerly there were more and different log messages, even on my
computer. You alone get these messages that the directory is not
empty.
Post by Paul Licameli
But at this point in the program, the call to delete the .au files
has
Post by Paul Licameli
completed.
Post by Gale Andrews
Post by Paul Licameli
If not, see if 4059b2ae^ does it, with a long enough sleep that
is
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
not
unreasonable
As submitted, does not clean up empty folders, same message in log.
The only change is the spinning beach ball for 5 seconds presumably while
the sleep is performed. So we know that the sleep there will have
an
Post by Paul Licameli
Post by Gale Andrews
undesirable visual consequence and I did not bother extending the sleep.
Post by Paul Licameli
If #2 succeeds, verify that it also works when changing #if 1 to
#if
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
0, but
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on pressing "No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the .au
files, and then asks the file system whether the .au files are
really gone,
Post by Paul Licameli
then the answer it gets is yes, they are really gone.
So what could explain the anomaly that the log tells us the
directories
Post by Paul Licameli
are not empty? Some extraneous files are somehow added to the
folders?
Post by Paul Licameli
PRL
Post by Gale Andrews
Post by Paul Licameli
If #1, #2, or #3 is enough to fix closing without saving,
determine
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
whether
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now
launch
Post by Paul Licameli
Post by Gale Andrews
Audacity guaranteed not to have bug 1567 present, but 1567 can
still
Post by Paul Licameli
Post by Gale Andrews
occur on close without saving.
At any of those three commits, manually deleting old project
folders
Post by Paul Licameli
Post by Gale Andrews
before
close without save still stops 1567 occurring, even if there are
two or
Post by Paul Licameli
Post by Gale Andrews
more
project windows open. But if SessionData contains any project
folders
Post by Paul Licameli
Post by Gale Andrews
which are not in use, then 1567 can trigger on close without save.
Gale
Post by Paul Licameli
Also check that the log file no longer routinely contains (as
master
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
does,
even on my computer) error messages related to the temporary
files.
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
PRL
------------------------------------------------------------
------------------
Post by Paul Licameli
Post by Gale Andrews
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Post by Paul Licameli
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Gale Andrews
2017-01-25 19:23:00 UTC
Permalink
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/0988c427b9efd31f26491712f01cc15b46dac085
Now there are four commits. The first should not fix the bugs but will be
desirable to avoid log messages about "operation not permitted." The second
does the insufficient, probably unnecessary, but harmless loop to verify
that .au files are removed, waiting at most one second.
What is interesting now is the third commit, which you can call 0988c427^ .
Again, it adds a sleep that you can tune, but only 100 ms as written, after
removal of each folder.
The only new behaviour with this commit is the progress dialogue for
cleaning up temporary files. This takes 75 seconds to complete. SessionData
contains six old projects, each with an empty e00 folder, plus the one
project which is the project just closed.
All the project*/e00 folders remain after this cleanup attempt.
01:57:55: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344' couldn't be deleted
(error 66: Directory not empty)
01:58:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:10: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342' couldn't be deleted
(error 66: Directory not empty)
01:58:15: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:20: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621' couldn't be deleted
(error 66: Directory not empty)
01:58:25: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:30: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723' couldn't be deleted
(error 66: Directory not empty)
01:58:35: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:40: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266' couldn't be deleted
(error 66: Directory not empty)
01:58:45: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:50: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422' couldn't be deleted
(error 66: Directory not empty)
01:59:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528/e00' couldn't be
deleted (error 66: Directory not empty)
01:59:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528' couldn't be deleted
(error 66: Directory not empty)
Post by Paul Licameli
gain, you can change #if 0 to #if 1 so that this number is an upper bound
on the wait, which may be shorter.
This just adds the spinning beach ball lasting as long as the specified wait,
before the progress dialogue appears. I tried 5000 ms with no difference.
Post by Paul Licameli
Again, I want to know if this turns out to be sufficient to fix bug
1567, without the
branch tip commit, 0988c427.
No - it does not.
I tried deleting these same e00 and project* folders, one at a time in FileZilla
3.24.0, which uses wxWidgets 3.0.3. This deletion went without problem and
was instantaneous.
Manually deleting the .DS_Store files in the project* folders before asking
Audacity to delete the folders does not change anything.
Well, this makes no sense. It appears the Audacity program is told that
the folder is not empty, when other programs tell us that it is.
The only other thing I can think of, is that you use terminal, and type
ls -a .../e00
with whatever substitution for ... and this might tell us about certain
hidden files that Finder might not be showing.
https://linux.die.net/man/2/unlink
Possible that some process has a file open, preventing that file from
actually being deleted? Has Gale's computer got programs running, like
anti-malware, that might be doing this?
No additional security apps are installed.
Post by David Bailes
A tool equivalent to sysinternal's process monitor could check that.
Indeed, but FileZilla can delete the files that Audacity can't. If I
can figure out inspection with a monitoring tool I will do so. Thanks
for the suggestion.


Gale
Post by David Bailes
Post by Paul Licameli
PRL
Post by Gale Andrews
Gale
Post by Paul Licameli
On Tue, Jan 24, 2017 at 4:57 PM, Paul Licameli
On Tue, Jan 24, 2017 at 4:46 PM, Paul Licameli
On Tue, Jan 24, 2017 at 4:20 PM, Paul Licameli
On Tue, Jan 24, 2017 at 1:21 PM, Gale Andrews
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567 occurring
on close without save.
On 23 January 2017 at 13:16, Paul Licameli
Post by Paul Licameli
I did git push -f to my origin. There are now three commits in the
branch.
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b57cd075d9cd226cb591b939e5fc6c
The head includes the fork-and-crash fix, but could it be that we
don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits
before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder
cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of
folders does
not succeed if done too soon after removal of the contents of the
folder, I
added the other commit one before head. This inserts code to delay
between
removing files and removing folders. As submitted, it simply sleeps
by a
number that you can tune. But if you change #if 1 to #if 0, then
instead it
tests in a loop whether it can detect completion of removal of the
files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing without
saving
It doesn't stop bug 1567 occurring on close without save, even if
the
close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder? No .au
files left in them? Could there be hidden files? Does ls -a from terminal
list anything else in them?
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559' couldn't
be deleted (error 66: Directory not empty)
Specifically there used to be "operation not permitted" messages in the
log, but now no longer, right? It is something, that the log is tidier,
even on my machine which does not suffer bug 1567.
Is this list of log messages complete?
I now notice this: you did NOT see a log message for the etc/e00/d00
directory. There should have been such a directory in the tree. So it may
not be that .au files are not cleaned up (in fact they should normally be
deleted already at this point), but rather that the d00 folder was not
removed.
Audacity did not attempt to remove d00.
Or it did, but that failed silently without a log message.
Or it did, but a sleep is needed before attempting to remove the folder
above it.
But this means I have not run out of experiments for you yet.
PRL
So here is what you can do while I write something else: Verify that
folder .../e00/d00 exists before you close without saving. Do the close
without saving in HEAD, with its failed, incomplete cleanup. Is e00 still
present but e00/d00 removed?
If that is so, then this would suggest to me that Audacity did in fact
successfully find and remove the lowest-level folder, but the removal of it
is somehow asynchronously completed on Sierra, and Audacity should pause a
bit after removing each folder, before trying to remove its parent.
There
may be many folders, so this must be a small pause at most, but maybe only a
few milliseconds after each is what we need.
PRL
Formerly there were more and different log messages, even on my
computer. You alone get these messages that the directory is not empty.
But at this point in the program, the call to delete the .au files has
completed.
Post by Gale Andrews
Post by Paul Licameli
If not, see if 4059b2ae^ does it, with a long enough sleep that
is
not
unreasonable
As submitted, does not clean up empty folders, same message in log.
The only change is the spinning beach ball for 5 seconds presumably while
the sleep is performed. So we know that the sleep there will have an
undesirable visual consequence and I did not bother extending the sleep.
Post by Paul Licameli
If #2 succeeds, verify that it also works when changing #if 1 to #if
0, but
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on pressing "No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the .au
files, and then asks the file system whether the .au files are really gone,
then the answer it gets is yes, they are really gone.
So what could explain the anomaly that the log tells us the directories
are not empty? Some extraneous files are somehow added to the folders?
PRL
Post by Gale Andrews
Post by Paul Licameli
If #1, #2, or #3 is enough to fix closing without saving, determine
whether
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now launch
Audacity guaranteed not to have bug 1567 present, but 1567 can still
occur on close without saving.
At any of those three commits, manually deleting old project
folders
before
close without save still stops 1567 occurring, even if there are
two or
more
project windows open. But if SessionData contains any project folders
which are not in use, then 1567 can trigger on close without save.
Gale
Post by Paul Licameli
Also check that the log file no longer routinely contains (as master
does,
even on my computer) error messages related to the temporary files.
PRL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
David Bailes
2017-01-25 20:03:18 UTC
Permalink
Post by Paul Licameli
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
https://github.com/Paul-Licameli/audacity/commit/
0988c427b9efd31f26491712f01cc15b46dac085
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Now there are four commits. The first should not fix the bugs but
will
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
be
desirable to avoid log messages about "operation not permitted." The second
does the insufficient, probably unnecessary, but harmless loop to verify
that .au files are removed, waiting at most one second.
What is interesting now is the third commit, which you can call 0988c427^ .
Again, it adds a sleep that you can tune, but only 100 ms as written, after
removal of each folder.
The only new behaviour with this commit is the progress dialogue for
cleaning up temporary files. This takes 75 seconds to complete. SessionData
contains six old projects, each with an empty e00 folder, plus the one
project which is the project just closed.
All the project*/e00 folders remain after this cleanup attempt.
01:57:55: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1186281344' couldn't be deleted
(error 66: Directory not empty)
01:58:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:10: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1188197342' couldn't be deleted
(error 66: Directory not empty)
01:58:15: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:20: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1189827621' couldn't be deleted
(error 66: Directory not empty)
01:58:25: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:30: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1192953723' couldn't be deleted
(error 66: Directory not empty)
01:58:35: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:40: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1193777266' couldn't be deleted
(error 66: Directory not empty)
01:58:45: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422/e00' couldn't be
deleted (error 66: Directory not empty)
01:58:50: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1229206422' couldn't be deleted
(error 66: Directory not empty)
01:59:00: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528/e00' couldn't be
deleted (error 66: Directory not empty)
01:59:05: Error: Directory '/Users/gale/Library/Application
Support/audacity/SessionData/project1245307528' couldn't be deleted
(error 66: Directory not empty)
Post by Paul Licameli
gain, you can change #if 0 to #if 1 so that this number is an upper bound
on the wait, which may be shorter.
This just adds the spinning beach ball lasting as long as the specified wait,
before the progress dialogue appears. I tried 5000 ms with no
difference.
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Again, I want to know if this turns out to be sufficient to fix bug
1567, without the
branch tip commit, 0988c427.
No - it does not.
I tried deleting these same e00 and project* folders, one at a time in FileZilla
3.24.0, which uses wxWidgets 3.0.3. This deletion went without problem and
was instantaneous.
Manually deleting the .DS_Store files in the project* folders before asking
Audacity to delete the folders does not change anything.
Well, this makes no sense. It appears the Audacity program is told that
the folder is not empty, when other programs tell us that it is.
The only other thing I can think of, is that you use terminal, and type
ls -a .../e00
with whatever substitution for ... and this might tell us about certain
hidden files that Finder might not be showing.
https://linux.die.net/man/2/unlink
Possible that some process has a file open, preventing that file from
actually being deleted? Has Gale's computer got programs running, like
anti-malware, that might be doing this?
No additional security apps are installed.
Post by David Bailes
A tool equivalent to sysinternal's process monitor could check that.
Indeed, but FileZilla can delete the files that Audacity can't. If I
can figure out inspection with a monitoring tool I will do so. Thanks
for the suggestion.
The only tools that I've found by having a quick look around is
instruments, which I've mentioned previously, and which has a file activity
template:
https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/

David.
Post by Paul Licameli
Gale
Post by David Bailes
Post by Paul Licameli
PRL
Post by Gale Andrews
Gale
Post by Paul Licameli
On Tue, Jan 24, 2017 at 4:57 PM, Paul Licameli
On Tue, Jan 24, 2017 at 4:46 PM, Paul Licameli
On Tue, Jan 24, 2017 at 4:20 PM, Paul Licameli
On Tue, Jan 24, 2017 at 1:21 PM, Gale Andrews
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567
occurring
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
on close without save.
On 23 January 2017 at 13:16, Paul Licameli
Post by Paul Licameli
I did git push -f to my origin. There are now three commits in the
branch.
https://github.com/Paul-Licameli/audacity/commit/
4059b2ae48b57cd075d9cd226cb591b939e5fc6c
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
The head includes the fork-and-crash fix, but could it be that
we
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits
before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder
cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of
folders does
not succeed if done too soon after removal of the contents of
the
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
folder, I
added the other commit one before head. This inserts code to delay
between
removing files and removing folders. As submitted, it simply
sleeps
by a
number that you can tune. But if you change #if 1 to #if 0,
then
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
instead it
tests in a loop whether it can detect completion of removal of the
files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing
without
saving
It doesn't stop bug 1567 occurring on close without save, even if
the
close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder? No .au
files left in them? Could there be hidden files? Does ls -a from
terminal
list anything else in them?
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559' couldn't
be deleted (error 66: Directory not empty)
Specifically there used to be "operation not permitted" messages in the
log, but now no longer, right? It is something, that the log is tidier,
even on my machine which does not suffer bug 1567.
Is this list of log messages complete?
I now notice this: you did NOT see a log message for the
etc/e00/d00
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
directory. There should have been such a directory in the tree.
So
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
it may
not be that .au files are not cleaned up (in fact they should normally be
deleted already at this point), but rather that the d00 folder was not
removed.
Audacity did not attempt to remove d00.
Or it did, but that failed silently without a log message.
Or it did, but a sleep is needed before attempting to remove the folder
above it.
But this means I have not run out of experiments for you yet.
PRL
So here is what you can do while I write something else: Verify
that
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
folder .../e00/d00 exists before you close without saving. Do the close
without saving in HEAD, with its failed, incomplete cleanup. Is e00 still
present but e00/d00 removed?
If that is so, then this would suggest to me that Audacity did in
fact
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
successfully find and remove the lowest-level folder, but the
removal
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
of it
is somehow asynchronously completed on Sierra, and Audacity should pause a
bit after removing each folder, before trying to remove its parent.
There
may be many folders, so this must be a small pause at most, but
maybe
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
only a
few milliseconds after each is what we need.
PRL
Formerly there were more and different log messages, even on my
computer. You alone get these messages that the directory is not empty.
But at this point in the program, the call to delete the .au files has
completed.
Post by Gale Andrews
Post by Paul Licameli
If not, see if 4059b2ae^ does it, with a long enough sleep that
is
not
unreasonable
As submitted, does not clean up empty folders, same message in
log.
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
The only change is the spinning beach ball for 5 seconds
presumably
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
while
the sleep is performed. So we know that the sleep there will have an
undesirable visual consequence and I did not bother extending the
sleep.
Post by Paul Licameli
If #2 succeeds, verify that it also works when changing #if 1
to
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
#if
0, but
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on
pressing
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
"No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the
.au
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
files, and then asks the file system whether the .au files are
really gone,
then the answer it gets is yes, they are really gone.
So what could explain the anomaly that the log tells us the directories
are not empty? Some extraneous files are somehow added to the folders?
PRL
Post by Gale Andrews
Post by Paul Licameli
If #1, #2, or #3 is enough to fix closing without saving, determine
whether
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now launch
Audacity guaranteed not to have bug 1567 present, but 1567 can still
occur on close without saving.
At any of those three commits, manually deleting old project
folders
before
close without save still stops 1567 occurring, even if there are
two or
more
project windows open. But if SessionData contains any project folders
which are not in use, then 1567 can trigger on close without
save.
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Gale
Post by Paul Licameli
Also check that the log file no longer routinely contains (as
master
does,
even on my computer) error messages related to the temporary files.
PRL
------------------------------------------------------------
------------------
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Post by Gale Andrews
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Post by Paul Licameli
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Post by David Bailes
Post by Paul Licameli
Post by Gale Andrews
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Post by David Bailes
Post by Paul Licameli
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Post by David Bailes
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Gale Andrews
2017-01-25 01:08:12 UTC
Permalink
Post by Paul Licameli
Post by Paul Licameli
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567 occurring
on close without save.
I did git push -f to my origin. There are now three commits in the branch.
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b57cd075d9cd226cb591b939e5fc6c
The head includes the fork-and-crash fix, but could it be that we don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of folders does
not succeed if done too soon after removal of the contents of the folder, I
added the other commit one before head. This inserts code to delay between
removing files and removing folders. As submitted, it simply sleeps by a
number that you can tune. But if you change #if 1 to #if 0, then instead it
tests in a loop whether it can detect completion of removal of the files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing without saving
It doesn't stop bug 1567 occurring on close without save, even if the close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder? No .au
files left in them? Could there be hidden files? Does ls -a from terminal
list anything else in them?
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559' couldn't
be deleted (error 66: Directory not empty)
Specifically there used to be "operation not permitted" messages in the
log, but now no longer, right? It is something, that the log is tidier,
even on my machine which does not suffer bug 1567.
Is this list of log messages complete?
I now notice this: you did NOT see a log message for the etc/e00/d00
directory. There should have been such a directory in the tree. So it may
not be that .au files are not cleaned up (in fact they should normally be
deleted already at this point), but rather that the d00 folder was not
removed.
Audacity did not attempt to remove d00.
Or it did, but that failed silently without a log message.
Or it did, but a sleep is needed before attempting to remove the folder
above it.
But this means I have not run out of experiments for you yet.
PRL
So here is what you can do while I write something else: Verify that folder
.../e00/d00 exists before you close without saving. Do the close without
saving in HEAD, with its failed, incomplete cleanup. Is e00 still present
but e00/d00 removed?
Yes, HEAD still behaves as reported in bug 1521 - d00 is removed leaving
an empty e00.


Gale
If that is so, then this would suggest to me that Audacity did in fact
successfully find and remove the lowest-level folder, but the removal of it
is somehow asynchronously completed on Sierra, and Audacity should pause a
bit after removing each folder, before trying to remove its parent. There
may be many folders, so this must be a small pause at most, but maybe only a
few milliseconds after each is what we need.
PRL
Post by Paul Licameli
Post by Paul Licameli
Formerly there were more and different log messages, even on my computer.
You alone get these messages that the directory is not empty. But at this
point in the program, the call to delete the .au files has completed.
Post by Gale Andrews
If not, see if 4059b2ae^ does it, with a long enough sleep that is not
unreasonable
As submitted, does not clean up empty folders, same message in log.
The only change is the spinning beach ball for 5 seconds presumably while
the sleep is performed. So we know that the sleep there will have an
undesirable visual consequence and I did not bother extending the sleep.
If #2 succeeds, verify that it also works when changing #if 1 to #if 0, but
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on pressing "No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the .au
files, and then asks the file system whether the .au files are really gone,
then the answer it gets is yes, they are really gone.
So what could explain the anomaly that the log tells us the directories
are not empty? Some extraneous files are somehow added to the folders?
PRL
Post by Gale Andrews
If #1, #2, or #3 is enough to fix closing without saving, determine whether
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now launch
Audacity guaranteed not to have bug 1567 present, but 1567 can still
occur on close without saving.
At any of those three commits, manually deleting old project folders before
close without save still stops 1567 occurring, even if there are two or more
project windows open. But if SessionData contains any project folders
which are not in use, then 1567 can trigger on close without save.
Gale
Also check that the log file no longer routinely contains (as master does,
even on my computer) error messages related to the temporary files.
PRL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Gale Andrews
2017-01-25 00:50:15 UTC
Permalink
Post by Paul Licameli
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567 occurring
on close without save.
I did git push -f to my origin. There are now three commits in the branch.
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b57cd075d9cd226cb591b939e5fc6c
The head includes the fork-and-crash fix, but could it be that we don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of folders does
not succeed if done too soon after removal of the contents of the folder, I
added the other commit one before head. This inserts code to delay between
removing files and removing folders. As submitted, it simply sleeps by a
number that you can tune. But if you change #if 1 to #if 0, then instead it
tests in a loop whether it can detect completion of removal of the files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing without saving
It doesn't stop bug 1567 occurring on close without save, even if the close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder? No .au
files left in them? Could there be hidden files? Does ls -a from terminal
list anything else in them?
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559' couldn't
be deleted (error 66: Directory not empty)
Specifically there used to be "operation not permitted" messages in the log,
but now no longer, right?
Yes, "Operation not permitted" was there before, just for the erroneous
deletion of a folder as a file.
It is something, that the log is tidier, even on my machine which does not
suffer bug 1567.
Is this list of log messages complete?
Yes, each project just has those two lines with the corresponding
change for the project number.
I now notice this: you did NOT see a log message for the etc/e00/d00
directory. There should have been such a directory in the tree. So it may
not be that .au files are not cleaned up (in fact they should normally be
deleted already at this point), but rather that the d00 folder was not
removed.
Audacity did not attempt to remove d00.
Or it did, but that failed silently without a log message.
Or it did, but a sleep is needed before attempting to remove the folder
above it.
As previous message, it did delete the d00 folder, but not e00 above it.


Gale
But this means I have not run out of experiments for you yet.
PRL
Post by Paul Licameli
Formerly there were more and different log messages, even on my computer.
You alone get these messages that the directory is not empty. But at this
point in the program, the call to delete the .au files has completed.
Post by Gale Andrews
If not, see if 4059b2ae^ does it, with a long enough sleep that is not
unreasonable
As submitted, does not clean up empty folders, same message in log.
The only change is the spinning beach ball for 5 seconds presumably while
the sleep is performed. So we know that the sleep there will have an
undesirable visual consequence and I did not bother extending the sleep.
If #2 succeeds, verify that it also works when changing #if 1 to #if 0, but
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on pressing "No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the .au
files, and then asks the file system whether the .au files are really gone,
then the answer it gets is yes, they are really gone.
So what could explain the anomaly that the log tells us the directories
are not empty? Some extraneous files are somehow added to the folders?
PRL
Post by Gale Andrews
If #1, #2, or #3 is enough to fix closing without saving, determine whether
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now launch
Audacity guaranteed not to have bug 1567 present, but 1567 can still
occur on close without saving.
At any of those three commits, manually deleting old project folders before
close without save still stops 1567 occurring, even if there are two or more
project windows open. But if SessionData contains any project folders
which are not in use, then 1567 can trigger on close without save.
Gale
Also check that the log file no longer routinely contains (as master does,
even on my computer) error messages related to the temporary files.
PRL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Gale Andrews
2017-01-25 00:44:32 UTC
Permalink
Paul, right now I'm just going to answer your questions as background
info, inline in each message.
Post by Paul Licameli
Post by Gale Andrews
Sigh. No effect on cleaning up folders or preventing 1567 occurring
on close without save.
I did git push -f to my origin. There are now three commits in the branch.
https://github.com/Paul-Licameli/audacity/commit/4059b2ae48b57cd075d9cd226cb591b939e5fc6c
The head includes the fork-and-crash fix, but could it be that we don't need
it, and the changes for cleanup of temporary files are enough?
To test whether that is so, you can checkout one or two commits before the
head. Using caret notation, you can name those as
4059b2ae^ and 4059b2ae^^
Two commits before head, you get just the change to the folder cleanup that
I wrote yesterday.
After seeing Gale's log messages, which suggest that removal of folders does
not succeed if done too soon after removal of the contents of the folder, I
added the other commit one before head. This inserts code to delay between
removing files and removing folders. As submitted, it simply sleeps by a
number that you can tune. But if you change #if 1 to #if 0, then instead it
tests in a loop whether it can detect completion of removal of the files,
but not exceeding the time limit.
See if 4059b2ae^^ is sufficient fo fix the problem of closing without saving
It doesn't stop bug 1567 occurring on close without save, even if the close
is on the final project window.
It doesn't clean up the empty folders, either in
/Users/gale/Library/Audacity/SessionData or in the default
/Users/gale/Library/Application Support/audacity/SessionData.
Are you really sure they (look like) empty folders in Finder?
No .au files left in them?
Yes, in Finder, the project folder "looks" empty except for an "e00" folder.

The e00 folder looks empty. The "d00" folder and its files have been
deleted, per their absence from the log message cited a few lines
below.
Post by Paul Licameli
Could there be hidden files? Does ls -a from terminal list anything
else in them?
ls -a shows a .DS_Store file in the root of the project folder, and e00
as completely empty.


Gale
Post by Paul Licameli
Post by Gale Andrews
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559/e00'
couldn't be deleted (error 66: Directory not empty)
16:51:34: Error: Directory
'/Users/gale/Library/Audacity/SessionData//project694592559' couldn't
be deleted (error 66: Directory not empty)
Formerly there were more and different log messages, even on my computer.
You alone get these messages that the directory is not empty. But at this
point in the program, the call to delete the .au files has completed.
Post by Gale Andrews
If not, see if 4059b2ae^ does it, with a long enough sleep that is not
unreasonable
As submitted, does not clean up empty folders, same message in log.
The only change is the spinning beach ball for 5 seconds presumably while
the sleep is performed. So we know that the sleep there will have an
undesirable visual consequence and I did not bother extending the sleep.
If #2 succeeds, verify that it also works when changing #if 1 to #if 0, but
that the delays are now variable and shorter
If I change #if 1 to #if 0, Audacity closes immediately on pressing "No" to
"Save changes?" with no beach ball. Log messages are unchanged.
This suggests to me that when Audacity makes calls to delete the .au files,
and then asks the file system whether the .au files are really gone, then
the answer it gets is yes, they are really gone.
So what could explain the anomaly that the log tells us the directories are
not empty? Some extraneous files are somehow added to the folders?
PRL
Post by Gale Andrews
If #1, #2, or #3 is enough to fix closing without saving, determine whether
it is enough for all symptoms of bug1567.
If I checkout 4059b2ae without carets then as expected I can now launch
Audacity guaranteed not to have bug 1567 present, but 1567 can still
occur on close without saving.
At any of those three commits, manually deleting old project folders before
close without save still stops 1567 occurring, even if there are two or more
project windows open. But if SessionData contains any project folders
which are not in use, then 1567 can trigger on close without save.
Gale
Also check that the log file no longer routinely contains (as master does,
even on my computer) error messages related to the temporary files.
PRL
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
audacity-devel mailing list
https://lists.sourceforge.net/lists/listinfo/audacity-devel
Loading...