As you probably know, exccause 28 & 29 are LoadProhibitedCause and StoreProhibitedCause so it certainly seems like a pointer has gone outside the addresssable area for some reason.
Are you able to post some code that exhibits the crash, and some rough steps for generating enough traffic to eventually cause crashes?
Any chance it's an open source external library we can add to 'extras/' in esp-open-rtos itself? Or is it something more specific?
What JTAG interface software/setup are you using?
If we get to the point where wdev.c and the NMI routines are reverse engineered then we should be able to find a way not to panic when this happens - it should be possible to just drop some frames and keep going, even if it means possible data loss.
If you're not debugging any interrupt routines, you may be able to set the debugger interrupt level so interrupts continue to run in the background while debugger halted. I never got this to work properly (possibly because the interrupt handler drops the interrupt level before running the handler and confuses the debug interface), but I haven't tried for a while (and I was using my buggy openocd port which had other issues).
I tend not to use debugger, especially on embedded systems. In my experience w esp8266 I share exactly the same tcpip code on Linux so. I tend to debug there, which is where the convenience of esp-open-rtos comes in - mostly same code everywhere.
Since memory is limited and since Malloc doesn't return NULL when out of memory the results may be quite surprising. You noticing crashes in mem mgt functions is very suggestive... A small leak fast has consquences on esp where otherwise it may not be observed. One can print out memory heap remaining. It seems accurate an reliable.
--
You received this message because you are subscribed to the Google Groups "esp-open-rtos mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to esp-open-rto...@googlegroups.com.
To post to this group, send email to esp-op...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/esp-open-rtos/37cab85d-c548-40ee-b035-c4fde0b24099%40googlegroups.com.
I tend not to use debugger, especially on embedded systems. In my experience w esp8266 I share exactly the same tcpip code on Linux so. I tend to debug there, which is where the convenience of esp-open-rtos comes in - mostly same code everywhere.
Since memory is limited and since Malloc doesn't return NULL when out of memory the results may be quite surprising. You noticing crashes in mem mgt functions is very suggestive... A small leak fast has consquences on esp where otherwise it may not be observed. One can print out memory heap remaining. It seems accurate an reliable.
On Jan 10, 2016 1:29 AM, "Eusebius Flöthenbeyn" <floeth...@gmail.com> wrote:
>
> Hi all,
>
> I think I've got one reliable trace.
>
>
> On Friday, January 8, 2016 at 11:11:58 AM UTC+1, Jonas S Karlsson (☯大鱼) wrote:
>>
>> I tend not to use debugger, especially on embedded systems. In my experience w esp8266 I share exactly the same tcpip code on Linux so. I tend to debug there, which is where the convenience of esp-open-rtos comes in - mostly same code everywhere.
>
>
> That was exactly my strategy so far, the debugger only comes in on the 'hard' issues when things just don't work as expected.
> I have verified my code with a number of regress tests on linux, so I can exclude the leak situation, apart from that, there's a fully "static" compile option, i.e. no malloc() called. When I enable malloc, the crashes occur more often.
> When I fully avoid reconnects, there's only little mallocing going on inside lwip. In this case I didn't manage a crash with the latest code. I had the suspicion that malloc might return a non-8byte-aligned block, under certain conditions, but that was not the case.
>
>
>>
>> Since memory is limited and since Malloc doesn't return NULL when out of memory the results may be quite surprising. You noticing crashes in mem mgt functions is very suggestive... A small leak fast has consquences on esp where otherwise it may not be observed. One can print out memory heap remaining. It seems accurate an reliable.
>
>
> I just ran into the situation where xPortGetFreeHeapSize() returns bogus (negative value), but the task is still running. So I'm not so sure I can second your statement :-)
OK. Then I'm convinced you run out of memory... I played with this a lot...
It's not bogus. The task is still running allocating memory that doesn't exist... You still getting pointers, not NULL... But it's not real memory. Crash often comes if you free it. I could do Malloc in 16 KB chunks and totally allocate 1 MB without problem and written values to those memory positions are also "remembered". Not getting NULL gives false security.
As said when all memory is exhausted this is not dectected by rtos so "still runnning" doesn't imply "correctness".
> I still have to figure out the differences in memory management with free vs. native ESP SDK and do more monitoring on the tasks that malloc often. Eventually, all dynamic malloc during runtime has to be eliminated anyhow to avoid fragmentation issues.
>
> --
> You received this message because you are subscribed to the Google Groups "esp-open-rtos mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to esp-open-rto...@googlegroups.com.
> To post to this group, send email to esp-op...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/esp-open-rtos/15eedb56-c730-45e9-8743-48ee26e11995%40googlegroups.com.
> I just ran into the situation where xPortGetFreeHeapSize() returns bogus (negative value), but the task is still running. So I'm not so sure I can second your statement :-)
OK. Then I'm convinced you run out of memory... I played with this a lot...
It's not bogus. The task is still running allocating memory that doesn't exist... You still getting pointers, not NULL... But it's not real memory. Crash often comes if you free it. I could do Malloc in 16 KB chunks and totally allocate 1 MB without problem and written values to those memory positions are also "remembered". Not getting NULL gives false security.
As said when all memory is exhausted this is not dectected by rtos so "still runnning" doesn't imply "correctness".