Bug#360385: Acknowledgement (hplip: Open device failed with URI hp:/usb/Deskjet...)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#360385: Acknowledgement (hplip: Open device failed with URI hp:/usb/Deskjet...)

Laurent Aguerreche
Hello,


to prove that the problem comes from the test in file
hplip-0.9.9/io/hpiod/device.cpp at line 919, I commented the code:


 /* Make sure uri model still matches device id model. */
 pSys->GetURIModel(URI, uriModel, sizeof(uriModel));
 pSys->GetModel(ID, model, sizeof(model));
 //    if (strcmp(uriModel, model) != 0)
 //    {
 //       *result = R_INVALID_DEVICE_NODE;  /* found different device
plugged in */  
 //       syslog(LOG_ERR, "invalid model %s != %s Device::Open %s %d\n",
uriModel, model, __FILE__, __LINE__);
 //       goto blackout;
 //    }

 blackout:
    pthread_mutex_unlock(&mutex);


and know, it works...

So, somewhere "model" is uppercased or misread but I don't know why and
where, or "model" should be lowercased...



Thanks,
Laurent.




--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Bug#360385: Case problems in device.cpp Uri matching

torsten (Bugzilla)-2
Hi Laurent, Henrique,

On Tue, Apr 04, 2006 at 12:26:21AM +0200, Laurent Aguerreche wrote:

> to prove that the problem comes from the test in file
> hplip-0.9.9/io/hpiod/device.cpp at line 919, I commented the code:
>
> [...]
>
>  blackout:
>     pthread_mutex_unlock(&mutex);
>
>
> and know, it works...
>
> So, somewhere "model" is uppercased or misread but I don't know why and
> where, or "model" should be lowercased...
 
I upgraded hplip yesterday and could not print anymore today. I found
the following line in my logs:

Apr  4 11:49:11 pulsar hpiod: invalid model DeskJet_990C != DESKJET_990C
Device::Open io/hpiod/device.cpp 919


This looked quite like this bug report so I tried to validate that
assumption by using strcasecmp instead of strcmp in Device::Open. That
did not help though, the new problem was a bit less informational:

Apr  4 12:11:20 pulsar hpiod: unable to Device::Open
hp:/usb/DESKJET_990C?serial=ES08P1C14YLG io/hpiod/device.cpp 870

For that reason I instrumented some of that code (after giving up using
gdb) which turned out the problem was in this line of Device::IsUri:

     if (strcmp(uriModel, gen) != 0)

It showed that uriModel was uppercase and gen (received from the
printer) was mixed case. The uppercase version in fact seemed to come
from my printers.conf of cups, so I changed it to the same mixed case of

  DeviceURI hp:/usb/DeskJet_990C?serial=ES08P1C14YLG

After that change it works again, even with the hplip in the
distribution.



I have to add that I did not specify the name of the printer at any
time. It was auto detected during installation back then so I assume
that this will break for many people during upgrade. When time permits
I'll install an older version again on a test system and check if an
upgrade reproduces this problem.

Greetings

        Torsten



signature.asc (196 bytes) Download Attachment