From: Todd Z. <tm...@po...> - 2007-05-24 19:35:09
|
Hi, I tried to use the test-photos program to play with the photos on my iPod and ran into a segfault with the current libgpod from CVS. Here is some output from gdb: $ gdb .libs/test-photos=20 GNU gdb Red Hat Linux (6.5-15.fc6rh) Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain condition= s. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_d= b library "/lib/libthread_db.so.1". (gdb) run list /media/IPOD Starting program: /tmp/libgpod/tests/.libs/test-photos list /media/IPOD ** (process:15364): CRITICAL **: db_get_itunesdb: assertion `db->db_type = =3D=3D DB_TYPE_ITUNES' failed Program received signal SIGSEGV, Segmentation fault. 0x04d3c2d5 in itdb_time_mac_to_time_t (db=3D0x0, mactime=3D1844674407267388= 4708) at itdb_itunesdb.c:6289 6289 if (mactime !=3D 0) return (time_t)(mactime - 2082844800 - db-= >device->timezone_shift); (gdb) bt #0 0x04d3c2d5 in itdb_time_mac_to_time_t (db=3D0x0, mactime=3D184467440726= 73884708) at itdb_itunesdb.c:6289 #1 0x04d4d05b in parse_mhii (ctx=3D0x8126a58, error=3D0x0) at db-artwork-p= arser.c:283 #2 0x04d4bf6b in parse_mhl (ctx=3D0x8126a38, error=3D<value optimized out>= , id=3D<value optimized out>, parse_child=3D0x4d4cd80 <parse_mhii>) at db-artwork-parser.c:413 #3 0x04d4c179 in parse_mhsd (ctx=3D0x8126a18, error=3D<value optimized out= >) at db-artwork-parser.c:449 #4 0x04d4c330 in parse_mhfd (ctx=3D0x8126b28, error=3D<value optimized out= >) at db-artwork-parser.c:498 #5 0x04d4c47a in ipod_parse_photo_db (photodb=3D0x8126928) at db-artwork-p= arser.c:733 #6 0x04d4aa8f in itdb_photodb_parse (mp=3D0xbfc8083c "/media/IPOD", error= =3D0xbfc7ea54) at itdb_photoalbum.c:226 #7 0x08048d9e in main (argc=3D3, argv=3D0xbfc7eb04) at test-photos.c:179 This doesn't happen with 0.4.2. It looks like it's due to the time changes made a few weeks ago. In parse_mhii, itdb seems to be null. It's probably a simple fix, but I don't know quite what that is. :) --=20 Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If the triangles were to make a God they would give him three sides. -- Montesquieu |
From: Jorg S. <Jor...@gm...> - 2007-05-27 15:03:12
Attachments:
diff.diff
|
Todd Zullinger wrote: > Hi, > > I tried to use the test-photos program to play with the photos on my > iPod and ran into a segfault with the current libgpod from CVS. Yep, easy to reproduce. You are right: the problem came from the changes done a few weeks ago. In more detail: itdb_time_mac_to_time_t() is called for each timestamp. The first argument of this function is a pointer to an iTunesDB which doesn't exist in the case of a photo database. I believe Christophe already pointed out that he believes that using a pointer to a Device structure would be better but I discarded this proposal for reasons of simplicity since the current way seemed to work. Well, it didn't work and Christophe's idea was right -- patch is in CVS and attached. I checked reading and writing of iTunesDBs and listing of PhotoDBs. Cheers, JCS. |
From: Todd Z. <tm...@po...> - 2007-05-27 16:04:53
|
Hi Jorg, Jorg Schuler wrote: > Yep, easy to reproduce. You are right: the problem came from the > changes done a few weeks ago. In more detail: > itdb_time_mac_to_time_t() is called for each timestamp. The first > argument of this function is a pointer to an iTunesDB which doesn't > exist in the case of a photo database. >=20 > I believe Christophe already pointed out that he believes that > using a pointer to a Device structure would be better but I > discarded this proposal for reasons of simplicity since the current > way seemed to work. Well, it didn't work and Christophe's idea was > right -- patch is in CVS and attached. I checked reading and > writing of iTunesDBs and listing of PhotoDBs. Thanks! That seems to do the trick here. --=20 Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When you make a mistake, make amends immediately. It's easier to eat crow while it's still warm. |