Created attachment 160630 [details] Updated patch to fix breakage on platforms with a 64 bit time_t Hello, r391392 / PR 200053 added a patch to mail/sylpheed which fixes SIGBUS errors on ARM. That patch is wrong, it leads to data corruption on platforms where time_t is 64 bit long: - The macro in procmsg.c:194 is called to read the date header of a message: READ_CACHE_DATA_INT(msginfo->date_t); - msginfo->date_t is a time_t. - When time_t is 32 bit long everything's okay. But when it's a 64 bit value, the memcpy() copies only 32 bit from p to n aka msginfo->date_t aka time_t leaving the upper or (on big endian) lower 32 bits undefined. Attached is an updated patch developed by Christoph Mallon <christoph.mallon@gmx.de> that solves this issue.
Created attachment 160633 [details] fix Hi, You are right, the patch I submitted is wrong, I was going to submit the attached patch (tested on amd64 and arm by Ulrich Grey and me). Sorry for the breakage. Mikaël
Im afraid that your new patch is still wrong. 'n' is 64 bit long and uninitialized, therefore filled with garbage. You copy 32 bits into it. So 32 bits are defined and the other 32 bits are still garbage. Christophs patch avoids this by an implicit type conversion. The 32 bit value is expanded to 64 bit and assigned. The expansion fills the unused 32 bit with zeros, resulting in a fully defined value.
I got it now, thanks for your explanation!
A commit references this bug: Author: ehaupt Date: Thu Sep 3 12:14:27 UTC 2015 New revision: 395948 URL: https://svnweb.freebsd.org/changeset/ports/395948 Log: Updated patch to fix breakage on platforms with a 64 bit time_t. This fixes a regression that was introduced with r391392. PR: 202832 Submitted by: yamagi@yamagi.org Changes: head/mail/sylpheed/Makefile head/mail/sylpheed/files/extra-patch-libsylph_ssl.c head/mail/sylpheed/files/patch-libsylph-defs.h head/mail/sylpheed/files/patch-libsylph_procmsg.c head/mail/sylpheed/files/patch-src-printing.c
Committed, thanks!