lwIP - A Lightweight TCP/IP stack - Bugs: bug #26273, etharp.c : fix alignment issue in...
You are not allowed to post comments on this tracker with your current authentication level.
bug #26273: etharp.c : fix alignment issue in etharp_raw
Submitter: | Guillaume du PONTAVICE <gdupontavice> | ||
Submitted: | Tue 21 Apr 2009 04:49:48 PM UTC | ||
Category: | ARP | Severity: | 3 - Normal |
Item Group: | Faulty Behaviour | Status: | Invalid |
Privacy: | Public | Assigned to: | goldsimon |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | CVS Head |
Jump to the original submission
Thu 23 Apr 2009 05:39:36 PM UTC, comment #16: |
Simon Goldschmidt <goldsimon> |
Thu 23 Apr 2009 12:27:28 PM UTC, comment #15: Simon, I agree with you and was a bit appalled that GCC is using memcpy to copy just a 4 byte struct. |
Bill Auerbach <billauerbach> |
Thu 23 Apr 2009 08:38:05 AM UTC, comment #14: ok guys,
|
Guillaume du PONTAVICE <gdupontavice> |
Thu 23 Apr 2009 05:46:14 AM UTC, comment #13:
|
Simon Goldschmidt <goldsimon> |
Wed 22 Apr 2009 09:24:52 PM UTC, comment #12: Whether or not the compiler chooses to do inline copying or a call to memcpy for structures is presumably a heuristic of the compiler.
|
Robert Sprowson <sprow> |
Wed 22 Apr 2009 08:30:14 PM UTC, comment #11:
|
Bill Auerbach <billauerbach> |
Wed 22 Apr 2009 07:05:24 PM UTC, comment #10:
|
Simon Goldschmidt <goldsimon> |
Wed 22 Apr 2009 05:16:18 PM UTC, comment #9:
|
Bill Auerbach <billauerbach> |
Wed 22 Apr 2009 05:11:05 PM UTC, comment #8: Simon, the point is that a compiler won't do that (my example) correctly. It's wrong on some platforms! My point is, you can cast addresses to pointers and violate alignment constraints. The compiler can do nothing about that.
|
Bill Auerbach <billauerbach> |
Wed 22 Apr 2009 04:06:09 PM UTC, comment #7:
|
Simon Goldschmidt <goldsimon> |
Wed 22 Apr 2009 01:50:40 PM UTC, comment #6: (Posted to lwip-devel - including it here now)
|
Bill Auerbach <billauerbach> |
Wed 22 Apr 2009 10:48:47 AM UTC, comment #5:
|
Simon Goldschmidt <goldsimon> |
Wed 22 Apr 2009 08:42:14 AM UTC, comment #4: ok here is the assembly dump
|
Guillaume du PONTAVICE <gdupontavice> |
Wed 22 Apr 2009 07:19:58 AM UTC, comment #3:
|
Simon Goldschmidt <goldsimon> |
Tue 21 Apr 2009 09:45:28 PM UTC, comment #2: well, in my case
|
Guillaume du PONTAVICE <gdupontavice> |
Tue 21 Apr 2009 05:55:40 PM UTC, comment #1: I guess you have copied those lines from autoip.c:419 or etharp.c:667 ? In these places, it is understandable to use memcpy, since we copy from a 2-byte-aligned struct to a 4-byte-aligned.
|
Simon Goldschmidt <goldsimon> |
Tue 21 Apr 2009 04:49:48 PM UTC, original submission:
I am working on ST5100 chipset (ST20 core / OS20, using ST toolset ST20 2.3.1, using structure packing option -falign1 for etharp.c)
|
Guillaume du PONTAVICE <gdupontavice> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 4 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2009-04-23 | goldsimon | Status | Need Info | Invalid | |
Assigned to | None | goldsimon | |||
Open/Closed | Open | Closed | |||
2009-04-21 | goldsimon | Status | None | Need Info |
Powered by Savane 3.13-3230.
Corresponding source code
This is the right one:
Since this is definitively not our bug, I'm closing it as invalid.
As to struct copying: I think the current implementation is good enough, but
we could discuss about checking where we use it (especially regarding pointer
casting).