CPU hog - sockets
From: Prashanth (Prashanth_at_discussions.microsoft.com)
Date: 08/30/04
- Next message: Tim Robinson: "Re: Interacting with Shell from Win32 Service"
- Previous message: andrew: "Re: Interacting with Shell from Win32 Service"
- Next in thread: Pat [MSFT]: "Re: CPU hog - sockets"
- Reply: Pat [MSFT]: "Re: CPU hog - sockets"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 30 Aug 2004 05:51:05 -0700
Hi,
I'm in the middle of a mess!
Problem background:
I have a Windows services (running on XP) which acts as a client to a Java
server, uses TCP/IP sockets for communication. When this service starts, it
contacts the server and initializes a session key {Using PKI key exchange:
Java server has a public/private key pair (RSA 1024 bit). Client (Windows
service) receives the public key, generates a session key(3DES-192 bit I
think), encodes it using the public key, sends it across. Now onwards, this
key is used for encrypting the messages sent over plain socket connection.
Everytime, the client initiates a connection.}.
Problem:
After exchange of several encrypted messages correctly - say after some
100-200 exchanges, the Java server throws this exception:
ERROR 2004-08-30 16:31:26,359 com.abc.server.comm.SessionManager - Session
ID:5693931
javax.crypto.IllegalBlockSizeException: Input length (with padding) not
multiple of 8 bytes
at com.xyz.crypto.provider.DESedeCipher.a(Unknown Source)
at com.xyz.crypto.provider.DESedeCipher.engineDoFinal(Unknown Source)
at com.xyz.crypto.provider.DESedeCipher.engineDoFinal(Unknown Source)
at javax.crypto.Cipher.doFinal(Unknown Source)
at com.abc.server.comm.SessionManager.encrypt(SessionManager.java:143)
at com.abc.server.comm.Command.sendReply(Command.java:124)
at
com.abc.server.comm.server.CommandDispatcher$1.run(CommandDispatcher.java:82)
at
com.abc.server.threadpool.ThreadPoolInstance$PoolThread.run(ThreadPoolInstance.java:139)
After this, the client (windows service) hogs the CPU. Using process
explorer v7.01(sysinternals.com), I found that the thread trying to RECV
something through socket is going into this hogging, but as I am not an
expert in debugging, I couldnot pinpoint the place where this is happening.
Is there anyway to know using the debugger exctly what code is being run
during this hog? I could not map the thread I found out hogging the CPU using
process explorer to the threads I could list during debugging (WinDbg) as the
thread identifiers did not match. Moreover, when ever I start debugging with
WinDbg, the thread with main() is always the one to get a debug break (int
3). How can I identify and switch to the hogging thread, as the process
itself is waiting on debug break and the CPU is no more hogged once the
debugging starts?
I know this can be rated as a 'stupid' question, but please help me with this.
- Next message: Tim Robinson: "Re: Interacting with Shell from Win32 Service"
- Previous message: andrew: "Re: Interacting with Shell from Win32 Service"
- Next in thread: Pat [MSFT]: "Re: CPU hog - sockets"
- Reply: Pat [MSFT]: "Re: CPU hog - sockets"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|