Shotwell crashes when importing due to UTF-8 representation difference
Submitted by Jim Nelson
Assigned to Jim Nelson
Link to original bug (#716846)
Description
---- Reported by jim@yorba.org 2010-09-14 13:23:00 -0700 ----
Original Redmine bug id: 2560
Original URL: http://redmine.yorba.org/issues/2560
Searchable id: yorba-bug-2560
Original author: Jim Nelson
Original description:
Reported at Launchpad: https://bugs.launchpad.net/ubuntu/source/shotwell/bug/638065
---- Additional Comments From shotwell-maint@gnome.bugs 2013-05-01 11:40:00 -0700 ----
History
Comment 1
Updated by Jim Nelson about 3 years ago
- Status changed from Open to Review
- Assignee changed from Anonymous to Jim Nelson
The original reporter sent me two files which allowed me to reproduce the problem. Both photos have the IPTC keyword “Fru?chte des Zornsâ€. However, each has a different UTF-8 representation for the umlauted 'u'. str_equal() and str_hash() treat these as separate strings, but the UTF-8 collate function (which is used to maintain a sorted list of tags per photo) treats them as the same. This triggers an assertion which is guarding against a double-add.
I want to think about this some more before committing a patch.
Comment 2
Updated by Adam Dingle about 3 years ago
Wow, this is subtle – good catch!
Comment 3
Updated by Adam Dingle about 3 years ago
- Subject changed from Shotwell crashes when importing to Shotwell crashes when importing due to UTF-8 representation difference
Comment 4
Updated by Marcel Stimberg about 3 years ago
That's a similar issue to the failing tag autocompletion: http://trac.yorba.org/ticket/2612
Before any comparison, all strings should be normalized with the normalize function of the string class.
Comment 5
Updated by Jim Nelson almost 3 years ago
- Status changed from Review to 5
- Resolution set to fixed
- % Done changed from 0 to 100
I've committed a fix for this bug. However, this patch does not solve the problem if the user has two current tags that are different bitwise but identical after normalization. In other words, this solves the problem of crashing at import time, but not crashing after an import failure. I've done a little investigation and that would require a bit more work.
I'm closing this ticket since not many users have reported this and I don't think anyone is waiting with a bogus database for a fix. If this is not so, we should open a separate ticket to address that problem.
r2405
Comment 6
Updated by Charles Lindsay 7 months ago
- Status changed from 5 to Fixed
--- Bug imported by chaz@yorba.org 2013-11-25 21:47 UTC ---
This bug was previously known as bug 2560 at http://redmine.yorba.org/show_bug.cgi?id=2560
Unknown Component Using default product and component set in Parameters Unknown version " in product shotwell. Setting version to "!unspecified". Unknown milestone "unknown in product shotwell. Setting to default milestone for this product, "---". Setting qa contact to the default for this product. This bug either had no qa contact or an invalid one.
Resolution: RESOLVED FIXED