HP printer and cpu at 100%

Rate this Entry
Iíll be in New York City from Thursday, I have too many things to prepare right now, and I donít have time to end this story. Anyway, I thought it might be interesting to write something about this strange behaviour. Itís only a sort of preview, I hope to complete it in the near future.

I have a new printer, itís an hp c4380. Donít know if itís good or not, I donít print too much. It was really easy to install and it works fine for me, I have nothing to complain about itÖ until some days ago when I noticed something strange. When the system starts, I sometimes happen to see the cpu at 100%:

As you can see it happens when the system starts. Itís one of the starting process for sure. I opened ProcessExplorer just to have an idea about whatís going on:

Svchost is used to load one or more services, thereís a specific list of services to load inside the registry. The problem doesnít reside in svchost process, but itís inside the specific loaded service. How to find it? ProcessExplorer is a great tool, it gives out a lot of information. Just click on the process item and you will have all the necessary information about the process. Iím interested in the command line section which is: ďC:\WINDOWS\system32\svchost.exe -k HPServiceĒ. Ok, the problem should be inside HPService. To locate the name of the dll you can browse through the process properties, youíll easily find out the dll: HPSLPSVC32.DLL

This service belongs to hp printer and itís used to check hpís peripherals connected through the net. The service is automatically started (have a look at services.msc utility). I made some tries discovering that the problem arises when one or more computers connected to the lan are offline. Iím pretty sure thereís an error inside the dll, but how to find out where the problem is located at? In case like that, when the cpu works at 100%, the problem resides inside a loop. The process is waiting for something that wonít be received; itís impossible to quit from it due to of a programming error. It could be an error on a variable initialization/update but there are many possibilities, thereís not a general explaination.

What I did is to attach a debugger to the right svchost process hinstance. Itís pretty easy to locate the guilty loop, you only have to break on dll access. Hereís a snippet taken from the loop I was talking before:
10025D00  mov    eax, dword_100AC550
10025D05  mov    ecx, [edi+4]
10025D08  push   eax ; dwMilliseconds: 1000 ms
10025D09  push   ecx ; hHandle
10025D0A  call   ebx ; WaitForSingleObject
10025D0C  mov    edx, [edi+10h]
10025D0F  push   edx ; hEvent = 0
10025D10  mov    esi, eax ; eax = WAIT_FAILED
10025D12  call   ebp ; SetEvent
10025D14  cmp    esi, WAIT_TIMEOUT
10025D1A  jnz    short loc_10025D27
10025D1C  mov    eax, [edi]
10025D1E  mov    edx, [eax+24h]
10025D21  mov    ecx, edi
10025D23  call   edx ; call sub_100255E0
10025D25  jmp    short loc_10025D00
10025D27  cmp    esi, WAIT_FAILED
10025D2A  jnz    short loc_10025D3A
10025D2C  mov    eax, dword_100AC550
10025D31  push   eax ; dwMilliseconds
10025D32  call   ds:Sleep
10025D38  jmp    short loc_10025D00
Well, as you can see from the comments there are two problems:
1. WaitForSingleObject returns WAIT_FAILED
2. SetEventís parameter is 0

I tried to call GetLastError after the two calls and the result was an ERROR_INVALID_HANDLE system error code. Pretty obvious eh!
I donít know where to look for now, an error on CreateEventís return value could be an answer. After a quick glance everything seems to be ok, but I need to check carefully.

The problem occours to many people out there. It was reported on HP forum support in March 2007, but the problem still exists. To solve (momentarily) it, itís pretty easy: just set the service from automatic to manualÖ Anyway it could be interesting to find out where the problem resides, Iíll try to check when my trip will end.

Submit "HP printer and cpu at 100%" to Digg Submit "HP printer and cpu at 100%" to Submit "HP printer and cpu at 100%" to StumbleUpon Submit "HP printer and cpu at 100%" to Google