[Vm-dev] Re: RFC: Unix 3.11.3-2116 VM

Ian Piumarta piumarta at speakeasy.net
Tue Sep 1 15:28:52 UTC 2009


On Sep 1, 2009, at 6:53 AM, Bert Freudenberg wrote:

>> 	kill -USR1 12345
> Can we add this to the VM? Helps debugging frozen images. Fully  
> patched file attached below.

The Unix VM used to do exactly this.  It still does, but the stack  
printing was subsumed by emergencyDump() (which, if enabled, prints a  
stack and saves an image file after SIGHUP or SIGQUIT).  This also  
avoids a conflict of interest with the framebuffer driver which needs  
to use a SIGUSR.

Is enabling IMAGE_DUMP in sqUnixMain.c sufficient for what you need?   
We could also have an option that names an image dump file, disabling  
the dump if no name is given but still printing the stack.

BTW: it is extremely dangerous to print the stack asynchronously from  
within an interrupt handler.  In the Unix VM, SIGHUP sets a flag that  
is checked and prints the stack from ioProcessEvents (which is safe)  
and SIGQUIT prints it asynchronously from the handler.

Cheers,
Ian

>
> Andreas, is this the patch you are still using? Or did you hook up  
> printAllStacks() instead?
>
> - Bert -
>
> <sqUnixMain.c.gz>



More information about the Vm-dev mailing list