-
Notifications
You must be signed in to change notification settings - Fork 9
Description
I was able to run CodeGRITS with eye-tracker emulated with mouse (thanks to change proposed in PR #15), and with iMotions Lab via iMotions Events API (work very much in progress in my fork of repository: jnareb/CodeGRITS, on add-imotions-support branch, which should address the jnareb#1 issue).
Unfortunately, from time to time, the CodeGRITS plugin crashes with the following error:
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments:
Read access is allowed from inside read-action only (see Application.runReadAction());
If you access or modify model on EDT consider wrapping your code in WriteIntentReadAction ;
see https://jb.gg/ij-platform-threading for details
Current thread: Thread[#51,AWT-EventQueue-0,10,main] 1201111603 (EventQueue.isDispatchThread()=true)
SystemEventQueueThread: (same)
The stack trace differs in detail from case to case, but (from what I understand) the source of problems is the following part:
at trackers.EyeTracker.getASTStructureElement(EyeTracker.java:450) at trackers.EyeTracker.lambda$processRawData$1(EyeTracker.java:306)
I have used CodeGRITS plugin in two projects, and the problem happens when browsing Python code of Django app, but not strangely for the other project.
Below you can find the whole stack trace:
stacktrace.txt
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Read access is allowed from inside read-action only (see Application.runReadAction()); If you access or modify model on EDT consider wrapping your code in WriteIntentReadAction ; see https://jb.gg/ij-platform-threading for details
Current thread: Thread[#51,AWT-EventQueue-0,10,main] 1201111603 (EventQueue.isDispatchThread()=true)
SystemEventQueueThread: (same)
at com.intellij.util.concurrency.ThreadingAssertions.createThreadAccessException(ThreadingAssertions.java:257)
at com.intellij.util.concurrency.ThreadingAssertions.softAssertReadAccess(ThreadingAssertions.java:173)
at com.intellij.openapi.application.impl.ApplicationImpl.assertReadAccessAllowed(ApplicationImpl.java:1171)
at com.intellij.psi.impl.source.PsiFileImpl.assertReadAccessAllowed(PsiFileImpl.java:198)
at com.intellij.psi.impl.source.PsiFileImpl.getStubTreeOrFileElement(PsiFileImpl.java:726)
at com.intellij.psi.impl.source.PsiFileImpl.getStubTree(PsiFileImpl.java:721)
at com.intellij.psi.impl.source.SpineRef.getStub(SpineRef.java:27)
at com.intellij.extapi.psi.StubBasedPsiElementBase.getStub(StubBasedPsiElementBase.java:358)
at com.jetbrains.python.psi.impl.PyImportElementImpl.getImportedQName(PyImportElementImpl.java:43)
at com.jetbrains.python.psi.impl.PyImportElementImpl.toString(PyImportElementImpl.java:215)
at java.base/java.lang.String.valueOf(String.java:4465)
at trackers.EyeTracker.getASTStructureElement(EyeTracker.java:450)
at trackers.EyeTracker.lambda$processRawData$1(EyeTracker.java:306)
at java.base/java.lang.Thread.run(Thread.java:1583)
at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:167)
at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:167)
at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:173)
at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:167)
at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:595)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:488)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10$lambda$9(IdeEventQueue.kt:313)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:865)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10(IdeEventQueue.kt:312)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:974)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:110)
at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:974)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12(IdeEventQueue.kt:307)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:347)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
I use PyCharm 2025.2.1.1 on Windows 11 Pro, 24H2, with Python 3.13 as python.exe in venv.
I have installed CodeGRITS from branch in my fork ot the repo, i.e., 0.3.2 with modifications.