I have pushed a crash and hang debugging tool called fnrec (function recorder) to my git repo. It is an experimental tool that collects a trace of functions called before the hang. It will allow us to determine which function hangs. I hope you will try it :).
This tool is based on an idea that Thomas Miletich (meteger) and I were playing with about a year ago. By using the gcc -finstrument-functions compiler flag, we can trace each function call and record it into a memory buffer. The memory buffer has a magic number at the start to identify it as valid and not just random bytes in memory. As gPXE runs, it records each function call into the memory buffer. When the crash occurs and the system is reset, we assume that memory is not cleared or overwritten (this is true on many machines but you may have to experiment with pressing Ctrl+Alt+Del versus the reset switch versus other alternatives). When the system loads gPXE again, it checks for the memory buffer and if the magic number is still there, the contents of the memory buffer are printed out. This output is all the recorded function calls, which allows developers to see what code paths were taken and what the last function called was. Here is the commit on my 'fnrec' branch: http://git.etherboot.org/?p=people/stefanha/gpxe.git;a=commitdiff;h=87a60a77e8f9cccceaf0c4ed55d06bc64c7ebdac How to try it: $ git clone -b fnrec git://git.etherboot.org/scm/people/stefanha/gpxe.git $ cd gpxe/src $ make bin/sky2.usb 1. Boot gPXE and reach the point where it hangs. Now reset your system and boot into gPXE again. 2. This time gPXE should print out lots of numbers before the banner and prompt. Copy these numbers into a text file (serial console is useful for capturing this output). If you can't use serial or easily copy the numbers, please take at least the last two lines of numbers. $ cat >fnrec.dat <paste the numbers from gPXE output here> ^D $ util/fnrec.sh bin/sky2.hd.tmp fnrec.dat Please send the output produced by the fnrec.sh utility. It contains the function calls recorded before the hang. Hacked up two days ago and tested on three machines, QEMU, and Virtualbox. It works on all except one machine where gPXE fails to start and the system resets immediately. Hopefully it will work for you :). Stefan _______________________________________________ gPXE mailing list [email protected] http://etherboot.org/mailman/listinfo/gpxe
