lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hi, I have a serious crashing issue that I am having difficulty debugging. I'm looking for any suggestions as to how I might isolate the cause. Here's a summary of the system and the symptoms:
This is an embedded system with a pre-emptive RTOS. There are five tasks, each of which has a Lua state running in it. There is another Lua state, which we call the Data Manager, that is used to store and pass global data among the tasks. Accesses to the Data Manager state are protected with mutexes so that only one task may access the Data Manager at any given time. C code provides the interface between the task states and the Data manager state. Two of the tasks are Lua interpreter consoles through two separate serial ports; with these we have interactive access to the system via the interfaces we have implemented and linked to Lua.
This system works (very) well most of the time. However, sometimes almost everything in the Data Manager's global table seems to simply vanish. The Lua state remains intact, but most globals are gone. Sometimes some functions remain, such as print(). The crash seems to be associated with heavy loading, i.e., when a task locks the Data Manager for extended periods of time, however, there isn't any readily apparent reason why this should be the case.
The obvious suspects are memory management, and the mutex mechanism that protects the Data Manager. However, I have thus far been unable to isolate the cause of the crash. Since this is an embedded controller with quasi-real-time requirements and limited resources (e.g., memory and CPU time), I have limited opportunity to run any sort of concurrent debugging utilities - though it's not impossible if the utility is small and fast.
Are there key areas within Lua where some strategically placed breakpoints, watchpoints, or such might provide some insights? Any helpful utilities I could link into the system? Any other ideas?
Sincere Thanks,
Phil Schmidt

This e-mail message may contain privileged and/or confidential information, and is intended to be received only by persons entitled to receive such information. If you have received this e-mail in error, please notify the sender immediately. Please delete it and all attachments from any servers, hard drives or any other media. Other use of this e-mail by you is strictly prohibited.

All e-mails and attachments sent and received are subject to monitoring, reading and archival by Watlow. The recipient of this e-mail is solely responsible for checking for the presence of "Viruses" or other "Malware". Watlow accepts no liability for any damage caused by any such code transmitted by or accompanying this e-mail or any attachment.

Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Watlow.