From: SourceForge.net <no...@so...> - 2010-12-30 08:49:40
|
Bugs item #3142482, was opened at 2010-12-23 15:36 Message generated for change (Comment added) made by k_satoda You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100588&aid=3142482&group_id=588 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: editor core Group: None Status: Open Resolution: None Priority: 3 Private: No Submitted By: Shlomy Reinstein (shlomy) Assigned to: Matthieu Casanova (kpouer) Summary: Exception while saving a buffer Initial Comment: While saving a buffer, I got the following exception: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 16431 at org.gjt.sp.jedit.buffer.JEditBuffer.getLineText(JEditBuffer.java:517) at org.gjt.sp.jedit.buffer.JEditBuffer.getLineText(JEditBuffer.java:499) at org.gjt.sp.jedit.bufferio.BufferIORequest.write(BufferIORequest.java:364) at org.gjt.sp.jedit.bufferio.BufferAutosaveRequest.run(BufferAutosaveRequest.java:82) at org.gjt.sp.util.WorkThread.doRequest(WorkThread.java:216) at org.gjt.sp.util.WorkThread.doRequests(WorkThread.java:183) at org.gjt.sp.util.WorkThread.run(WorkThread.java:157) Additional information: This is a local text file with 16431 lines, which I've been maintaining for several years now. I don't recall ever having exceptions while saving it in the past. I frequently perform copy/paste/cut operations on the file, as well as undo/redo, which might have caused the problem. ---------------------------------------------------------------------- >Comment By: Kazutoshi Satoda (k_satoda) Date: 2010-12-30 17:49 Message: > However, if BufferAutosaveRequest locks the buffer, any modification to > the buffer is halt until the save complete; it must be anoying. Thus the > locking is not done: commented out from source code. FYI, I found the exact revision which did this. http://jedit.svn.sourceforge.net/jedit/?view=rev&rev=4050 Please see the diff of BufferIORequest.java and CHANGES.txt . ---------------------------------------------------------------------- Comment By: Kazutoshi Satoda (k_satoda) Date: 2010-12-23 15:58 Message: This happens because BufferAutosaveRequest doesn't lock the buffer while reading it. The exception is thrown when some lines were deleted while BufferAutosaveRequest is running. This means that the auto save file can be corrupted silently, when some lines were added, or edited without changing the number of lines. However, if BufferAutosaveRequest locks the buffer, any modification to the buffer is halt until the save complete; it must be anoying. Thus the locking is not done: commented out from source code. The right solution will be, locking the buffer in BufferAutosaveRequest, and abort the request with the lock if someone request a write lock of the buffer. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100588&aid=3142482&group_id=588 |