最近在一个客户现场发现Domino经常宕机,经检查堆栈信息大致都是一样的,
##################################
ptrgl.$PTRGL() at 0xd021da70
raise.nsleep(??, ??) at 0xd023dc54
raise.nsleep(??, ??) at 0xd023dc54
sleep(??) at 0xd027088c
OSRunExternalScript(??) at 0xd247f130
OSFaultCleanup(??, ??, ??) at 0xd24800fc
fatal_error(??, ??, ??) at 0xd2fe6294
LinkDynArray__11LSsInstanceFP14LSsDynamicHead(??, ??) at 0xd2aad5c8
ArrayAllocHead__9LSsThreadFRP13LSsValueArrayiUsT3P9LSsModule(??, ??, ??, ??, ??, ??) at 0xd2aacd68
ArrayRedim__9LSsThreadFP9LSsModuleUsPvi(??, ??, ??, ??, ??) at 0xd2aadcec
OP_REDIM__9LSsThreadFi(??, ??) at 0xd2abd6f8
NRun__9LSsThreadFv(??) at 0xd2ae96a8
Run__9LSsThreadFv(??) at 0xd2aea558
Resume__11LSsInstanceFv(??) at 0xd2a6874c
Run__9LSIThreadFUli(??, ??, ??) at 0xd2fa9524
RunInternal__9LSIThreadFsUl11tagTIMEDATEi(0xd2fa8174, 0x0, 0x35ab9c00, 0xd2b32660, 0x10, 0x300aa0ec) at 0xd2fa97a8
RunToCompletion__9LSIThreadFUli(??, ??, ??) at 0xd2fa9b48
RunScript__12CLSIDocumentFUssPcT2UlT5(??, ??, ??, ??, ??, ??,
后来查到一个类似的案例就是在代码中有一些函数的写法导致的,主要是一些ls自己的操作数组的函数作为了另外一个函数的参数的时候,会导致这样的情况,需要进行相应地代码的修改,将操作数组的函数首先赋给一个变量,然后再用该变量去做为参数即可。
For example:
Sub Initialize
Dim ary(3) As String
Dim v As Variant
ary(0) = "A"
ary(1) = "B"
ary(2) = "A"
v = myfunc(Arrayunique(ary))
End Sub
Function myfunc(ary As Variant) As Variant
Dim v As Variant
v=ary
Redim v(5) As Variant
myfunc= v
End Function
详细的描述可以参照
所以建议大家在座开发的时候要注意,操作数组的函数(Arrayunique(,Arrayreplace等等)千万不要做为其他函数的参数,否则会宕机的!
Passing a LotusScript language array function as a parameter for a function or a subroutine causes a hang or crash
|
Problem |
Passing a LotusScript language array function as a parameter for a function or a subroutine causes a hang or crash. The hang or crash can be experienced on a Notes client or Domino server or a server task such as the HTTP task. The content of the subroutine or function determines whether a hang or crash is observed. The issue is known to occur if any of the following is passed as a parameter in a subroutine or function: ArrayAppend, ArrayGetIndex, ArrayReplace, or Fulltrim.
In cases where this issue is a result of code executed on the web, if you issue the command "TELL HTTP SHOW THREAD STATE" at the server console, you can see that a thread is hung trying to execute the agent. For example, the console displays the following:
HTTP Thread State: Thread: [ab8] State: [Worker processing request] Other Info: GET /filename.nsf/agentname HTTP/1.1
If you try to end the HTTP task, it will not shut down.
The Fatal Thread observed in the crash will contain calls similar to the following:
nnotes.LSsThread::ArrayErase nnotes.LSsThread::LsValClean nnotes.LSsThread::PopValueComplex The crash issue has been observed in cases where the subroutine or function makes use of the Redim function.
For example:
Sub Initialize Dim ary(3) As String Dim v As Variant ary(0) = "A" ary(1) = "B" ary(2) = "A" v = myfunc(Arrayunique(ary)) End Sub
Function myfunc(ary As Variant) As Variant Dim v As Variant v=ary Redim v(5) As Variant myfunc= v End Function The hang issue was observed in a case where a particular element of the array was modified in the subroutine/function.
For example:
Function myfunc(ary As Variant) As Variant Dim v As Variant v=ary v(0)="xyz" myfunc= v End Function |
|
Solution |
This issue has been reported to Quality Engineering in SPR# NBRR69PVKW. The crash issue is no longer observed starting in Notes/Domino releases 6.5.4 and 7.0. The hang issue continues to occur. Workaround Call the LotusScript language function first and then pass it's result as the parameter in the function or subroutine.
For example:
Dim x as variant x=FullTrim(myarray) z=myfunc(x) Note: Further research revealed that the issues additionally do not occur if the subroutine or function effects the variable parameter from their declaration rather than an additional variable set to the value.
For example:
Function myfunc(ary As Variant) As Variant ary(0)="xyz" myfunc= ary End Function |
| | | | |
阅读(4740) | 评论(0) | 转发(0) |