| View previous topic :: View next topic |
| Author |
Message |
mustafa korkmaz Guest
|
Posted: Sat Aug 19, 2006 12:41 am Post subject: 'ntdll.dll' problem |
|
|
procedure TMyManagerThread.addlist(obje: tobject);
begin
EnterCriticalSection( listkritik );
try
try
Managerlist.Add( obje );
except on e:exception do
begin
.......
end;
end;
finally
LeaveCriticalSection( listkritik );
end;
end;
procedure TfrTCPServer.myProc( Athread: TIdPeerThread );
var MyClass : TMyclass;
begin
.....
MyClass := TMyclass.create;
MyClass.no := 123;
..............
try
ManagerThreads[ Tperson( Athread.data ).roomNumber ].addlist( MyClass );
except on e: exception do
begin
ExceptionLoga( e.Message ); //---------->Access violation at address 7C82F350 in module 'ntdll.dll'. Write of address 31333176
end;
end;
What may be source of the problem? Why ntdll.dll?
This program runs on win2003 server. I use Delhi 5. |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Sat Aug 19, 2006 12:56 am Post subject: Re: 'ntdll.dll' problem |
|
|
"mustafa korkmaz" <sekendizpasa (AT) yahoo (DOT) com> wrote in message
news:44e617e4$1 (AT) newsgroups (DOT) borland.com...
| Quote: | procedure TMyManagerThread.addlist(obje: tobject);
begin
EnterCriticalSection( listkritik );
try
try
Managerlist.Add( obje );
except on e:exception do
begin
.......
end;
end;
finally
LeaveCriticalSection( listkritik );
end;
end;
|
FYI, you can simplify that by using a TThreadList instead.
| Quote: | ManagerThreads[ Tperson( Athread.data ).roomNumber ].addlist(
MyClass ); |
You did not show where ManagerThreads is allocated and filled in, how the
roomNumber is assigned, or where listkritik is instantiated. A problem in
any of those operations can cause unexpected problems later on.
| Quote: | What may be source of the problem?
|
There is not enough details yet to diagnose that.
Because you did something that ultimately ended up calling an API function
inside of the DLL that then accessed invalid memory, throwing the exception.
Gambit |
|
| Back to top |
|
 |
Martin James Guest
|
Posted: Sat Aug 19, 2006 1:01 am Post subject: Re: 'ntdll.dll' problem |
|
|
| Quote: |
procedure TfrTCPServer.myProc( Athread: TIdPeerThread );
var MyClass : TMyclass;
begin
.....
MyClass := TMyclass.create;
MyClass.no := 123;
..............
try
ManagerThreads[ Tperson( Athread.data ).roomNumber ].addlist( MyClass );
except on e: exception do
begin
ExceptionLoga( e.Message ); //---------->Access violation at address 7C82F350 in module 'ntdll.dll'. Write of address 31333176
end;
end;
What may be source of the problem?
|
Illegal index?
Why ntdll.dll?
...because the CS call is illegal?
First, break up that complex thingy!
procedure TfrTCPServer.myProc( Athread: TIdPeerThread );
var MyClass : TMyclass;
thisPerson:TPerson;
theirRoomNumber:integer;
begin
.....
MyClass := TMyclass.create;
MyClass.no := 123;
..............
try
thisPerson:=Tperson(Athread.data);
theirRoomNumber:=thisPerson.roomNumber;
ManagerThreads[theirRoomNumber].addlist( MyClass );
except on e: exception do
begin
ExceptionLoga( e.Message );
end;
end;
Rgds,
Martin
PS. You have a manager thread for every room?? |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Sat Aug 19, 2006 2:27 am Post subject: Re: 'ntdll.dll' problem |
|
|
"Martin James" <nospam (AT) dial (DOT) pipex.com> wrote in message
news:44e61c99$1 (AT) newsgroups (DOT) borland.com...
| Quote: | ManagerThreads[theirRoomNumber].addlist( MyClass );
|
var
theManager: TMyManagerThread
theManager := ManagerThreads[theirRoomNumber];
theManager.addlist( MyClass );
Gambit |
|
| Back to top |
|
 |
Martin James Guest
|
Posted: Sat Aug 19, 2006 4:19 am Post subject: Re: 'ntdll.dll' problem |
|
|
| Quote: |
var
theManager: TMyManagerThread
theManager := ManagerThreads[theirRoomNumber];
theManager.addlist( MyClass );
|
Yes! Even more of the same <g>
Rgds,
Martin |
|
| Back to top |
|
 |
|