Amiga.org

Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: AmigaMance on October 04, 2009, 09:21:01 AM

Title: TLSFMem: Occasional recoverable alerts. (And a question about MemTrailer)
Post by: AmigaMance on October 04, 2009, 09:21:01 AM
Since i installed this patch, i'm getting occasional #010000F recovarable alerts. Sometimes they lead to a system crash, sometimes not.
 Does anyone know or speculate of what could be the cause of it? Any tips on how to overcome this?

 Could MemTrailer be of any use to overcome this problem? The last update has (quote) "Better support for TLSFMem"

 Thanks for any replies.
Title: Re: TLSFMem: Occasional recoverable arerts (And a question about MemTrailer)
Post by: platon42 on October 04, 2009, 04:36:18 PM
Quote from: AmigaMance;524684
Since i installed this patch, i'm getting occasional #010000F recovarable alerts. Sometimes they lead to a system crash, sometimes not.
 Does anyone know or speculate of what could be the cause of it? Any tips on how to overcome this?

 Could MemTrailer be of any use to overcome this problem? The last update has (quote) "Better support for TLSFMem"

 Thanks for any replies.


Quick answer: Bad programs overwrite unallocated memory or write past the end of the buffer. This is lethal for TLSF. Try to identify the bad software and remove it. You can verify the correctness of the internal memory structures by calling TLSFDebug (with Sashimi running, otherwise the output goes to the internal serial port). MemTrailer is not a solution to badly written software, it makes the problems just less aparent (if you're lucky).
Title: Re: TLSFMem: Occasional recoverable arerts (And a question about MemTrailer)
Post by: Georg on October 04, 2009, 06:54:16 PM
Quote from: platon42;524710
Quick answer: Bad programs overwrite unallocated


Btw, don't know about AOS, but AROS (with it's lame old AOS-like mem allocation routines) at the moment when killing a task relies on some (the first bytes may end up as a MemChunk which chains together free memory chunks, but that doesn't hurt) of the Task struct still being "there" (untrashed) after it was freed (if it's part of the tc_MemEntry) hoping the Forbid() protection scares the rest of the OS/apps enough, so they don't get hurt.
Title: Re: TLSFMem: Occasional recoverable arerts (And a question about MemTrailer)
Post by: AmigaMance on October 04, 2009, 11:40:39 PM
@platon42
Quote
Quick answer: Bad programs overwrite unallocated memory or write past the end of the buffer. This is lethal for TLSF. Try to identify the bad software and remove it. You can verify the correctness of the internal memory structures by calling TLSFDebug (with Sashimi running, otherwise the output goes to the internal serial port).

 Ok. I will try to run the debug version with sashimi and see what i will discover.
 At the moment, i have found out that stability improves when i place the TLSFMem late in the startup-sequence. (which is probably relevant with what you suggest, i assume)

Quote
MemTrailer is not a solution to badly written software, it makes the problems just less aparent (if you're lucky).

 By less apparent, you mean that the same problems will still occur but they will be less visible to the user or that MemTrailer is only a partial fix?


@Georg
 I experienced serious stability issues when i was trying to kill the trackdisk.device in the past. Therefor i believe that this problem exists in AOS too.
Title: Re: TLSFMem: Occasional recoverable arerts (And a question about MemTrailer)
Post by: AmigaMance on October 06, 2009, 03:29:30 AM
Anyways...
I inserted the following lines in my s-s right after SetPatch:

segtracker
run <>NIL: sashimi BUFK=128 NOPROMPT >dh0:sashimi.txt
wait 1
tlsfdebug

With no TLSFMem patch installed. Sashimi did not intercepted anything. sashimi.txt is an empty file.