public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/606] New: profiling causes segfault in gmon mcount on ARM
@ 2004-12-10 20:51 opensource at artnaseef dot com
  2004-12-10 20:53 ` [Bug libc/606] " opensource at artnaseef dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: opensource at artnaseef dot com @ 2004-12-10 20:51 UTC (permalink / raw)
  To: glibc-bugs

The gmon support for ARM often causes the profiled program to segfault in 
_monstartup() due to the allocation memory and setting of pointers; some times 
the p->froms pointer is assigned at an offset of 2 from a 4-byte boundary.

Due to the ARM CPU's odd handling of mis-aligned words, this leads to a 
segmentation fault.

The ARM CPU (at least in Little Endian Mode) handles mis-aligned accesses 
(offset 2 from a word boundary) by adjusting the address back to the immediately 
previous 4-byte boundary and swapping the low and high 2-byte words.

-- 
           Summary: profiling causes segfault in gmon mcount on ARM
           Product: glibc
           Version: 2.3.2
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: gotom at debian dot or dot jp
        ReportedBy: opensource at artnaseef dot com
                CC: glibc-bugs at sources dot redhat dot com,opensource at
                    artnaseef dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: arm-linux
GCC target triplet: arm-linux


http://sources.redhat.com/bugzilla/show_bug.cgi?id=606

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/606] profiling causes segfault in gmon mcount on ARM
  2004-12-10 20:51 [Bug libc/606] New: profiling causes segfault in gmon mcount on ARM opensource at artnaseef dot com
@ 2004-12-10 20:53 ` opensource at artnaseef dot com
  2004-12-15 12:24 ` gotom at debian dot or dot jp
  2005-10-10 14:53 ` drow at sources dot redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: opensource at artnaseef dot com @ 2004-12-10 20:53 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From opensource at artnaseef dot com  2004-12-10 20:53 -------
Created an attachment (id=308)
 --> (http://sources.redhat.com/bugzilla/attachment.cgi?id=308&action=view)
suggested fix

This patch fixes the problem, for the ARM architecture only, by adding an
alignment preprocessor macro that can be defined for a specific architecture,
and aligning the pointer assignments in _monstartup() based on this macro.

It also sets the alignment for the ARM architecture to 4 bytes.


-- 


http://sources.redhat.com/bugzilla/show_bug.cgi?id=606

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/606] profiling causes segfault in gmon mcount on ARM
  2004-12-10 20:51 [Bug libc/606] New: profiling causes segfault in gmon mcount on ARM opensource at artnaseef dot com
  2004-12-10 20:53 ` [Bug libc/606] " opensource at artnaseef dot com
@ 2004-12-15 12:24 ` gotom at debian dot or dot jp
  2005-10-10 14:53 ` drow at sources dot redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: gotom at debian dot or dot jp @ 2004-12-15 12:24 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From gotom at debian dot or dot jp  2004-12-15 12:24 -------
Your suggested patch adds padding space for the start point of
p->kcount and p->froms.  This means p->tossize or p->kcountsize may            
                       
have unaligned size.  However, p->kcountsize is multiplied by
sizeof(*p->froms) and p->tossize is also multiplied by sizeof(struct           
                       
tostruct).  I think they should be 4-bytes aligned, but isn't it true
on your system?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING


http://sources.redhat.com/bugzilla/show_bug.cgi?id=606

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/606] profiling causes segfault in gmon mcount on ARM
  2004-12-10 20:51 [Bug libc/606] New: profiling causes segfault in gmon mcount on ARM opensource at artnaseef dot com
  2004-12-10 20:53 ` [Bug libc/606] " opensource at artnaseef dot com
  2004-12-15 12:24 ` gotom at debian dot or dot jp
@ 2005-10-10 14:53 ` drow at sources dot redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: drow at sources dot redhat dot com @ 2005-10-10 14:53 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drow at sources dot redhat dot com  2005-10-10 14:53 -------
This should be fixed by:

2003-11-15  Randolph Chung  <tausq@debian.org>

        * gmon/gmon.c (__monstartup): Round kcountsize to multiples of
        the froms[] array so the array is properly aligned.

This was not in 2.3.2.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=606

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-10-10 14:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-10 20:51 [Bug libc/606] New: profiling causes segfault in gmon mcount on ARM opensource at artnaseef dot com
2004-12-10 20:53 ` [Bug libc/606] " opensource at artnaseef dot com
2004-12-15 12:24 ` gotom at debian dot or dot jp
2005-10-10 14:53 ` drow at sources dot redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).