Sunday, December 12, 2010

Intellij issues on Ubuntu 64 bits with encrypted /home

Kept running into strange index issues with my Intellij 9 and 10 installations. The system/log/idea.log file was filled with:


java.lang.RuntimeException: java.lang.IllegalArgumentException: can't position buffer to offset 43716
at com.intellij.util.io.PersistentEnumerator.valueOf(PersistentEnumerator.java:499)
at com.intellij.util.io.StringRef.getString(StringRef.java:48)
at com.intellij.util.io.StringRef.toString(StringRef.java:92)
[..]
Caused by: java.lang.IllegalArgumentException: can't position buffer to offset 43716
at com.intellij.util.io.PagedFileStorage.get(PagedFileStorage.java:181)
at com.intellij.util.io.PagedFileStorage.getInt(PagedFileStorage.java:127)
at com.intellij.util.io.ResizeableMappedFile.getInt(ResizeableMappedFile.java:141)
[..]


or

java.lang.IndexOutOfBoundsException: off=1006632960 key.owner.length()=17582
at com.intellij.util.io.PagedFileStorage$StorageLock$BuffersCache.createValue(PagedFileStorage.java:66)
at com.intellij.util.io.PagedFileStorage$MyCache.get(PagedFileStorage.java:329)
at com.intellij.util.io.PagedFileStorage.getBuffer(PagedFileStorage.java:280)
at com.intellij.util.io.PagedFileStorage.get(PagedFileStorage.java:176)
at com.intellij.util.io.PagedFileStorage.getInt(PagedFileStorage.java:127)
at com.intellij.util.io.ResizeableMappedFile.getInt(ResizeableMappedFile.java:141)
at com.intellij.util.io.PersistentEnumerator.hashCodeOf(PersistentEnumerator.java:479)
at com.intellij.util.io.PersistentEnumerator.enumerateImpl(PersistentEnumerator.java:328)
at com.intellij.util.io.PersistentEnumerator.enumerate(PersistentEnumerator.java:222)


I seem to have fixed the issue by moving the IDEA config and caches into a non encrypted partition.

$ diff -u /usr/local/lib/idea/bin/idea.properties.orig /usr/local/lib/idea/bin/idea.properties
--- /usr/local/lib/idea/bin/idea.properties.orig 2010-12-10 15:50:01.916136005 +0100
+++ /usr/local/lib/idea/bin/idea.properties 2010-12-10 15:50:44.096136000 +0100
@@ -10,13 +10,13 @@
# Note for Windows users: please make sure you're using forward slashes. I.e. c:/idea/system

# path to IDEA config folder. Make sure you're using forward slashes
-idea.config.path=${user.home}/.IntelliJIdea10/config
+idea.config.path=/usr/local/${user.home}/.IntelliJIdea10/config

# path to IDEA system folder. Make sure you're using forward slashes
-idea.system.path=${user.home}/.IntelliJIdea10/system
+idea.system.path=/usr/local/${user.home}/.IntelliJIdea10/system

# path to user installed plugins folder. Make sure you're using forward slashes
-idea.plugins.path=${user.home}/.IntelliJIdea10/config/plugins
+idea.plugins.path=/usr/local/${user.home}/.IntelliJIdea10/config/plugins

#---------------------------------------------------------------------
# Maximum file size (kilobytes) IDEA should provide code assistance for.


See also http://devnet.jetbrains.net/docs/DOC-181 and http://devnet.jetbrains.net/message/5259840.

2 comments:

  1. thanks! that fixed it for me too. linked this post on the issue tracker ( http://youtrack.jetbrains.net/issue/IDEA-66911 )

    ReplyDelete