2009-12-09 19:06:32 |
Dave Martin |
bug |
|
|
added bug |
2009-12-10 14:44:57 |
Dave Martin |
description |
Binary package hint: squashfs-tools
mksquashfs.c currently accesses the following structures through misaligned pointers: at least the following:
squashfs_base_inode_header *
squashfs_dir_entry *
squashfs_dir_header *
squashfs_dir_inode_header *
squashfs_ldir_inode_header *
squashfs_reg_inode_header *
squashfs_symlink_inode_header *
unsigned short *
I haven't checked the rest of this package, but there are likely to be issues elsewhere as well.
Not all memory access instructions can access at unaligned addresses on ARM; GCC assumes that pointers are properly aligned for their type because attempts by a C program to access an lvalue via a pointer which is not properly aligned for the lvalue's type are not permitted under strict interpretation of the C language specification.
Particularly when doing block transfers of whole structures (*obj_p_dest = *obj_p_src) and equivalent operations, LDM or STM instructions are emitted by the compiler: these _always_ fault into the kernel if the base address is unaligned, and can cause a significant performance hit.
In addition, prior to Linux 2.6.31, the kernel cannot successfully emulate all misaligned LDM or STM instructions for Thumb ... leading to the SIGILLs which have been observed on the lucid buildds (2.6.28 kernel) when moving to v7.
Possible workarounds:
* fix squashfs-tools to use strict C only (laborious... either build squashfs filesystem structures at true alignment and then copy them into place in the output, or
* declare all the affected types with __attribute__ (( __packed__ )) so GCC knows the structures may be accessed at misaligned locations (care must be taken to make sure the structures' sizes and internal arrangement do not change as a result of this, and the resulting code may run significantly slower --- I've not checked for the implications of this. Some other check is needed for unsigned short, or it must be wrapped in a structure or union type, because GCC cannot tag basic types with the __packed__ attribute)
* apply the appropriate LDM/STM emulation patches to the kernel used on the buildds (if feasible --- I'll try and feed back on this) |
Binary package hint: squashfs-tools
mksquashfs.c currently accesses the following structures through misaligned pointers: at least the following:
squashfs_base_inode_header *
squashfs_dir_entry *
squashfs_dir_header *
squashfs_dir_inode_header *
squashfs_ldir_inode_header *
squashfs_reg_inode_header *
squashfs_symlink_inode_header *
unsigned short *
I haven't checked the rest of this package, but there are likely to be issues elsewhere as well.
Not all memory access instructions can access at unaligned addresses on ARM; GCC assumes that pointers are properly aligned for their type because attempts by a C program to access an lvalue via a pointer which is not properly aligned for the lvalue's type are not permitted under strict interpretation of the C language specification.
Particularly when doing block transfers of whole structures (*obj_p_dest = *obj_p_src) and equivalent operations, LDM or STM instructions are emitted by the compiler: these _always_ fault into the kernel if the base address is unaligned, and can cause a significant performance hit.
In addition, prior to Linux 2.6.31, the kernel cannot successfully emulate all misaligned LDM or STM instructions for Thumb ... leading to the SIGILLs which have been observed on the lucid buildds (2.6.28 kernel) when moving to v7.
Possible workarounds:
* Build squashfs-tools with -marm
* fix squashfs-tools to use strict C only (laborious... either build squashfs filesystem structures at true alignment and then copy them into place in the output, or
* declare all the affected types with __attribute__ (( __packed__ )) so GCC knows the structures may be accessed at misaligned locations (care must be taken to make sure the structures' sizes and internal arrangement do not change as a result of this, and the resulting code may run significantly slower --- I've not checked for the implications of this. Some other check is needed for unsigned short, or it must be wrapped in a structure or union type, because GCC cannot tag basic types with the __packed__ attribute)
* apply the appropriate LDM/STM emulation patches to the kernel used on the buildds (if feasible --- I'll try and feed back on this)
|
|
2009-12-10 15:01:23 |
Alexander Sack |
squashfs (Ubuntu): importance |
Undecided |
Critical |
|
2009-12-10 15:01:23 |
Alexander Sack |
squashfs (Ubuntu): status |
New |
Triaged |
|
2009-12-10 15:01:23 |
Alexander Sack |
squashfs (Ubuntu): milestone |
|
lucid-alpha-2 |
|
2009-12-10 15:01:23 |
Alexander Sack |
squashfs (Ubuntu): assignee |
|
David Sugar (dyfet) |
|
2009-12-10 15:01:48 |
Alexander Sack |
nominated for series |
|
Ubuntu Lucid |
|
2009-12-10 15:01:48 |
Alexander Sack |
bug task added |
|
squashfs (Ubuntu Lucid) |
|
2009-12-11 20:37:22 |
David Sugar |
attachment added |
|
debdiff from 0.4-3 to 0.4-3ubuntu1 http://launchpadlibrarian.net/36702904/squashfs.debdiff.gz |
|
2009-12-11 23:45:10 |
Launchpad Janitor |
squashfs (Ubuntu Lucid): status |
Triaged |
Fix Released |
|
2009-12-14 01:46:11 |
Michael Casadevall |
squashfs (Ubuntu Lucid): status |
Fix Released |
In Progress |
|
2009-12-14 09:41:11 |
Daniel Holbach |
removed subscriber Ubuntu Core Development Team |
|
|
|
2009-12-14 10:30:44 |
Loïc Minier |
removed subscriber Ubuntu Sponsors for main |
|
|
|
2009-12-17 14:07:22 |
Emmet Hikory |
bug task added |
|
squashfs-tools (Ubuntu) |
|
2009-12-17 14:10:50 |
Emmet Hikory |
attachment added |
|
squashfs-tools_4.0-6ubuntu1.debdiff http://launchpadlibrarian.net/36906760/squashfs-tools_4.0-6ubuntu1.debdiff |
|
2009-12-17 14:11:31 |
Emmet Hikory |
squashfs-tools (Ubuntu Lucid): status |
New |
Triaged |
|
2009-12-17 14:11:32 |
Emmet Hikory |
squashfs-tools (Ubuntu Lucid): importance |
Undecided |
Critical |
|
2009-12-17 14:11:36 |
Emmet Hikory |
squashfs-tools (Ubuntu Lucid): assignee |
|
Emmet Hikory (persia) |
|
2009-12-17 14:11:46 |
Emmet Hikory |
squashfs-tools (Ubuntu Lucid): milestone |
|
lucid-alpha-2 |
|
2009-12-17 14:25:08 |
Launchpad Janitor |
squashfs-tools (Ubuntu Lucid): status |
Triaged |
Fix Released |
|
2009-12-17 14:30:19 |
Alexander Sack |
squashfs (Ubuntu Lucid): status |
In Progress |
Fix Released |
|
2009-12-18 06:57:13 |
Launchpad Janitor |
branch linked |
|
lp:ubuntu/squashfs-tools |
|
2009-12-18 08:55:26 |
Launchpad Janitor |
branch linked |
|
lp:ubuntu/squashfs |
|
2011-02-17 08:08:14 |
Daniel Holbach |
bug |
|
|
added subscriber Ubuntu Sponsors Team |
2011-02-17 08:08:20 |
Daniel Holbach |
removed subscriber [DEPRECATED] Ubuntu Sponsors for main |
|
|
|
2011-02-21 23:28:04 |
Benjamin Drung |
removed subscriber Ubuntu Sponsors Team |
|
|
|