LSI_INFO and GetThreadInfo()

On Twitter today, I warned folks about using LSI_INFO and specifically LSI_INFO(14). This is an extremely handy little global array varable, and (14) gives you a string which is a stack trace. Very very useful for debugging purposes as it tells you how you got to your particular line.


Now, I dont want to unnecessarily alarm people but we at hadsl found that it could very occassionally cause the server to NSD (when written into an agent). Specifically, we had written it into our error handling routines, and sometimes when you got a runaway error (multiple error conditions happening very closely to each other), we would see the server NSD with a stack overflow fault. Remove the LSI_INFO(14) and its all fine. Now. I say 'Dont be alarmed', because we write highly-reusable object orientated code thats loaded using 'execute', so we're pretty much an outlier case to begin with. And we saw this happen when we were at least 10+ calls deep into the stack. So it probably wont bite you. But if you write product - and we do - then its probably an idea not to use lsi_info(14).


Its a huge shame, as getThreadInfo() (the thread-safe and therefore non-crashy way of getting the same information) does not yet include the stack trace functionality. Oh well.


(If your confused about these terms, or what I'm talking about - no worries. Its kinda green-to-blackbelt lotuscript stuff. If your really interested, go google for lsi_info() and look up the designer help on getThreadInfo(). I'm deliberately not linking because I'm lazy, and because it'll deter (slightly) those folks who'll go and play with it just for fun. Remember. Enterprise software is not for fun! ;-) )