Bug 139991 - "unaligned access" message is output
Summary: "unaligned access" message is output
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel
Version: 4.0
Hardware: ia64
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Dave Jones
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-11-19 05:48 UTC by L3support
Modified: 2015-01-04 22:12 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-01-24 18:25:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description L3support 2004-11-19 05:48:45 UTC
Description of problem:
"unaligned access to xxxx" message is output to stderr 
when the program has alignment error.
(The program is normally working.)
Is it new specification of gcc?

But there is no information to investigate the problem. 
So, I cannot find out the problem part in the program.
The error message is output to syslog too. Syslog will be 
full of the error messages. It would be also a problem.
I need to stop this error messages. How can I do for this?
How can I investigate this error?

Version-Release number of selected component (if applicable):
gcc-3.4.1-10.ia64.rpm

How reproducible:
always

Steps to Reproduce:
1. execute following sample program

#include <stdlib.h>
#include <stdio.h>

void main()
{
        char *p = malloc(100);
        int  *i = p+1;
        *i = 0;
        printf("malloc = %p\n", p);
}

Actual results:
following error is output
c(6714): unaligned access to 0x6000000000004011, ip=0x40000000000007d1
malloc = 0x6000000000004010

Expected results:
no error message would be output

Additional info:
none

Comment 1 Jakub Jelinek 2004-11-19 06:18:34 UTC
It is not emitted to stderr, rather kernel is writing that message.
It has nothing to do with gcc.

Comment 3 RHEL4-L3support 2005-01-19 02:08:04 UTC
Add RHEL4-L3support team in Japan

Comment 6 Jakub Jelinek 2005-01-24 09:03:19 UTC
My understanding was that the complaint was that unaligned messages shouldn't
be printed by default (which is a kernel decision), but I could be wrong.
Anyway, the "But there is no information to investigate the problem."
claim is wrong.  There is enough information in the message to investigate it:
c(6714): unaligned access to 0x6000000000004011, ip=0x40000000000007d1
^ program name                                   ^ instruction where the error
was found
  ^ pid                      ^ misaligned access it was accessing

Comment 8 JoAnne K. Halligan 2005-01-24 18:25:52 UTC
This issue is closed a 'not a bug'. Please see the following comments. If this
is not correct, or there is something else missing in our understanding please
reopen the bug report and provide any additional needed information or comments.

The case reported here in the above code seems to indicate a programming problem
if we understand the message correctly. 

The code creates a character pointer, then manipulates it as an integer pointer.
 This would seem to end up accessing that char pointer on an unaligned boundary.
 When the integer types "i" was changed "int" to "char *" the resolved the issue. 

In other words, the kernel is merely complaining that the code is question is
forcing an off-boundary memory access, and therefore the code in question should
be cleaned up.

As for the "But there is no information to investigate the problem" claim, there
is enough information in the message to investigate it:

c(6714): unaligned access to 0x6000000000004011, ip=0x40000000000007d1
^ program name                                   ^ instruction where the error
was found  
  ^ pid                      ^ misaligned access it was accessing




Note You need to log in before you can comment on or make changes to this bug.