🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.socket
6 messages
6 total messages Started by Colin B Maharaj Thu, 07 Jun 2007 12:14
Code Guard error when using Indy9
#1044
Author: Colin B Maharaj
Date: Thu, 07 Jun 2007 12:14
35 lines
2453 bytes
The problem is happening in Readable.
my code is like this....
//--------------------------------------------------
      TCPClient->WriteBuffer(k, strlen(k));
      Sleep(20);
      bool ret = TCPClient->Socket->Readable(Timeout);
//--------------------------------------------------

as you can tell k is a character array.


7C812A5B C:\WINDOWS\system32\kernel32.dll
00535313 ___raiseDebuggerException
005363C2 ____ExceptionHandler
0052E07D __ExceptionHandler
7C90378B ntdll.dll
7C90EAFA ntdll.dll
0CD17126 C:\PROGRA~1\BORLAND\CBUILD~1\BIN\CG32.DLL
0CD17482 C:\PROGRA~1\BORLAND\CBUILD~1\BIN\CG32.DLL
0CD015E1 C:\PROGRA~1\BORLAND\CBUILD~1\BIN\CG32.DLL
0CD01691 C:\PROGRA~1\BORLAND\CBUILD~1\BIN\CG32.DLL
004A7865 System::__linkproc__ ReallocMem(P=????, NewSize=????)
004852F5 Classes::TList::Grow(Self=:00EDBE34)
00485084 Classes::TList::Add(Self=:00EDBE34, Item=:00000684)
004670DB IdSocketHandle::_16415
004671B5 Idsockethandle::TIdSocketHandle::Readable
00465F80 Idiohandlersocket::TIdIOHandlerSocket::Readable
00421289 TCT2KPoll::RawData(this=:00F2BD1C, off=132451, SiteID=1)
0045160A TSite::PollRecordsAndRawData(this=:01529850, SiteID=1)
0044EC84 TSite::PollRecords(this=:01529850, SiteID=1)
0043F6D3 TPollSite::ExecuteTCP(this=:00F27234)
0043F1A5 TPollSite::Execute(this=:00F27234)
0048EA39 Classes::ThreadProc(Thread=:00F27234)
004A959E System::ThreadWrapper(Parameter=:00F27278)
7C80B683 C:\WINDOWS\system32\kernel32.dll
Re: Code Guard error when using Indy9
#1045
Author: Colin B Maharaj
Date: Thu, 07 Jun 2007 13:09
25 lines
1767 bytes
Readable / Writable everything....

So here is whats happening
1. Not use any AnsiString in my thread code.
but....
2. Certain Indy function were calling VCL code like TList
which could have AnsiStrings. So I had to use these functions

Instead of writeln...
a) TCPClient->Socket->Send("SEND\r\n", 6);

b) Instead of Readable remove it completely and use this....

char c;
TCPClient->ReadBuffer(&c, 1);


....instead except I do not know the behavior of it too much
just need to write a timeout variation of it...

Now codeguard and memory profiler shows only 1 error

Opps, my connection code uses Readable for testing so I will have to 
remove this.
Re: Code Guard error when using Indy9
#1046
Author: Remy Lebeau (TeamB)
Date: Fri, 08 Jun 2007 19:58
10 lines
1143 bytes
"Colin B Maharaj" <noreply@myhost.com> wrote in message
news:4667f6b5$1@newsgroups.borland.com...

> The problem is happening in Readable.

What problem?


Gambit
Re: Code Guard error when using Indy9
#1047
Author: Colin B Maharaj
Date: Sat, 09 Jun 2007 03:41
26 lines
1720 bytes
Like I said, anytime I call Readln, Writeln and now Readable
the system creates a memory overrun detected by both codeguard
and memproof.

When I illiminate the use of these functions and use more primitive
indy functions to replicate readln, writeln etc...I get no error.

It is my belief that Readln and Writeln are calling AnsiString
or some other non-thread safe routines and creating havok.


When I have time I will create a simple test case and post it.


Remy Lebeau (TeamB) wrote:
> "Colin B Maharaj" <noreply@myhost.com> wrote in message
> news:4667f6b5$1@newsgroups.borland.com...
> 
>> The problem is happening in Readable.
> 
> What problem?
> 
> 
> Gambit
> 
> 
Re: Code Guard error when using Indy9
#1051
Author: Remy Lebeau (TeamB)
Date: Mon, 11 Jun 2007 16:30
19 lines
1510 bytes
"Colin B Maharaj" <noreply@myhost.com> wrote in message
news:466a2153$1@newsgroups.borland.com...

> Like I said, anytime I call Readln, Writeln and now Readable
> the system creates a memory overrun detected by both
> codeguard and memproof.

Please be more specific.  What EXACTLY is being reported?  What does
the actual code look like?

> It is my belief that Readln and Writeln are calling AnsiString
> or some other non-thread safe routines and creating havok.

They do not create havok.  Any such usage is local to the calling
thread only, which is perfectly safe.


Gambit
Re: Code Guard error when using Indy9
#1062
Author: Colin B Maharaj
Date: Sun, 17 Jun 2007 23:08
31 lines
2149 bytes
Hi Remy thanks for your responses and concern. And
I do apologize for being so presumptuous. I will
do the test code and post it as soon as possible.

Many thanks for all the folks in the group over the
last few weeks who has assisted me.

Colin B Maharaj


Remy Lebeau (TeamB) wrote:
> "Colin B Maharaj" <noreply@myhost.com> wrote in message
> news:466a2153$1@newsgroups.borland.com...
> 
>> Like I said, anytime I call Readln, Writeln and now Readable
>> the system creates a memory overrun detected by both
>> codeguard and memproof.
> 
> Please be more specific.  What EXACTLY is being reported?  What does
> the actual code look like?
> 
>> It is my belief that Readln and Writeln are calling AnsiString
>> or some other non-thread safe routines and creating havok.
> 
> They do not create havok.  Any such usage is local to the calling
> thread only, which is perfectly safe.
> 
> 
> Gambit
> 
> 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads