[SOLVED] OS freeze when using debug kernel with CPU Watcher

A forum for general AmigaOS 4.x support questions that are not platform-specific
corto
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 40
Joined: Sun Jun 19, 2011 9:53 am

Re: OS freeze when using debug kernel with CPU Watcher

Post by corto »

zzd10h: As I suggested to you previously, looking the error log above and comparing to the asm code generated, I think the error comes from the call to GetSysTime() in the my_launch() function run by the idler task. My assumption would be that the ITimer interface is still uninitialized at that time (and I'm not sure if it can be shared with the main task).

I suspected that the idler starts before receiving the signal from the main task, even if the code that synchronizes seems to be good.

Huum, looking again just now to the code, "me->tc_Launch = my_launch;" is executed before the wait for the timer initialization in the main task. So, if the idler task is descheduled just after "me->tc_Launch = my_launch;" and comes back before ITimer is initialized in the main task, my_launch() is called and ... boom!

This can happen even more probably that the priority of the idler task is decreased afterwards (and not at the task creation).

Instead of adding the Delay() call, you should inialize the timer interface before creating the idler task.

I suppose the error can be highlighted by changing the rythm (set a high debuglevel and activating munge option) and can have an effect only on some platforms (I failed to reproduce on the MicroAOne and the Sam440).
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 11:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

Re: OS freeze when using debug kernel with CPU Watcher

Post by javierdlr »

corto wrote:zzd10h: As I suggested to you previously, looking the error log above and comparing to the asm code generated, I think the error comes from the call to GetSysTime() in the my_launch() function run by the idler task. My assumption would be that the ITimer interface is still uninitialized at that time (and I'm not sure if it can be shared with the main task).

I suspected that the idler starts before receiving the signal from the main task, even if the code that synchronizes seems to be good.

Huum, looking again just now to the code, "me->tc_Launch = my_launch;" is executed before the wait for the timer initialization in the main task. So, if the idler task is descheduled just after "me->tc_Launch = my_launch;" and comes back before ITimer is
...
THX.
Did those changes in cpu.c, I post such new source here: http://forum.hyperion-entertainment.biz ... 504#p28504
User avatar
Elwood
Posts: 65
Joined: Sat Jun 18, 2011 7:57 pm
Location: Lyon, France
Contact:

Re: OS freeze when using debug kernel with CPU Watcher

Post by Elwood »

It seems that did the trick. No crash to report here anymore (Sam460). Well done.
Philippe "Elwood" Ferrucci
Sam460 owner
AmigaOS 4 betatester
zzd10h
Posts: 546
Joined: Sun Sep 16, 2012 6:40 am
Location: France

Re: OS freeze when using debug kernel with CPU Watcher

Post by zzd10h »

Changes from Javier in cpu.c implemented in CPUDock and no more freezes with kernel.debug and MUNGE.

Thank you all, very nice !!!
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
Raziel

Re: [SOLVED] OS freeze when using debug kernel with CPU Watc

Post by Raziel »

Thank you to all who contributed to the fix :-)
Post Reply