NVDA crash randomly when executing onInstall function in installTasks #4496

Closed
nvaccessAuto opened this Issue Sep 28, 2014 · 12 comments

1 participant

@nvaccessAuto

Reported by norrumar on 2014-09-28 07:58
NVDA crashes randomly when installing Emoticons add-on using onInstall function of installTasks.
It could be related to import speechDictHandler.

@nvaccessAuto

Attachment installTasks.py added by norrumar on 2014-09-28 08:00
Description:
InstallTasks containing onInstall function

@nvaccessAuto

Attachment nvda-old.log added by norrumar on 2014-09-28 08:01
Description:
Log file

@nvaccessAuto

Comment 1 by jteh on 2014-09-28 09:11
This shouldn't be random. It should occur every time onUninstall is run in affected add-ons, which means whenever NVDA is restarted after removing or updating the add-on.

I suspect this is due to the circular import between speechDictHandler and synthDriverHandler. It looks like synthDriverHandler doesn't need to be imported in speechDictHandler any more, so it can be removed.

@norrumar, I assume you can run from source? If so, can you please try removing this line from speechDictHandler:

import synthDriverHandler

Does that fix the problem?
Changes:
Milestone changed from None to 2014.4

@nvaccessAuto

Comment 2 by norrumar (in reply to comment 1) on 2014-09-28 10:29
Replying to jteh:

This shouldn't be random. It should occur every time onUninstall is run in affected add-ons, which means whenever NVDA is restarted after removing or updating the add-on.

I suspect this is due to the circular import between speechDictHandler and synthDriverHandler. It looks like synthDriverHandler doesn't need to be imported in speechDictHandler any more, so it can be removed.

@norrumar, I assume you can run from source? If so, can you please try removing this line from speechDictHandler:

import synthDriverHandler

Does that fix the problem?

Yes, the problem is fixed removing this line. But then another issue appears, about keyboardHandler. It's shown in the new attached log file.
Thanks.

@nvaccessAuto

Attachment nvda.log added by norrumar on 2014-09-28 10:33
Description:
New log file: error in keyboardHandler

@nvaccessAuto

Comment 3 by jteh on 2014-09-28 11:00
I suspect (but am less certain) that this is due to importing gui in installTasks, which probably indirectly causes another circular import. Fixing this one will be much harder.

You can work around this by importing gui in onInstall instead of at module level. However, it'd obviously still be better if doing what you're doing didn't break NVDA.

@nvaccessAuto

Comment 4 by norrumar (in reply to comment 3) on 2014-09-28 11:26
Replying to jteh:

I suspect (but am less certain) that this is due to importing gui in installTasks, which probably indirectly causes another circular import. Fixing this one will be much harder.

You can work around this by importing gui in onInstall instead of at module level. However, it'd obviously still be better if doing what you're doing didn't break NVDA.

Yes, it seems you are right: if I import gui in onInstall the problem don't appear executing NVDA from source, if I remove import synthHandler from speechDictHandler.
So imo this ticket is still valid and this line could be removed from the core.
Thanks a lot.

@nvaccessAuto

Comment 5 by jteh on 2014-11-20 08:05
These really should have been done for 2014.4, but we're out of time and they aren't absolutely critical. Still, we need to manage this better in future.
Changes:
Milestone changed from 2014.4 to 2015.1

@nvaccessAuto

Comment 6 by norrumar on 2014-11-20 08:17
I just have seen the modification for the Milestone of this ticket, and just before I have created t4496 branch at
https://bitbucket.org/nvdaaddonteam/nvda
Thanks.

@nvaccessAuto

Comment 8 by James Teh <jamie@... on 2015-01-16 06:05
In [dd5a7f8]:
```CommitTicketReference repository="" revision="dd5a7f868a0d3897678f867ec118d836fa3026ed"
NVDA no longer crashes when restarting after removing or updating an add-on which imports speechDictHandler in its installTasks module.

This was due to a circular import between speechDictHandler and synthDriverHandler. speechDictHandler no longer requires synthDriverHandler, so that import was simply removed.
Re #4496.

@nvaccessAuto

Comment 9 by James Teh <jamie@... on 2015-01-16 06:05
In [97a7097]:
```CommitTicketReference repository="" revision="97a7097b1479ceb6574917a1170fb3eed7acfc40"
Merge branch 't4496' into next

Incubates #4496.

Changes:
Added labels: incubating
@nvaccessAuto

Comment 11 by James Teh <jamie@... on 2015-01-30 05:25
In [fd684d9]:
```CommitTicketReference repository="" revision="fd684d9dc908010bf66483f362f4ad6c9d3e5747"
NVDA no longer crashes when restarting after removing or updating an add-on which imports speechDictHandler in its installTasks module.

This was due to a circular import between speechDictHandler and synthDriverHandler. speechDictHandler no longer requires synthDriverHandler, so that import was simply removed.
Fixes #4496.

Changes:
Removed labels: incubating
State: closed
@nvaccessAuto nvaccessAuto added this to the 2015.1 milestone Nov 10, 2015
@jcsteh jcsteh added a commit that referenced this issue Nov 23, 2015
@nvdaes nvdaes NVDA no longer crashes when restarting after removing or updating an …
…add-on which imports speechDictHandler in its installTasks module.

This was due to a circular import between speechDictHandler and synthDriverHandler. speechDictHandler no longer requires synthDriverHandler, so that import was simply removed.
Fixes #4496.
fd684d9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment