libgphoto crashes on powerpc breezy

Bug #23829 reported by Allison Karlitskaya
10
Affects Status Importance Assigned to Milestone
libgphoto2 (Ubuntu)
Invalid
High
Martin Pitt

Bug Description

i have a normal USB ptp camera (kodak dx7630).

i was at the cottage this long weekend taking pictures so i was (attempting to)
use my laptop to download from my camera (normally use my PC).

libgphoto2 segfaults on attempting to download pictures.

this happens to the gthumb GUI (which is what g-v-m spawns by default) and also
to the gphoto2 commandline tool.

Revision history for this message
Allison Karlitskaya (desrt) wrote :

This change is responsible. Backing it out fixes the crash.

libgphoto2 (2.1.6-1ubuntu6) breezy; urgency=low

  * camlibs/ptp2/library.c: Check for duplicate filenames to circumvent bugs
    in cameras like the HP photosmart 850. (Ubuntu #12132)

 -- Martin Pitt <email address hidden> Wed, 28 Sep 2005 14:42:16 +0200

Revision history for this message
Allison Karlitskaya (desrt) wrote :

Created an attachment (id=4563)
fix

The problem is caused by the strcmp being evaluated only if the get_name
function FAILS!

gphoto functions return GP_OK on success, which is 0. the check for success
should therefore be if(!func()) instead of if(func()).

Revision history for this message
Allison Karlitskaya (desrt) wrote :

This should theoretically affect all architectures, but I think PC gets lucky by
having some lucky value stored in last_name (on powerpc for my testing, it's
0x20 which is an unlucky value indeed).

Revision history for this message
moose (kluks) wrote :

(In reply to comment #3)
> This should theoretically affect all architectures, but I think PC gets lucky by

It happens on AMD64 also. Your patch fixes the problem.

Revision history for this message
Allison Karlitskaya (desrt) wrote :

As mentioned on IRC: I'm not sure my patch does the right thing since I'm not
sure what the intended logic in the original patch was. I'm CCing in the people
who were listening on bug 18409 in hopes of getting some feedback.

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #5)
> As mentioned on IRC: I'm not sure my patch does the right thing since I'm not
> sure what the intended logic in the original patch was. I'm CCing in the people
> who were listening on bug 18409 in hopes of getting some feedback.

This patch looks good. Thank you! I will apply it as soon as Dapper opens, and
if it works, I can also upload to breezy-updates.

This bug has been marked as a duplicate of bug 18408.

Revision history for this message
Martin Pitt (pitti) wrote :

bah, I mistyped...

This bug has been marked as a duplicate of bug 18409.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Patches

Remote bug watches

Bug watches keep track of this bug in other bug trackers.