Bug #2677

Infinite loop at TXM starting when deserializing a CA .prefs

Added by Sebastien Jacquot 4 months ago. Updated 2 months ago.

Status:Closed Start date:11/28/2019
Priority:Normal Due date:
Assignee:- % Done:

100%

Category:Persistence / Lazy Spent time: -
Target version:TXM 0.8.1

Description

recursion infinie lors de la réouverture de TXM si il y a une CA persistée
Caused by: java.lang.StackOverflowError
at java.security.AccessController.doPrivileged(Native Method)
at org.osgi.framework.FrameworkUtil.getBundle(FrameworkUtil.java:209)
at org.txm.core.results.TXMResult.autoSaveParametersFromAnnotations(TXMResult.java:1059)
at org.txm.core.results.TXMResult.setUserPersistable(TXMResult.java:2625)
at org.txm.core.results.TXMResult.setUserPersistable(TXMResult.java:2614)
at org.txm.ca.core.functions.CA.setUserPersistable(CA.java:1037)
at org.txm.core.results.TXMResult.setUserPersistable(TXMResult.java:2614)
at org.txm.ca.core.functions.CA.setUserPersistable(CA.java:1041)
at org.txm.core.results.TXMResult.setUserPersistable(TXMResult.java:2614)
at org.txm.ca.core.functions.CA.setUserPersistable(CA.java:1041)
at org.txm.core.results.TXMResult.setUserPersistable(TXMResult.java:2614)
at org.txm.ca.core.functions.CA.setUserPersistable(CA.java:1041)
at org.txm.core.results.TXMResult.setUserPersistable(TXMResult.java:2614)
at org.txm.ca.core.functions.CA.setUserPersistable(CA.java:1041)
at org.txm.core.results.TXMResult.setUserPersistable(TXMResult.java:2614)

Diagnostic

Bug has been introduced by adding:

// not an internal persistence (eg. corpus or partition)
if (!result.isInternalPersistable()) {
result.setUserPersistable(true);
}

to org.txm.objects.Project.loadResults(Class) line 535
to restore the user persistable state.
It also leads to saving the .prefs files that have just been loaded.

Fixed by using a new method
public void setUserPersistable(boolean userPersistable, boolean doCheck)
that only sets TXMResult.userPersistable to true without any more check if doCheck is equal to false.

Since it removes some processes as resaving the .prefs.file, need to see with MD if it's not break some special objects eg. Edition, Text, etc.

Associated revisions

Revision 2431
Added by Sebastien Jacquot 4 months ago

Fixes: Infinite loop at TXM starting when deserializing a CA .prefs (refs #2677)
Fixes: Parts creation from a lazy loaded Partition seems to execute some actions twice (refs #2683)

History

#1 Updated by Sebastien Jacquot 4 months ago

  • Description updated (diff)
  • % Done changed from 0 to 80

#2 Updated by Sebastien Jacquot 4 months ago

  • % Done changed from 80 to 100

Current state after some checks with MD:
- the fix described above has been validated
- we will later modify the solution in a way described here: http://forge.cbp.ens-lyon.fr/redmine/issues/2687

#3 Updated by Sebastien Jacquot 2 months ago

  • Target version changed from TXM 0.8.2 to TXM 0.8.1
  • % Done changed from 100 to 50

The bug has reappeared in trunk, need to check again and fix.

#4 Updated by Sebastien Jacquot 2 months ago

  • Status changed from New to Closed
  • % Done changed from 50 to 100

Fixed again.

Also available in: Atom PDF