I’m still continuing my stress tests, with a server generating lot of events to a client and a client generating a lot of calls to the server, trying to help you find where SuperHTTPChannel problems are.
In attachment I’ve put the stack trace screenshot: as you can see, the exception rises from the for loop in Synapse FindHeaderIndex. The only reason I can see is that the count of the strings in the headers list is changed while the loop was running and the first thing coming to my mind is that two threads are accessing the headers at the same time and that usually means that a critical section is missing somewhere or that a thread from the thread pool is used two times at the same time.
It’s possible that two of my client threads are using the channel at the same time, but I was always told that SuperHTTPChannels were multi-thread safe.
Hello,
We couldn’t reproduce this error.
Can you describe your project more detail - OS, Delphi and RO ver? Please can you send us a testcase which reproduces this error?
We attached our testcase to you.
I’m using Delphi 7 with RO SDK 6.0.55 and I get an AV just after the client starts, sometimes in Stream_WriteUTF8StringWithLength, sometimes in TROBinMessage.WriteStream (source is nil)
Hello,
Can you send us a small testcase which reproduces this error?
Just recompiling YOUR testcase with my Delphi 7 (build 8.1) makes those AV appears.
I’m sure you haven’t tested it with Delphi 7 because I had to change two OutputDebugString(PWideChar(x)) in OutputDebugString(PChar(x)) to make it compile.
I’ve tested it on two different Windows XP installations.
In attachment your source with those two little changes and also the executables generated by Delphi 7.
Hello,
We tested it with d7 and d2010. We get only timeout exception. We couldn’t reproduce ‘List Index out of bonds’ error. How do you get this error?
With your testcase I don’t get a ‘list index out of bounds’, it just gives me a lot of AV.
I’ve put online a video recording of what happens on one of my test PC http://dl.dropbox.com/u/35095560/20120327_2205_31.avi
The only peculiar thing of all the three PCs where I tested it is that are all dual core machines with Windows XP.
Can you send me the exes compiled with your delphi 7 ? So I can run them and understand if the problem depends on the compiler enviroment or the execution environment.
Hello,
We could reproduce AV errors in D7+XP. Try to use own bin message for each thread:
type TChannelThead = class(TThread) private fStep: Integer; fChannel: TROTransportChannel; fMessage: TROMessage; public constructor Create(aMessage: TROMessage; aChannel: TROTransportChannel); procedure Execute(); override; destructor Destroy;override; end; constructor TChannelThead.Create(aMessage: TROMessage; aChannel: TROTransportChannel); begin FreeOnTerminate := True; fStep := 0; fChannel := aChannel; //fMessage := aMessage; fMessage := TROBinMessage.Create(nil); fMessage.Assign(aMessage); inherited Create(False); end; destructor TChannelThead.Destroy; begin fMessage.Free; inherited; end;
We also could reproduce ‘List Index out of bonds’ in Win2003Server+D7. It error occurs very rarely and we logged it as #54798 for investigation.