Bug #2677

Infinite loop at TXM starting when deserializing a CA .prefs

Ajouté par Sebastien Jacquot il y a presque 6 ans. Mis à jour il y a plus de 5 ans.

Statut:Closed Début:28/11/2019
Priorité:Normal Echéance:
Assigné à:- % réalisé:

100%

Catégorie:Persistence / Lazy Temps passé: -
Version cible: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.

Révisions associées

Révision 2431
Ajouté par Sebastien Jacquot il y a presque 6 ans

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)

Historique

#1 Mis à jour par Sebastien Jacquot il y a presque 6 ans

  • Description mis à jour (diff)
  • % réalisé changé de 0 à 80

#2 Mis à jour par Sebastien Jacquot il y a presque 6 ans

  • % réalisé changé de 80 à 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 Mis à jour par Sebastien Jacquot il y a plus de 5 ans

  • Version cible changé de TXM 0.8.2 à TXM 0.8.1
  • % réalisé changé de 100 à 50

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

#4 Mis à jour par Sebastien Jacquot il y a plus de 5 ans

  • Statut changé de New à Closed
  • % réalisé changé de 50 à 100

Fixed again.

Formats disponibles : Atom PDF