Genii Weblog
Calling all detectives - hacking Lsi_info together
Tue 27 Apr 2004, 10:43 PM
Tweetby Ben Langhinrichs
For i=0 To 255and I have seen several others with the same basic code. On a whim today, I changed this to go up to 32760. While there was nothing after 442, there were several interesting values after 255, incliding True and False values. The complete list for that one run I made is at the bottom of this post, but here is what I need from readers. Take the code:
Print Cstr(i) & "=" & Lsi_info(i) & "<BR>"
Next
Unfortunately it's almost impossible to speculate on the meaning of each of the variables, so was near useless...
Lsi_info(2)='INITIALIZE'
Lsi_info(3)='*1BEC110'
Lsi_info(4)='14901208'
Lsi_info(5)='15817068'
Lsi_info(6)='5.0.0.06'
Lsi_info(7)='24'
Lsi_info(8)='40637988'
Lsi_info(9)='en'
Lsi_info(11)='28'
Lsi_info(12)='INITIALIZE'
Lsi_info(13)='*1BEC110'
Lsi_info(14)='*1BEC110,INITIALIZE,17 '
Lsi_info(16)='15817164'
Lsi_info(17)='15816940'
Lsi_info(18)='15817052'
Lsi_info(19)='15817052'
Lsi_info(20)='15817132'
Lsi_info(30)='4'
Lsi_info(31)='4'
Lsi_info(32)='4'
Lsi_info(33)='4'
Lsi_info(50)='1146436'
Lsi_info(51)='1317169'
Lsi_info(52)='1487'
Lsi_info(98)='1000'
Lsi_info(99)='29981576'
Lsi_info(110)='170716'
Lsi_info(111)='186652'
Lsi_info(112)='16'
Lsi_info(113)='170716'
Lsi_info(114)='752'
Lsi_info(115)='12288'
Lsi_info(116)='18'
Lsi_info(117)='752'
Lsi_info(119)='4096'
Lsi_info(123)='4096'
Lsi_info(126)='931048'
Lsi_info(127)='1015829'
Lsi_info(128)='420'
Lsi_info(129)='931048'
Lsi_info(130)='664'
Lsi_info(131)='4096'
Lsi_info(132)='10'
Lsi_info(133)='664'
Lsi_info(201)='54529'
Lsi_info(202)='54552'
Lsi_info(203)='54590'
Lsi_info(204)='54618'
Lsi_info(205)='54648'
Lsi_info(206)='54656'
Lsi_info(207)='54683'
Lsi_info(208)='54711'
Lsi_info(209)='54728'
Lsi_info(400)='-441381'
Lsi_info(403)='4'
Lsi_info(404)='False'
Lsi_info(405)='False'
Lsi_info(406)='False'
Lsi_info(407)='False'
Lsi_info(408)='202'
Lsi_info(409)='2147483584'
Lsi_info(410)='True'
Lsi_info(411)='2000'
Lsi_info(412)='50'
Lsi_info(419)='4'
Lsi_info(420)='17'
Lsi_info(421)='INITIALIZE'
Lsi_info(422)='60'
Lsi_info(430)='17'
Lsi_info(431)='INITIALIZE'
Lsi_info(432)='60'
Lsi_info(440)='W32I'
Lsi_info(441)='W32I'
Lsi_info(442)='5'
Copyright © 2004 Genii Software Ltd.
What has been said:
151.1. Nathan T. Freeman (04/28/2004 01:54 PM)
Well, Lsi_info(409)='2147483584', is not a phone number, even though that would have been pretty funny. :)
It's *probably* an available memory count, although it's not directly a power of two. Did the machine you ran this on have 2GB of RAM?
151.2. Nathan T. Freeman (04/28/2004 01:57 PM)
Forgot to include this... that number is 64 *less* than 2GB expressed in bytes. I'm sure this means something, but not to me. :)
151.3. Ben Langhinrichs (04/28/2004 02:03 PM)
Good noticing, but this machine has only 256MB of memory. The hard drive has about 2GB free, if that means anything.
151.4. Alan Bell (04/30/2004 08:49 AM)
My list from a windows XP box with 1GB ram, running 6.5.1, not very much different from your results really, I am guessing a lot of the numbers are pointers to memory addresses such as *51E39F4 is the location of the entry point of the click sub of the button I put the code in. I will try on Linux later.
Lsi_info(1)=19
Lsi_info(2)=CLICK
Lsi_info(3)=*51E39F4
Lsi_info(4)=4146232
Lsi_info(5)=69115294
Lsi_info(6)=5.0.0.06
Lsi_info(7)=344
Lsi_info(8)=125910016
Lsi_info(9)=en
Lsi_info(11)=19
Lsi_info(12)=CLICK
Lsi_info(13)=*51E39F4
Lsi_info(14)=*51E39F4,CLICK,4
Lsi_info(16)=126061160
Lsi_info(17)=126060952
Lsi_info(18)=126061064
Lsi_info(19)=126061080
Lsi_info(20)=126061128
Lsi_info(30)=39
Lsi_info(31)=39
Lsi_info(32)=39
Lsi_info(33)=39
Lsi_info(50)=2705912
Lsi_info(51)=3399732
Lsi_info(52)=7156
Lsi_info(98)=1000
Lsi_info(99)=21870798
Lsi_info(110)=53392
Lsi_info(111)=69632
Lsi_info(112)=153
Lsi_info(113)=53392
Lsi_info(114)=245688
Lsi_info(115)=602112
Lsi_info(116)=4720
Lsi_info(117)=245688
Lsi_info(119)=4096
Lsi_info(122)=15176
Lsi_info(123)=20480
Lsi_info(124)=187
Lsi_info(125)=15176
Lsi_info(126)=2333240
Lsi_info(127)=2514996
Lsi_info(128)=855
Lsi_info(129)=2333240
Lsi_info(130)=4928
Lsi_info(131)=16384
Lsi_info(132)=52
Lsi_info(133)=4928
Lsi_info(201)=54529
Lsi_info(202)=54552
Lsi_info(203)=54590
Lsi_info(204)=54618
Lsi_info(205)=54648
Lsi_info(206)=54656
Lsi_info(207)=54683
Lsi_info(208)=54711
Lsi_info(209)=54728
Lsi_info(400)=924
Lsi_info(403)=5
Lsi_info(404)=False
Lsi_info(405)=False
Lsi_info(406)=False
Lsi_info(407)=False
Lsi_info(408)=93
Lsi_info(409)=2147483584
Lsi_info(410)=True
Lsi_info(411)=2000
Lsi_info(412)=50
Lsi_info(419)=5
Lsi_info(420)=4
Lsi_info(421)=CLICK
Lsi_info(422)=256
Lsi_info(430)=4
Lsi_info(431)=CLICK
Lsi_info(432)=256
Lsi_info(440)=W32I
Lsi_info(441)=W32I
Lsi_info(442)=5
151.5. Dominic Skey (23/11/2004 07:23)
Here are a couple more for you...
LSI_Info(420)=Line number in source section of call to LSI_Info (can get current line number from this)
LSI_Info(421)=Section in source ($AssistInfo in agents, $ScriptLib in Script Libraries) of call to LSI_Info (can get current section from this)
LSI_Info(430)=Line number in source section of call to current function (caller)
LSI_Info(431)=Section in source ($AssistInfo in agents, $ScriptLib in Script Libraries) of caller
To test this, create an agent that has the following code:
Sub Initialize
Dim test as New DebugTester
End Sub
Public Class DebugTester
Dim vals List as String, i as Integer
For i = 420 To 431
If Not Cstr(Lsi_info(i))="0" Then vals(i) = Cstr(Lsi_info(i))
Next i
Stop
End Class
If you run it with the debugger on, you can see that vals has the following values:
[420] = "5"
[421] = "(Declarations)"
[430] = "2"
[431] = "INITIALIZE"
151.6. Steve C. (08/04/2005 06:42 AM)
Here's a little list of constans I've built up and started using. Thanks, b.t.w., for the const's for Memory.
CONST LSI_MODULE = 2
CONST LSI_CALLER = 12 ' Calling module
CONST LSI_OBJECT = 3
CONST LSI_VERSION = 6
CONST LSI_LANGUAGE = 9
CONST LSI_LSMEMORY = 50
CONST LSI_LSMEMORYOS = 51
CONST LSI_LSMEMORYBLKS = 52
CONST LSI_MODULELINE = 420
CONST LSI_CALLERLINE = 430
CONST LSI_PLATFORM = 440
With regards to LSI_INFO(3) = I'm not certain what it should be called.
I ran a similar script to the ones listed above- but my code was in a LS script library, and I called it from an agent (which I ran as a web-based agent to have the nice table-formatting). This db was on an R5 server.
Both LSI_INFO(3) and LSI_INFO(13) returned the name of the script library. My guess is that it would be the name of the container the script exists in. Perhaps when run from a button, it would have have the button's handle?
I haven't tryed too many more calls to it from different angles, but, there appear (from my own results) to be some redundant values:
2/421 : Both the name of the module making the call to LSI_INFO
3/13 : Both are the name of the LS Script file that the module making the call to LSI_INFO resides in.
12/431: The name of the calling module.
440/441: The platform the module is running on? I haven't tried this on anything but Win 2000- but I'd assume the W32I is for Windows 32-bit.
151.7. Steve C. (08/04/2005 06:47 AM)
Oh, and I've added the following, after looking over the other page as well.
CONST LSI_TICKS = 99
CONST LSI_TICKS_PER_SEC = 98
CONST LSI_R6STACK = 14 ' Unused in R5
151.8. Steve C. (08/04/2005 07:58 AM)
Just another note:
Embedding the looping routine into the New() for a Class object, returned (as Dominic pointed out) "(Declarations)" for LSI_INFO(421), but returned "NEW" for LSI_INFO(2), so I assume that 2 would be the routine calling LSI_INFO, and 421 would be the section that the object performing the call resides in (as Dominic also pointed out). However, if the routine calling LSI_INFO is not contained in a particular section of code (such as in a function in a script library, or in the code of a button), i.e., it doesn't have a logical owner, it appears to returns the same as LSI_INFO(2).
I've decided, then, to updated my CONST list to include 421 as LSI_MODULEOWNER.
As for: Lsi_info(409)='2147483584', I get the exact same number, with much more harddrive space, and much more memory- so I think the HD/Memory theories are shot.
To Recap my current CONST's for anyone interested in copy/paste:
CONST LSI_MODULE = 2 ' Module calling LSI_INFO
CONST LSI_CALLER = 12 ' Caller Module (module calling the one that calls LSI_INFO)
CONST LSI_OBJECT = 3 ' ?
CONST LSI_VERSION = 6 ' LotusScript version ?
CONST LSI_LANGUAGE = 9 ' Language (e.g. 'en' for english)
CONST LSI_LSMEMORY = 50 ' LS Memory Allocated
CONST LSI_LSMEMORYOS = 51 ' LS Memory Allocated by OS
CONST LSI_LSMEMORYBLKS = 52 ' LS Blocks Used
CONST LSI_MODULELINE = 420 ' Line number calling LSI_INFO
CONST LSI_MODULEOWNER = 421 ' Location that the calling module resides?
CONST LSI_CALLMODULELINE = 430 ' Line number of the CALLER module.
CONST LSI_TICKS = 99 ' Ticks
CONST LSI_TICKS_PER_SEC = 98 ' Ticks per second
CONST LSI_R6STACK = 14 ' Caller Stack information, (Not used before R6)
151.9. Ben Langhinrichs (08/04/2005 08:20 AM)
Thanks for all the work, Steve. I'll try to get this pulled together into a more useful resource so others can use it as well.
151.10. McSwain (11/30/2005 10:41 AM)
Is there a way to get the Module name from the value returned in LSI_Info(3)?
151.11. Markus Fundel (14.09.2006 14:50)
Hello Ben,
searching for a way to get errors reported in a detailed/automatic way, i've found the site "
Calling all detectives - hacking Lsi_info together" on your website. I've noticed that the site is quite old (last posting 11/30/2005). But i do not want that other people user Lsi_info and then their domino servers crash if they use Lsi_info in their whole application - so i post.
All i want to say about "Lsi_info" is, that it is not "thraed safe"! Means if 2 concurrent Agents call Lsi_info at the same time, your domino server can crash. A technote from IBM exists for the issue (sorry - i haven't got the link at the moment - if you are interresed you have to search by yourself).
It is saver to use "GetThreadInfo" instead. Here is a list of possible parameters i've found:
Err Numeric error code integer
Error Error text string
GetThreadInfo(LSI_THREAD_LINE) Current line number variant
GetThreadInfo(LSI_THREAD_PROC) Current procedure variant
GetThreadInfo(LSI_THREAD_MODULE) Current module variant (returns hex code, not module name)
GetThreadInfo(LSI_THREAD_VERSION) Lotusscript version variant
GetThreadInfo(LSI_THREAD_LANGUAGE) Language setting variant
GetThreadInfo(LSI_THREAD_COUNTRY) Country/Region setting variant
GetThreadInfo(LSI_THREAD_TICKS) Current clock ticks variant
GetThreadInfo(LSI_THREAD_TICKS_PER_SEC) Clock ticks per second variant
GetThreadInfo(LSI_THREAD_PROCESS_ID) Current process ID variant
GetThreadInfo(LSI_THREAD_TASK_ID) Current task ID variant
GetThreadInfo(LSI_THREAD_CALLPROC) Calling procedure variant
GetThreadInfo(LSI_THREAD_CALLMODULE) Calling module variant
Greetings
Markus