Page 5 of 5
Re: Release 2.8.5
Posted: Tue Dec 12, 2017 11:28 am
by ephogy
SeeCwriter wrote:The first member of the structure has __attribute__((aligned(2))) as part of it's declaration. Is that what you mean?
I think it needs to be declared on each of the (offending) structure elements. so each of the single byte entries needs to be told to align for 2 bytes.
Alternatively, you could use #pragma pack...
e.g.
#pragma pack(push, 2)
struct MyStruct
{
char first;
char second;
char third;
unsigned short fourth;
}
#pragma pack(pop)
Re: Release 2.8.5
Posted: Wed Dec 13, 2017 8:06 am
by SeeCwriter
After more investigation, the change in alignment is related to the IPADDR declaration. In 2.8.x IPADDR is a structure declared as packed. So the first change in alignment occurs when a byte declaration precedes an IPADDR declaration. In 2.8.5, no pad is inserted to put ntp_server on an even boundary because IPADDR is packed. But in 2.7.6, a pad is inserted.
Code: Select all
...
BOOL multi_band;
IPADDR ntp_server;
...
To solve the alignment issue I made the following change, and it works. The alignment of from both versions line up.
Code: Select all
BOOL multi_band;
IPADDR ntp_server __attribute((aligned(2)));
Re: Release 2.8.5
Posted: Wed Dec 13, 2017 9:40 am
by dciliske
IPADDR is declared packed in 2.8.x because in 2.8.x it's an IPv6 address structure containing 4 32-bit unsigned ints, whereas in 2.7.6 it's simply a typedef to a single 32-bit unsigned integer.
Re: Release 2.8.5
Posted: Thu Dec 28, 2017 9:19 am
by SeeCwriter
I added a call to OSDumpTask at the beginning of Usermain and I don't quite understand all the output. What is task "Esnd" or task "52??"?
- uc/OS Tasks
Prio State Ticks Call Stack
Idle|Ready | |at: 40066f7c
Main|Running
TCP |Semaphore| 1190 |400679fc->40067dd4->40072e0a->400668b0-><END>
IP |Fifo | 20 |400679fc->40067fc6->4006ab6e->400668b0-><END>
Esnd|Fifo | 9 |400679fc->40067fc6->4005f280->400668b0-><END>
TCPU|Semaphore| FRVR |400679fc->40067dd4->4007262e->400792ee->400668b0->
HTTP|Semaphore| 11 |400679fc->40067dd4->400768c6->40074afc->400668b0->
52??|Fifo | FRVR |400679fc->40067fc6->4006d566->400853ba->400668b0->
53??|Fifo | FRVR |400679fc->40067fc6->4006d566->4003923e->400668b0->
54??|Timer | 11996 |400672da->4004e056->400668b0-><END>
--------------------------------------------------
Address in use: FALSE
--------------------------------------------------
--------------------------------------------------
Announcing Address
--------------------------------------------------
SENDING GRATUITOUS ARP
SENDING GRATUITOUS ARP
Re: Release 2.8.5
Posted: Tue Mar 27, 2018 8:05 am
by SeeCwriter
As an FYI...We hired a Netburner Certified consultant to do a code review. He recommended a couple of changes, but could find nothing that would cause the reboots. I purchased a commercial lint package, and spent a few weeks removing the 100's of warnings it flagged. None of which could I identify as "the problem". And after nearly 2-months now, there have been no reboots. It's disconcerting that I can't point to a definitive cause of the reboots. But thankful the problem seems to be resolved.