Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvda settings randomly resetting #3165

Closed
nvaccessAuto opened this issue Apr 17, 2013 · 14 comments
Closed

nvda settings randomly resetting #3165

nvaccessAuto opened this issue Apr 17, 2013 · 14 comments
Assignees
Labels
bug p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority z goodForNewDev (archived)
Milestone

Comments

@nvaccessAuto
Copy link

Reported by camlorn on 2013-04-17 13:24
This has happened twice in 3 days. Nvda will randomly forget all of my settings, including that nvda has been run on my computer before, re displaying the start up dialogs and resetting everything. Obviously, this is...problematic.
What do I need to do, besides (if I can) comment with how to reliably reproduce it?
The only changes in my setup since this has started happening are the enabling of the us-dvorak keyboard layout.
I'm on Version: master-9098,fb41602, and continually update as soon as new development snapshots come out. I first saw this on Monday the 15th.
The easiest fix would probably be making a backup of all settings at startup, of some sort. I'm not really sure why this is happening, but both times were while the system was being very sluggish--maybe some sort of interrupted file writing?
Blocked by #667

@nvaccessAuto
Copy link
Author

Comment 1 by jteh on 2013-04-17 19:52
Do you have any NVDA add-ons installed?

@nvaccessAuto
Copy link
Author

Comment 2 by briang1 on 2013-04-18 07:49
I assume that the older version does not do this even if reinstalled does it?

The last time I saw this effect it turned out to be the computer or in fact a program running on it that seemed to interfere with some files being written to.

However something like that should affect older versions of nvda equally as often as the newer ones I'd have thought.
Have you installed anything recently?

@nvaccessAuto
Copy link
Author

Comment 3 by camlorn on 2013-04-19 20:54
The most recently installed program is Visual Studio 2012. The second most recently installed program is Skype. Both times, this happened shortly after a processor spike during which large parts of the system became unresponsive. Since it hasn't yet happened a third time, I'm going to go with it having something to do with not enough cpu for settings saving.
If I can reliably duplicate it, I'll comment; that said, it is probably worthwhile to at least do something to make the settings more resistant to this.
The only installed add-on is OCR.

@nvaccessAuto
Copy link
Author

Comment 4 by briang1 on 2013-04-20 06:20
Sounds to me that its more likely to be a Windows process and I have noticed on XP since a recent Windows update, with nvda running something stops Explorer.exe from closing every time at shutdown. As you say, its not doing it to order, and I did wonder if it might be the malicious software removal tool or anti virus that is spiking the processor and then some software does not do as expected. I don't see how one can make a program resistant to this myself if this is indeed the case. Last time it happened they updated the malware scanning routines so it could not max out a processor. Just an idea.
Good ol Microsoft!

@nvaccessAuto
Copy link
Author

Comment 5 by camlorn on 2013-04-21 17:27
I am running no Antivirus. Windows firewall is running, but that's it. I'm also windows 7.

@nvaccessAuto
Copy link
Author

Comment 6 by jteh on 2013-04-23 05:01
The only way this could happen that i can think of is that NVDA was terminated while it was writing the configuration file. We could work around this in one of two ways:

  1. Back up the old configuration before writing; or
  2. Write the configuration to a temporary file and then move that file over the top of the configuration file.
    The second option is probably easier, as it avoids the need to detect and restore a broken configuration.

@nvaccessAuto
Copy link
Author

Comment 7 by PZajda on 2013-09-13 17:55
Hi,

I have done something which should fix this issue, I hop I understood the way to fix it correctly:

  • First, change the filename attribute of config.conf to nvda.ini.tmp;
  • Write the configuration to this file;
  • put the filename attribute to its original value;
  • Delete the old nvda.ini then replace it by the temporary file.

If the temporary config is not written correctly, the configuration shouldn't be change so not damaged too.
The worst case is if NVDA is stopped before the copy of the new file, it is still possible to rename nvda.ini.tmp to nvda.ini and get the configuration back. Maybe should it be done automatically when NVDA load the configuration?

It is available on git at:
https://bitbucket.org/pzajda/nvda.git
Branch: t3165

@nvaccessAuto
Copy link
Author

Comment 8 by jteh on 2013-09-13 21:06
Thanks again for your work. Unfortunately, I meant to block this on #667 but forgot, as #667 completely changes the config code and it also writes profiles, so it may as well be done after that is merged. The idea is the same, though. We probably want to factor it out into a helper function so that it can also be used by inputCore when writing gestures.ini (#1532).

I sincerely apologise for having wasted some of your time on this.

@bramd
Copy link
Contributor

bramd commented Apr 27, 2016

I've seen this issue happen a few times recently on a fairly new laptop of a friend running Windows 10. It seems quite easy to implement this and I would be glad to do so.

@derekriemer
Copy link
Collaborator

