Error :$000005A0 TNetFileProc.Execute: Access

  • 主题发起人 主题发起人 szzgh
  • 开始时间 开始时间
S

szzgh

Unregistered / Unconfirmed
GUEST, unregistred user!
Error :$000005A0 TNetFileProc.Execute: Access violation at address 00401EE3 in module 'NetFileService.exe'. Read of address 00000001(100分)<br />Error :$000005A0 TNetFileProc.Execute: Access violation at address 00401EE3 in module 'NetFileService.exe'. Read of address 00000001
这是个什么错误,一个多线程处理消息的文件传输服务程序报的错,各个客户端通过此程序将服务器上的数据按其需要拷到本地来,现在的问题是在日志里唯一能看到的错误是这个,后果是一天可能有四五次服务程序自动退出。希望各位高手兄弟帮帮忙,小弟弟感激不尽。
 
读写了不存在的对象,没有代码只能这样瞎猜了。
 
一般都是nil引起的
 
06-10-23 20:45:57.734 Info :SvcNetFile accept($000008D4)
//////请求打开文件
06-10-23 20:45:57.734 Debug2 :$000008D4 RcvData
06-10-23 20:45:57.734 Debug2 :$000008D4 RcvLen:420
06-10-23 20:45:57.734 Debug2 :$000008D4 recv(Socket)
06-10-23 20:45:57.734 Debug :$000008D4 recv data 420 bytes
06-10-23 20:45:57.734 Debug :$000008D4 ProcessMessage( type: 2, size: 420 )
06-10-23 20:45:57.734 Info :$000008D4 Client 172.16.10.91 request OpenFile('J:/DvsVoice/20061023/18/1830069536686.voc')
06-10-23 20:45:57.734 Info :$000008D4 OpenFile: [操作成功完成。]
//////请求移动文件指针
06-10-23 20:45:57.734 Debug2 :$000008D4 RcvData
06-10-23 20:45:57.734 Debug2 :$000008D4 RcvLen:36
06-10-23 20:45:57.734 Debug2 :$000008D4 recv(Socket)
06-10-23 20:45:57.734 Debug :$000008D4 recv data 36 bytes
06-10-23 20:45:57.734 Debug :$000008D4 ProcessMessage( type: 5, size: 36 )
06-10-23 20:45:57.734 Info :$000008D4 Client 172.16.10.91 request SetFilePointer($000001E0, 552960, 0, 0)
06-10-23 20:45:57.734 Info :$000008D4 SetFilePointer: [操作成功完成。]
///////请求读取文件
06-10-23 20:45:57.734 Debug2 :$000008D4 RcvData
06-10-23 20:45:57.734 Debug2 :$000008D4 RcvLen:36
06-10-23 20:45:57.734 Debug2 :$000008D4 recv(Socket)
06-10-23 20:45:57.734 Debug :$000008D4 recv data 36 bytes
06-10-23 20:45:57.734 Debug :$000008D4 ProcessMessage( type: 3, size: 36 )
06-10-23 20:45:57.734 Info :$000008D4 Client 172.16.10.91 request ReadFile($000001E0, buf, 61440)
////////按受新的客户端请求 172.16.10.92
06-10-23 20:45:57.750 Info :SvcNetFile accept($000008C0)
////////请求打开文件
06-10-23 20:45:57.750 Debug2 :$000008C0 RcvData
06-10-23 20:45:57.750 Debug2 :$000008C0 RcvLen:420
06-10-23 20:45:57.750 Debug2 :$000008C0 recv(Socket)
06-10-23 20:45:57.750 Debug :$000008C0 recv data 420 bytes
06-10-23 20:45:57.750 Debug :$000008C0 ProcessMessage( type: 2, size: 420 )
06-10-23 20:45:57.750 Info :$000008C0 Client 172.16.10.92 request OpenFile('J:/DvsVoice/20061023/19/1902512506665.voc')
06-10-23 20:45:57.750 Info :$000008C0 OpenFile: [操作成功完成。]
////////请求设置文件指针
06-10-23 20:45:57.750 Debug2 :$000008C0 RcvData
06-10-23 20:45:57.750 Debug2 :$000008C0 RcvLen:36
06-10-23 20:45:57.750 Debug2 :$000008C0 recv(Socket)
06-10-23 20:45:57.750 Debug :$000008C0 recv data 36 bytes
06-10-23 20:45:57.750 Debug :$000008C0 ProcessMessage( type: 5, size: 36 )
06-10-23 20:45:57.750 Info :$000008C0 Client 172.16.10.92 request SetFilePointer($000001D8, 1736587, 0, 0)
06-10-23 20:45:57.750 Info :$000008C0 SetFilePointer: [操作成功完成。]
////////请求读取文件
06-10-23 20:45:57.750 Debug2 :$000008C0 RcvData
06-10-23 20:45:57.750 Debug2 :$000008C0 RcvLen:36
06-10-23 20:45:57.750 Debug2 :$000008C0 recv(Socket)
06-10-23 20:45:57.750 Debug :$000008C0 recv data 36 bytes
06-10-23 20:45:57.750 Debug :$000008C0 ProcessMessage( type: 3, size: 36 )
06-10-23 20:45:57.750 Info :$000008C0 Client 172.16.10.92 request ReadFile($000001D8, buf, 61440)
06-10-23 20:45:57.750 Info :$000008D4 ReadFile: [操作成功完成。]
////////请求关闭已打开的文件句柄
06-10-23 20:45:57.765 Debug2 :$000008D4 RcvData
06-10-23 20:45:57.765 Debug2 :$000008D4 RcvLen:20
06-10-23 20:45:57.765 Debug2 :$000008D4 recv(Socket)
06-10-23 20:45:57.765 Debug :$000008D4 recv data 20 bytes
06-10-23 20:45:57.765 Debug :$000008D4 ProcessMessage( type: 8, size: 20 )
06-10-23 20:45:57.765 Info :$000008D4 Client 172.16.10.91 request CloseHandle($000001E0)
06-10-23 20:45:57.765 Info :$000008D4 CloseHandle: [操作成功完成。]
06-10-23 20:45:57.765 Debug2 :$000008D4 RcvData
06-10-23 20:45:57.765 Debug :$000008D4 connection has been closed
06-10-23 20:45:57.765 Info :$000008D4 stop work
06-10-23 20:45:57.765 Info :$000008C0 ReadFile: [操作成功完成。]
[red]06-10-23 20:45:57.765 Error :$000008C0 TNetFileProc.Execute: Invalid pointer operation[/red]
06-10-23 20:45:57.765 Info :SvcNetFile NetFileProcIdle($000008D4)
06-10-23 20:45:57.765 Info :$000008C0 CloseHandle($000001D8)
06-10-23 20:45:57.765 Info :$000008C0 Thread Finish
06-10-23 20:45:57.765 Warning :SvcNetFile Destroy Invalid FileProcObj($000008C0)
//////接受新的客户端请求 172.16.10.85
06-10-23 20:45:57.890 Info :SvcNetFile accept($000008B0)
//////请求打开文件
06-10-23 20:45:57.890 Debug2 :$000008B0 RcvData
06-10-23 20:45:57.890 Debug2 :$000008B0 RcvLen:420
06-10-23 20:45:57.890 Debug2 :$000008B0 recv(Socket)
06-10-23 20:45:57.890 Debug :$000008B0 recv data 420 bytes
06-10-23 20:45:57.890 Debug :$000008B0 ProcessMessage( type: 2, size: 420 )
06-10-23 20:45:57.890 Info :$000008B0 Client 172.16.10.85 request OpenFile('J:/DvsVoice/20061023/19/1935282816663.voc')
06-10-23 20:45:57.890 Info :$000008B0 OpenFile: [操作成功完成。]
//////请求设置文件指针
06-10-23 20:45:57.906 Debug2 :$000008B0 RcvData
06-10-23 20:45:57.906 Debug2 :$000008B0 RcvLen:36
06-10-23 20:45:57.906 Debug2 :$000008B0 recv(Socket)
06-10-23 20:45:57.906 Debug :$000008B0 recv data 36 bytes
06-10-23 20:45:57.906 Debug :$000008B0 ProcessMessage( type: 5, size: 36 )
06-10-23 20:45:57.906 Info :$000008B0 Client 172.16.10.85 request SetFilePointer($000001A8, 307200, 0, 0)
06-10-23 20:45:57.906 Info :$000008B0 SetFilePointer: [操作成功完成。]
///////请求读取文件
06-10-23 20:45:57.906 Debug2 :$000008B0 RcvData
06-10-23 20:45:57.906 Debug2 :$000008B0 RcvLen:36
06-10-23 20:45:57.906 Debug2 :$000008B0 recv(Socket)
06-10-23 20:45:57.906 Debug :$000008B0 recv data 36 bytes
06-10-23 20:45:57.906 Debug :$000008B0 ProcessMessage( type: 3, size: 36 )
06-10-23 20:45:57.906 Info :$000008B0 Client 172.16.10.85 request ReadFile($000001A8, buf, 61440)
06-10-23 20:45:57.906 Info :$000008B0 ReadFile: [操作成功完成。]
///////请求关闭句柄
06-10-23 20:45:57.921 Debug2 :$000008B0 RcvData
06-10-23 20:45:57.921 Debug2 :$000008B0 RcvLen:20
06-10-23 20:45:57.921 Debug2 :$000008B0 recv(Socket)
06-10-23 20:45:57.921 Debug :$000008B0 recv data 20 bytes
06-10-23 20:45:57.921 Debug :$000008B0 ProcessMessage( type: 8, size: 20 )
06-10-23 20:45:57.921 Info :$000008B0 Client 172.16.10.85 request CloseHandle($000001A8)
06-10-23 20:45:57.921 Info :$000008B0 CloseHandle: [操作成功完成。]
///////
06-10-23 20:45:57.921 Debug2 :$000008B0 RcvData
06-10-23 20:45:57.921 Debug :$000008B0 connection has been closed
06-10-23 20:45:57.921 Info :$000008B0 stop work
06-10-23 20:45:57.921 Info :SvcNetFile NetFileProcIdle($000008B0)
///////接受新的客户端 172.16.10.91
谢谢两位!以上是该程序的一些日志及分析,不知能否从中看到点什么?
 
如果是自己的操作导致的内存错误可以通过下面的方法定位造成错误的源码
前提是用delphi
在可执行文件或dll和代码完全匹配的情况下
将程序在任何位置设置断点,并走到该断点使程序停下来
然后打开菜单search-find error
输入出错地址即可定位出错源码
如果不能定位则说明出错的是windows底层的代码 或者是由于内存的非法操作导致了指针混乱
 
程序本身是可以正常运行的,所拷贝到的本地的文件同服务器上的是一样的,而且大多时候都没什么问题,主要是客户端访问量一大,程序会自动退出。
 
主要是客户端访问量一大,程序会自动退出。
就应该是服务器资源不足造成的!
 
如果说用一个工作线程队列,队列中的每个对象又对应一个线程,线程的工作是接受客户端发来的消息,并根据消息类型进行相应处理,怎样才能保证线程的安全?目前的问题可能就在于此,单个客户端在连接到此文件传输服务程序进行文件操作拷贝并不会产生什么大的问题,多个客户端的话也是可以的,但会使程序自动退出。
 
后退
顶部