This error is caused by some list type (TList, TStringList, etc.) where you're trying to access an element that is out of range. In general, accessing the N'th or higher element in a list of N items. Remember that lists always need an index less than the length/count value and greater or equal to 0. Thus: 0 <= Index < count.
But I guess you already know this. :-)
Now the probable cause of this error. It's a server application so it will be running multiple threads. Every connection will probably have it's own thread. They also seem to work with a LockList and I can imagine that this locklist isn't 100% threadsafe. Adding and removing locks is probably safe but I guess somewhere in the code it keeps an index for items in this list yet when items are removed, this index isn't updated. Thus:
If you start with 10 connection, thus 10 locks, index 0..9. If you then remove the first 3 connections the highest index will be 6. Yet if your application still has connections linked to locks 7, 8 or 9... Well, that would generate an index out of bounds.
Question is, is this happening and if so, where?
Main Topics
Browse All Topics





by: ciulyPosted on 2007-03-07 at 22:49:05ID: 18676910
If you don't know where it came from, then you need something to tell you that. either debug the program or use a software package that will track down exceptions and print the stacktrace. One such package is madhis madexcept from www.madshi.net . just install the madcomponents, selecting at least madexcept (this will install into the ide) then go to project properties, and check the enable madexcept on the project (make some setting if you want to, and then compile and run (the size of the exe will grow a little, but 200KB or something around that. Then, when you get the exception, you will be prompted with a dialog in wich you have the option to view the error (a bugreport.txt will also be saved where the exe is). On the first pane, you will see some general information, and on the second one, you will see the actual stack traces of each thread. usually, the first printed thread is the one with the problems. Having the stacktrace, you can easily find the location of the problem. If you don't know why you have a problem there, then just post a part of that code and we'll try to analize it.