Please produce steps to reproduce the

Sent from my heavily encrypted iPhone.
Please disregard errors as this is a smaller device.

On Apr 26, 2016, at 19:19, Bram Duvigneau notifications@github.com wrote:

I've seen this issue happen a few times recently on a fairly new laptop of a friend running Windows 10. It seems quite easy to implement this and I would be glad to do so.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub please give steps on reproducing this bug. Thanks

@bramd
Copy link
Contributor

bramd commented Apr 29, 2016

@derekriemer So far, I was unable to reproduce this reliably. It just sometimes happened after a shutdown/reboot of the computer.

@Brian1Gaff
Copy link

Are you sure that the computer is not trying to recover from an error, it
has at least once happened to meas it has restored to what it thought was a
last known good start up.
Brian

bglists@blueyonder.co.uk
Sent via blueyonder.
Please address personal email to:-
briang1@blueyonder.co.uk, putting 'Brian Gaff'
in the display name field.
----- Original Message -----
From: "Bram Duvigneau" notifications@github.com
To: "nvaccess/nvda" nvda@noreply.github.com
Sent: Friday, April 29, 2016 9:59 PM
Subject: Re: [nvaccess/nvda] nvda settings randomly resetting (#3165)

@derekriemer So far, I was unable to reproduce this reliably. It just
sometimes happened after a shutdown/reboot of the computer.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#3165 (comment)

bramd added a commit to bramd/nvda that referenced this issue Apr 30, 2016
…refs issue nvaccess#3165)

Instead of directly writing the file, a temporary file is created and
moved to the final location. This prevents corrupt configuration files
being written.
Added a fileUtils module with just a FaultTolerantFile context manager for
now to facilitate this pattern.
Please update miscDependencies submodule to a revision that includes the
osmove module.
bramd added a commit to bramd/nvda that referenced this issue Jun 16, 2016
…refs issue nvaccess#3165)

Instead of directly writing the file, a temporary file is created and
moved to the final location. This prevents corrupt configuration files
being written.
Added a fileUtils module with just a FaultTolerantFile context manager for
now to facilitate this pattern.
Please update miscDependencies submodule to a revision that includes the
osmove module.
@jcsteh jcsteh added the p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority label Mar 15, 2017
@jcsteh
Copy link
Contributor

jcsteh commented Mar 15, 2017

Making this a p1. While it doesn't cause a crash, the configuration getting corrupted and reset is very bad for the user when it happens and we've had quite a few reports of it now.

@feerrenrut, would you mind taking care of this? @bramd kindly provided a PR (#5916) to fix this, but unfortunately, I didn't notice he had addressed my review comments and now we've broken it with recent config system changes. I think much of the PR is still usable though. See also #3165 (comment) for background.

@feerrenrut feerrenrut self-assigned this Mar 15, 2017
@PratikP1
Copy link

PratikP1 commented Mar 15, 2017 via email

feerrenrut pushed a commit that referenced this issue Mar 17, 2017
…refs issue #3165)

Instead of directly writing the file, a temporary file is created and
moved to the final location. This prevents corrupt configuration files
being written.
Added a fileUtils module with just a FaultTolerantFile context manager for
now to facilitate this pattern.
Please update miscDependencies submodule to a revision that includes the
osmove module.
feerrenrut added a commit that referenced this issue Mar 17, 2017
Re issue: #3165
Merge branch 'i3165-saferConfigSaving' into next
@nvaccessAuto nvaccessAuto added this to the 2017.2 milestone Apr 4, 2017
feerrenrut added a commit that referenced this issue Apr 4, 2017
Fixes issue #3165

Save configuration profiles and gesture maps as an atomic operation

Instead of directly writing the file, a temporary file is created and moved to the final location. This prevents corrupt configuration files being written.
Added a `fileUtils` module with just a `FaultTolerantFile` context manager for now to facilitate this pattern.
feerrenrut added a commit that referenced this issue Apr 4, 2017
- Deprecated code removed:
 - PR #6878: `speech.REASON_*` constants, `controlTypes.REASON_*` should be used
   instead. (issue #6846)
 - PR #6877: `i18nName` for synth settings, `displayName` and
   `displayNameWithAccelerator` should be used instead. (issues #6846, #5185)
 - PR #6876: `config.validateConfig`. (issues #6846, #667)
 - PR #6875: `config.save`. (issue #6846)

- PR #6914: Support Windows Calculator on Windows 10 Enterprise LTSB (Long-Term
  Servicing Branch) and Server. (issue #6914)
- PR #6987: Reduced the chance of configuration file being corrupted when
  Windows shuts down. Configuration files are now written to a temporary
  file before replacing the actual configuration file. (issue #3165)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug p2 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority z goodForNewDev (archived)
Projects
None yet
Development

No branches or pull requests

7 participants