This is the mail archive of the ecos-bugs@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug 1000672] New: redboot fconfig crash with gcc 4.3.2


http://bugs.ecos.sourceware.org/show_bug.cgi?id=1000672

           Summary: redboot fconfig crash with gcc 4.3.2
           Product: eCos
           Version: CVS
          Platform: ixdp425 (Intel XScale IXDP425 board)
        OS/Version: ARM
            Status: UNCONFIRMED
          Severity: critical
          Priority: high
         Component: RedBoot
        AssignedTo: gary@mlbassoc.com
        ReportedBy: jvasco@verizon.net
         QAContact: ecos-bugs@ecos.sourceware.org
             Class: ---


Redboot gets an exception when trying to set any IP address with fconfig
when using gcc-4.3.2 on an ixp425 target (armeb). The issue seems to be
an alignment problem as val_ptr contains an odd address; it looks like gcc
is optimizing and trying to do a copy on a word boundary. The removal of
the cast fixes the problem.

This doesn't look like a compiler bug to me. I suspect that this problem
affects other arm variants but I only have access to an ixp425. The code
is incorrect as val_ptr is pointing to a place in a configuration buffer for
the raw data. Imposing (via a cast) a structure is not the right solution.
Note that a few lines down in the source, the memcpy in the other direction
does not have such a cast.

--- fconfig.c 2009-01-18 14:34:11.000000000 -0500
+++ fconfig.c.new 2009-01-18 14:35:22.000000000 -0500
@@ -388,7 +388,7 @@
break;
#ifdef CYGPKG_REDBOOT_NETWORKING
case CONFIG_IP:
- memcpy(&hold_ip_val.s_addr, &((in_addr_t *)val_ptr)->s_addr,
sizeof(in_addr_t));
+        memcpy(&hold_ip_val.s_addr, val_ptr, sizeof(in_addr_t));
       if (!_gethostbyname(line, &new_ip_val)) {
           return CONFIG_BAD;
       }


-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]