The built-in memcpy uses unaligned reads/writes and this crashes my ARM-A5 processor.

Bug #1669879 reported by Roger W. Cover
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain
Invalid
Undecided
Unassigned

Bug Description

I am using an Atmel SAMA5D35 processor. It is an ARM Cortex-A5. The unaligned reads and writes inserted by the compiler for memcpy() calls are not supported by this processor. The processor experiences a memory access fault as a result.
I have worked around the problem by using the -fno-builtin-memcpy argument on the command line. I wanted to report the problem so it can be fixed, however.

Revision history for this message
Prakhar Bahuguna (prakhar-deactivatedaccount) wrote :

Hi Roger, can I confirm if you're compiling with the -mno-unaligned-access flag? By default GCC only disallows unaligned memory accesses for pre-ARMv6, all ARMv6-M and for ARMv8-M Baseline architectures, so in the case of your Cortex-A5 it may generate unaligned accesses unless you explicitly disable it.

If the issue persists even with the -mno-unaligned-access flag being specified, we will look into this.

Revision history for this message
Roger W. Cover (rwcover) wrote : RE: [Bug 1669879] Re: The built-in memcpy uses unaligned reads/writes and this crashes my ARM-A5 processor.

Greetings,

I was not using the -mno-unaligned- access flag. That flag also prevents the compiler from generating the incorrect inline code.

I was not aware the -mno-unaligned- access flag existed. Sorry for the trouble. I will be using this flag from now on.

Regards,
Roger
-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Prakhar Bahuguna
Sent: Monday, March 06, 2017 2:32 AM
To: Roger Cover
Subject: [Bug 1669879] Re: The built-in memcpy uses unaligned reads/writes and this crashes my ARM-A5 processor.

Hi Roger, can I confirm if you're compiling with the -mno-unaligned- access flag? By default GCC only disallows unaligned memory accesses for pre-ARMv6, all ARMv6-M and for ARMv8-M Baseline architectures, so in the case of your Cortex-A5 it may generate unaligned accesses unless you explicitly disable it.

If the issue persists even with the -mno-unaligned-access flag being specified, we will look into this.

--
You received this bug notification because you are subscribed to the bug report.
https://bugs.launchpad.net/bugs/1669879

Title:
  The built-in memcpy uses unaligned reads/writes and this crashes my
  ARM-A5 processor.

Status in GNU ARM Embedded Toolchain:
  New

Bug description:
  I am using an Atmel SAMA5D35 processor. It is an ARM Cortex-A5. The unaligned reads and writes inserted by the compiler for memcpy() calls are not supported by this processor. The processor experiences a memory access fault as a result.
  I have worked around the problem by using the -fno-builtin-memcpy argument on the command line. I wanted to report the problem so it can be fixed, however.

To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc-arm-embedded/+bug/1669879/+subscriptions

--
BEGIN-ANTISPAM-VOTING-LINKS
------------------------------------------------------

Teach Security Manager | Anti-spam if this mail (ID 0bSQxF58J) is spam:
Spam: https://antispam.roaringpenguin.com/canit/b.php?c=s&i=0bSQxF58J&m=e315a78642bf&rlm=specinst-com&t=20170306
Not spam: https://antispam.roaringpenguin.com/canit/b.php?c=n&i=0bSQxF58J&m=e315a78642bf&rlm=specinst-com&t=20170306
Forget vote: https://antispam.roaringpenguin.com/canit/b.php?c=f&i=0bSQxF58J&m=e315a78642bf&rlm=specinst-com&t=20170306
------------------------------------------------------
END-ANTISPAM-VOTING-LINKS

Changed in gcc-arm-embedded:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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