# What if there is no more memory when using adl\_errHalt

**URL:** <https://forum.sierrawireless.com/t/what-if-there-is-no-more-memory-when-using-adl-errhalt/3318>\
**Category:** Open AT\
**Created:** [June 9, 2009, 11:18am UTC](https://forum.sierrawireless.com/t/what-if-there-is-no-more-memory-when-using-adl-errhalt/3318 "2009-06-09T11:18:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![VividComputers](https://avatars.discourse-cdn.com/v4/letter/v/8baadc/32.png) [@VividComputers](https://forum.sierrawireless.com/u/VividComputers)\
**Post date:** [June 9, 2009, 11:18am UTC](https://forum.sierrawireless.com/t/what-if-there-is-no-more-memory-when-using-adl-errhalt/3318/1 "2009-06-09T11:18:24Z")

</div>

When you use this function  
adl\_errHalt ( ADL\_ERR\_LEVEL\_APP + 1, MyErrorString );  
As described in the ADL manual, it says it logs the error in non-volatile memory where there is limited space.

However I cannot find anything about what it will do if the space is out. Will it start overwriting old backtraces? Will it crash? I want to know whether it is necessary for me to check and erase the backtraces.

All I need is to be able to manually check the last few backtraces at any given time.

Thanks all.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [June 9, 2009, 12:25pm UTC](https://forum.sierrawireless.com/t/what-if-there-is-no-more-memory-when-using-adl-errhalt/3318/2 "2009-06-09T12:25:05Z")

</div>

> [@VividComputers](#):
>
> All I need is to be able to manually check the last few backtraces at any given time.

I think that’s not possible.

AFAIR, it is only possible to start from the first backtrace, then work through in sequence until you reach the last one. Then you can delete all backtraces.

So it payss to read & clear backtraces frequently - don’t let them pile up!

---

<div class="post-metadata">

**Author:** ![VividComputers](https://avatars.discourse-cdn.com/v4/letter/v/8baadc/32.png) [@VividComputers](https://forum.sierrawireless.com/u/VividComputers)\
**Post date:** [June 9, 2009, 10:15pm UTC](https://forum.sierrawireless.com/t/what-if-there-is-no-more-memory-when-using-adl-errhalt/3318/3 "2009-06-09T22:15:17Z")

</div>

Thanks awneil.

> [@](#):
>
> it is only possible to start from the first backtrace, then work through in sequence until you reach the last one.

I would be quite happy to read them all at once, but only the last 2 or 3 will actually be of interest to me. I mention this because I will not mind if the oldest backtraces are overwritten by newer ones. I am not intending to transmit or compile the backtraces anywhere else.

Is there a simple way I could read the number of backtraces currently in the log and then if they are too high, erase them? Or could I just keep using adl\_errHalt and it will just keep working?

Also, if I want to read them to a terminal emulator, could I use this:

```auto
void MyAnalysisFunction ()
{
	// Start analysis
	s8 AnalysisHandle = adl_errStartBacktraceAnalysis();
	// Get state
	adl_errAnalysisState_e State = adl_errGetAnalysisState();
	// Retrieve next backtrace size
	u8 * Buffer = NULL;
	u32 Size = adl_errRetrieveNextBacktrace ( AnalysisHandle, Buffer, 0 );
	// Retrieve next backtrace buffer
	Buffer = adl_memGet ( Size );
	adl_errRetrieveNextBacktrace ( AnalysisHandle, Buffer, Size );
	// Erase all backtraces
	//adl_errEraseAllBacktraces();
	// Return backtrace buffer
	adl_atSendResponse(ADL_AT_UNS, "Backtrace:|%s|", Buffer);
}
```

If I build it into my application with a way to trigger it (for a diagnostic situation).

Obviously I have copied this from the “nominal use case of the ADL Error service” in the ADL User Guide (except rather than returning the buffer I am attempting to output it to the console - not sure if this way of referring to the Buffer is sensible though?). There seems to be something unexplained here though; does adl\_errRetrieveNextBacktrace retrieve all the backtraces at once? If not why is there no loop? And if so how do you separate each backtrace entry?

All I really want is the easiest way to read the strings from the backtrace logs. Can this be done in M2M studio or something?

Cheers.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [June 9, 2009, 11:57pm UTC](https://forum.sierrawireless.com/t/what-if-there-is-no-more-memory-when-using-adl-errhalt/3318/4 "2009-06-09T23:57:32Z")

</div>

> [@VividComputers](#):
>
> Is there a simple way I could read the number of backtraces currently in the log

No - you just have to keep reading til there’s no more.

> [@](#):
>
> Or could I just keep using adl\_errHalt and it will just keep working?

I think it must do.

> [@](#):
>
> I am attempting to output it to the console - not sure if this way of referring to the Buffer is sensible though?

No, it isn’t, I’m afraid - the backtrace is binary!

> [@](#):
>
> Can this be done in M2M studio or something?

See: [viewtopic.php?f=78&t=3118&p=13472&hilit=backtraces#p13472](http://www.wavecom.com/modules/movie/scenes/forums/viewtopic.php?f=78&t=3118&p=13472&hilit=backtraces#p13472)
