LsxLC crashed server

Hi,

I searched this forum a lot but not able to get the answer, I think some one will be able to help me. Thanks in advance.

We have an agent “agtImportExportLC” that is crashing the server once or twice in a month. It was not crashing the server every timeit is running

Friend of me helped me with the analysing NSD and find that it was due to the above agent. We have analysed the NSD file but did not get anything further.

Below are the details of the agent.

1–> It is using LSXLC library to connect to oracle 8 client.

2–> Get some details from oracle and updates the same in the Notes Database

3–> Approximately executes 50 times a day.

4–> It is User triggered agent running through http task.

5–> This application is totally a Web based one.

6–> Included a log file in the agent. It points to different SQL statement when it was crashing.

7–> There is no problem in the code as it is executing more than 50 times a day for about 15-20 days without any problem.

I have given a sample code here and 2 NSD logs. Any help is greatly appreciated.

Agent Code: - sample code not all functions are included

Set ses = New NotesSession

Set src = New LCConnection ("oracle8") 



Set db = ses.CurrentDatabase

LookupDB = "appl\ccsadmin.nsf"

Set AdminDB = ses.GetDatabase(db.Server, LookupDB)

src.Server = "CCS.com"

src.Userid = "ccsrenewal"

src.Password = "ccsrenewal"

src.Metadata = "IMAGEREPOSITORY"



src.Connect

If src.IsConnected Then

	Messagebox "connected to " & profiledoc.SName(0) & " successfully"

End If



Set AgentLog  = OpenLog(ses, db)

Call AddToLog(AgentLog,  "Successfully connected to the Oracle Database" & Chr$(13) & Chr$(10) )

Set imgview = db.GetView("vieImageStatus") 'added on 8-Apr-04

Set view = db.GetView("vieImageDetails") 'added on 8-Apr-04

Call ImportImageDetails(db)

Cleanup:

If src.IsConnected Then

	src.Disconnect 

	Messagebox "Disconnected from " & profiledoc.SName(0) & "successfully"

End If



Call CloseLog(AgentLog)

Exit Sub	

ErrHandler:

Print "Error " & Str(Err) & ":  " & Error$ & Erl()

Call AgentAbnormalEnd(AgentLog)

Resume Cleanup 

End sub

Function ImportImageDetails(db As NotesDatabase)

Dim cnt As Integer

Dim count As Integer

Dim dc As NotesDocumentCollection

Dim UploadTime As NotesDateTime



Set resultSet = New LCFieldList

Call AddToLog(AgentLog,  "Importing records started" & Chr$(13) & Chr$(10) )



Set tempdoc = view.GetLastDocument

If Not tempdoc Is Nothing Then

	totcount = tempdoc.ImageSeqNumber(0) 'To avoid import the existed image details in LN

Else

	totcount = 0

End If



qry="Select a.IMAGESEQNUMBER, a.IMAGEREFERENCENUMBER, a.DATEOFUPLOAD, a.STATUS, a.IMAGEUSER from imagerepository a WHERE a.IMAGESEQNUMBER > " & totcount 



cnt=src.execute(qry,resultSet)

Call AddToLog(AgentLog,  "Query Executed" & Chr$(13) & Chr$(10) )

Set fld(0) = resultSet.GetField(1)

Set fld(1) = resultSet.GetField(2)

Set fld(2) = resultSet.GetField(3)

Set fld(3) = resultSet.GetField(4)

Set fld(4) = resultSet.GetField(5)

count = 0

If(cnt <> 0) Then

	While (Src.Fetch(resultSet) > 0)  

		key = fld(0).getInt(1)

		Set dc = view.GetAllDocumentsByKey(key,True)

		If dc.count = 0 Then

			Set doc = db.CreateDocument

			doc.form = "frmImageDetails"

			doc.ImageSeqNumber = fld(0).getInt(1)

			doc.ImageRefNumber = fld(1).text(0)

			If Instr(1,fld(1).text(0),".") <> 0 Then

				doc.CaseRefNumber = Ucase(Mid(fld(1).text(0),1,Instr(1,fld(1).text(0),".")-1))

			Else

				doc.CaseRefNumber = fld(1).text(0)

			End If

			Set UploadTime = New NotesDateTime(fld(2).value(0))

			doc.DtUpload = UploadTime.LSLocalTime

			doc.NumStatus = fld(3).text(0)

			doc.txtUpload = Cstr(fld(2).text(0))

			doc.ImageUser = fld(4).text(0)

			Call doc.ComputeWithForm(True,False)

			Call doc.save(True,False)

			count = count + 1

		End If

	Wend

	Call AddToLog(AgentLog,  "Import records completed and # of Imported records is " & Cstr(count) & Chr$(13) & Chr$(10) )

Else

	Call AddToLog(AgentLog,  "Import records completed and # of Imported records is " & Cstr(count) & Chr$(13) & Chr$(10) )

End If

End Function

NSD 1: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Build: 6.5.2 June 01, 2004

Host Name: SunOS capsxp54 5.8 Generic_117000-03 sun4u sparc

SUNW,Sun-Fire-480R

Date: Wed Jun 20 10:33:27 SGT 2007

##################################

thread 99/125 :: http, pid=16768, lwp=99, tid=106

##################################

[1] fd79f428 lwp_sema_wait (cd371e60)

[2] fd5a96dc _park (cd371e60, fd5cc000, 0, cd371d98, 0, 0) + 114

[3] fd5a90d8 _swtch (cd371d98, cd371d98, fd5cc000, 5, 1000, 0) + 158

[4] fd5aada0 _mutex_adaptive_lock (fd5d785c, 4c00, 1000, fffeffff, 1,

4d58) + 160

[5] fd5aaab4 _cmutex_lock (fd7c0608, fd5cc000, ffffffff, fd742b64,

cd36a94e, fed3a3fd) + 84

[6] fd742b64 free (2820ab28, 2820ab28, 53475400, 7efefeff, 81010100,

ff00) + 18

[7] fd7537b4 tzcpy (2820ab28, fd7c2940, 0, 9, fd7bc008, ffbefe23) + 74

[8] fd753718 getzname (ffbefe2c, fd7bf564, 0, fd7bf564, ffbefe23, 0) + 50

[9] fd75321c _ltzset_u (46788ce1, fd7bc008, ff3e7a0c, ff3e8008, 2db30, 1)

  • 6c

[10] fd7523e4 localtime_u (cd36acc4, cd36ac3c, ff3a1f00, fd7bc008,

fd7bc008, 5) + 14

[11] fd7525ec localtime_r (cd36acc4, cd36ac3c, cd36acc4, 0, 0, 0) + 28

[12] fd7378a4 ctime_r (cd36acc4, cd36ae28, 3f, cd36add8, fd784928, 38) +

8

[13] fda0c580 FRGetTimeString (cd36ae28, 40, ffffffff, fd7bf789, cd36a94e,

fed3a3fd) + 14

[14] fda0c374 FRWriteMessage (cd36aec8, 0, fef5e614, 13e18c4, 800, 800) +

98

[15] fda0c258 FRLogMessage2 (0, 4180, 0, fd7bc008, fed39f10, 2f) + 44

[16] fda085c0 OSFaultCleanup (2, 1, fb800000, 0, fededba4, 0) + 3b4

[17] fd9e4d40 fatal_error (a, cd36ba48, 28c00, 28da4, fee5fca0, 0) + 1d8

[18] dbfc7964

_1cCosHSolarisPchained_handler6FpnJsigaction_ipnHsiginfo_pv_l (1,

fd9e4b68, dc13ce0c, cd36b790, fd9e4b68, 0) + 9c

[19] dbe0a7ac JVM_handle_solaris_signal (0, 35cd68, cd36b790, dc0c8000, a,

cd36ba48) + 7e4

[20] fd5bb118 __sighndlr (a, cd36ba48, cd36b790, dbe0a8cc, cd371e40,

cd371e30) + c

[21] fd5b811c sigacthandler (a, cd371d98, 0, 0, 0, fd5cc000) + 708

[22] — called from signal handler with signal 10 (SIGBUS) —

[23] fd741c98 _smalloc (10, fd7c27b8, 4, 10, 0, 0) + 8c

[24] fd741cd8 malloc (c, 1, fd7bc008, fd741ce4, 28b80fe8, 0) + 20

[25] fd736174 calloc (1, c, c, fffffff8, 0, 2ac417d9) + 54

[26] fbe70910 LCFieldlistAlloc (cd36bdf4, 1, 0, 0, 14, 2ac41788) + c0

[27] f6fd95f8 GetOracleMetadata (2cc85cf8, 2cc871c8, 2cc86eec, 2a6181, 0,

    • 230

[28] f6fd8fdc LCXExecute (2cc85cf8, cd36bfc4, 2a6181, 2d7ea5a0, 7, ea) +

110

[29] fbe7d080 retry_LCConnectionExecute (ea, cd36bfc4, 2a6181, 2d7ea5a0,

1000, 14400) + 1b4

[30] fbe7ce2c LCConnectionExecute (ea, cd36bfc4, 2a6181, 2d7ea5a0, 0,

cd36bfd9) + 14

[31] dcd3d314 _1cJConnectorRLSXDispatchMethod6MpnOLSADTMSGMETHOD__h

(537b6a0, cd36c12c, 2a6181, fededba4, 20, 209) + 2e0

[32] dcd466a8 LSXClassControl (0, 109, cd36c0a8, cd36c12c, 537b6a0, 20) +

21c

[33] fe7ea900

_1cLLSsInstanceLAdtCallBack6MpGp0nJLSIADTMSG_pnNLSADTINSTDESC_pv_h245nQtagLSREGNAMETYPE__h

(23d5668, dcd4648c, 109, 296ffd30, cd36c12c, 1) + 208

[34] fe8188a0 _1cJLScObjCliOProdMethodCall6MLrknF_GUID_HpnILSsValue__h

(296ffcf0, 209, 25156890, 3, 2d7ea5a0, ffff0000) + 30

[35] fe8447b8

_1cJLSsThreadQAdtDoProdCallout6MpnILSsValue_HpnNLSsExtCallout__v

(2d7ea2f0, 2d7ea590, 4, 25157bf0, 2244ec00, ffff0000) + c8

[36] fe84d778 _1cJLSsThreadENRun6M_h (2d7ea2f0, c, feeffd74, feeef80b,

feeffe34, feeef850) + 290c

[37] fe84dbec _1cJLSsThreadDRun6M_h (2d7ea2f0, 0, 2d7ea2f0, 23d5668,

28000, fffffffa) + c0

[38] fe7d0980 _1cJLSIThreadLRunInternal6MhLnLtagTIMEDATE_i_H (0, 2, 0,

cd36c3e4, 1, 2c00) + 74

[39] fe7d0d40 _1cJLSIThreadPRunToCompletion6MLi_H (11b3030, 0, 1, 0,

27000, 273fc) + 21c

[40] fe7ca1e4 _1cMCLSIDocumentJRunScript6MHhpchLL_H (107b998, fe7cdd40,

fededba4, fed02780, 0, 0) + 40c

[41] fe755bfc _1cVCRawActionLotusScriptDRun6MpnNCDefActionCtx_HpL_H

(1071dd8, 1076318, feee9c7c, fe743ca0, 0, 2760000) + 35c

[42] fe744e00 _1cKCRawActionDRun6MpnNCDefActionCtx_HpL_H (1071d98,

1076318, 276, cd36c7b4, a, 0) + 40

[43] fe7445e8 _1cKCRawActionHExecute6MpnNCDefActionCtx__H (1071d98,

1076318, 40, 10, 0, 1050718) + 1c4

[44] fe74df80 _1cKCAssistantIRunAlone6MpnNCDefActionCtx__H (1050718,

1076318, fe7684d0, fe743ca0, 0, 8) + 8

[45] fe74da68 _1cKCAssistantDRun6MpnVtagASSISTRUNCTXSTRUCT__H (1050718,

cd36db68, cd36d7cc, 1, fc00, ff93) + 1600

[46] fe767fa8 AgentRun (1050718, 1076318, 48257300, 10, 107b718, 0) + 57c

[47] fcdd4904 _1cGNAgentDRun6MpnIUserInfo__i (cd36efe4, 0, 1076318,

ec63e4, 500, fededba4) + 198

[48] fce706c8 _1cKCmdHandlerSHandleOpenAgentCmd6MpnMOpenAgentCmd__i (11,

1067f18, 105ce20, fd246194, 0, 976ac) + 1a8

[49] fcd4e314 _1cKCmdHandlerKPrivHandle6MpnDCmd__i (976ac, 1067f18,

cd37022c, fd268398, 503138, 26) + 58

[50] fcd4e490 1cKCmdHandlerHHandler6FpnDCmd_pv_nNRequestStatus

(1067f18, 976ac, fcd4e2bc, 4a05c8, 7c00, 7e94) + 148

[51] fcdb5be0

_1cbCInotesHTTPProcessRequestImpl6FpnS_InotesHTTPrequest__i (2576d7c,

1f4, 1067f18, 0, 0, cd370fe4) + 694

[52] fcdb5504 InotesHTTPProcessRequest (2576d7c, 1, 4e, 0, 876bc, ff00) +

4

[53] ff25af50 _1cPHTInotesRequestOProcessRequest6M_i (2576d70, ff29d684,

0, a79c, 0, a400) + 2c

[54] ff254e30

_1cVHTRequestExtContainerOProcessRequest6MnTHTApplicationSpaces__i (3, 5,

1b8, 0, ffffff3c, ff2e25e4) + 2bc

[55] ff26a1a8 _1cJHTRequestOProcessRequest6M_i (2576944, 2577134, 0,

ff2e989c, 0, 0) + ab0

[56] ff2716e8 _1cJHTSessionMStartRequest6M_v (40d5dc, 450, 800, a38,

40d7d4, f97ef4) + 3fc

[57] ff28192c _1cOHTWorkerThreadMCheckForWork6M_v (311d38, 0, 0, 0,

fcc3, ff2e989c) + 17c

[58] ff281710 _1cOHTWorkerThreadKThreadMain6M_v (311d38, 2, a514,

ff300c18, ff28168c, 25000) + 84

[59] ff27cd28 HTThreadBeginProc (311d38, 1, 1, 251f4, 0, 13e8abc) + 34

[60] fda04f40 ThreadWrapper (5a14, fb7486f0, 5800, 5a18, fb7486f0, 5a1c) +

124

[61] fd5bb01c _thread_start (0, 0, 0, 0, 0, 0) + 40

** VThread [ http:16768: 93]

.Mapped To: PThread [ http:16768: 106]

… Database: /ccbla03/lasxp03/appl/ccsimages.nsf

… DBH: 448, By: CN=EngChoo Tan/OU=MKS/O=SIA

… doc: HDB=448, ID=1486, H=4121, class=0200, flags=0001

… doc: HDB=448, ID=0, H=630, class=0001, flags=0000

… DBH: 545, By: CN=Veeramani Manoharan/OU=VENDOR/O=SIA

… DBH: 535, By: CN=Veeramani Manoharan/OU=VENDOR/O=SIA

… doc: HDB=535, ID=454794, H=287, class=0001, flags=0100

… doc: HDB=535, ID=1486, H=3349, class=0200, flags=0000

… doc: HDB=535, ID=454814, H=530, class=0001, flags=0000

… DBH: 431, By: CN=Veeramani Manoharan/OU=VENDOR/O=SIA

… DBH: 460, By: CN=Veeramani Manoharan/OU=VENDOR/O=SIA

… Database: /ccbla03/lasxp03/appl/ccsadmin.nsf

… DBH: 565, By: CN=Veeramani Manoharan/OU=VENDOR/O=SIA

… SOBJ: addr=0x07ee3b34, h=0xf010429d t=cf02 (BLK_FT_STATIC)

… SOBJ: addr=0x008be57c, h=0xf0104584 t=c30a (BLK_LOOKUP_THREAD)

… SOBJ: addr=0x02713548, h=0xf01042e7 t=c820

(BLK_CLIENT_OPENSESSION_TIME)

… SOBJ: addr=0x005163e4, h=0xf0104548 t=c436 (BLK_LSITLS)

… SOBJ: addr=0x0003e4b4, h=0xf010423a t=c130 (BLK_TLA)

… SOBJ: addr=0x00f1f698, h=0xf0104573 t=c275 (BLK_NSFT)

… file: fd: 160, /ccbla03/lasxp03/appl/ccsimages.nsf

NSD 2: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[1] fd79f428 lwp_sema_wait

[2] fd5a96dc _park

[3] fd5a90d8 _swtch

[4] fd5aada0 _mutex_adaptive_lock

[5] fd5aaab4 _cmutex_lock

[6] fd742b64 free

[7] fd7537b4 tzcpy

[8] fd753718 getzname

[9] fd75321c _ltzset_u

[10] fd7523e4 localtime_u

[11] fd7525ec localtime_r

[12] fd7378a4 ctime_r

[13] fda0c580 FRGetTimeString

[14] fda0c374 FRWriteMessage

[15] fda0c258 FRLogMessage2

[16] fda085c0 OSFaultCleanup

[17] fd9e4d40 fatal_error

[18] de7c7964 _1cCosHSolarisPchained_handler6FpnJsigaction_ipnHsiginfo_pv_l

[19] de60a7ac JVM_handle_solaris_signal

[20] fd5bb118 __sighndlr

[21] fd5b811c sigacthandler

[22] — called from signal handler with signal 11 (SIGSEGV) —

[23] fd741c98 _smalloc

[24] fd741cd8 malloc

[25] fd736174 calloc

[26] fbe70910 LCFieldlistAlloc

[27] df540328 _1cJFieldlist2t6MpnKLSXSession_pnOLSADTMSGCREATE_L_v

[28] df545d74 _1cMCreateObject6FpnOLSsLsxInstance_pnNLSADTINSTDESC_nNLSADTMSGPARAM__h

[29] df546670 LSXClassControl

[30] fe7ea8b4 _1cLLSsInstanceLAdtCallBack6MpGp0nJLSIADTMSG_pnNLSADTINSTDESC_pv_h245nQtagLSREGNAMETYPE__h

[31] fe81733c 1cJLSsObjMgrMCreateObjCli6MrknF_GUID_pnILSsValue_H_pnJLScObjCli

[32] fe84450c _1cJLSsThreadSAdtCallConstructor6MpnILSsValue_pnGLSsAdt_2H_v

[33] fe84b860 _1cJLSsThreadENRun6M_h

[34] fe84dbec _1cJLSsThreadDRun6M_h

[35] fe7d0980 _1cJLSIThreadLRunInternal6MhLnLtagTIMEDATE_i_H

[36] fe7d0d40 _1cJLSIThreadPRunToCompletion6MLi_H

[37] fe7ca1e4 _1cMCLSIDocumentJRunScript6MHhpchLL_H

[38] fe755bfc _1cVCRawActionLotusScriptDRun6MpnNCDefActionCtx_HpL_H

[39] fe744e00 _1cKCRawActionDRun6MpnNCDefActionCtx_HpL_H

[40] fe7445e8 _1cKCRawActionHExecute6MpnNCDefActionCtx__H

[41] fe74df80 _1cKCAssistantIRunAlone6MpnNCDefActionCtx__H

[42] fe74da68 _1cKCAssistantDRun6MpnVtagASSISTRUNCTXSTRUCT__H

[43] fe767fa8 AgentRun

[44] fcdd4904 _1cGNAgentDRun6MpnIUserInfo__i

[45] fce706c8 _1cKCmdHandlerSHandleOpenAgentCmd6MpnMOpenAgentCmd__i

[46] fcd4e314 _1cKCmdHandlerKPrivHandle6MpnDCmd__i

[47] fcd4e490 1cKCmdHandlerHHandler6FpnDCmd_pv_nNRequestStatus

[48] fcdb5be0 _1cbCInotesHTTPProcessRequestImpl6FpnS_InotesHTTPrequest__i

[49] fcdb5504 InotesHTTPProcessRequest

[50] ff25af50 _1cPHTInotesRequestOProcessRequest6M_i

[51] ff254e30 _1cVHTRequestExtContainerOProcessRequest6MnTHTApplicationSpaces__i

[52] ff26a1a8 _1cJHTRequestOProcessRequest6M_i

[53] ff2716e8 _1cJHTSessionMStartRequest6M_v

[54] ff28192c _1cOHTWorkerThreadMCheckForWork6M_v

[55] ff281710 _1cOHTWorkerThreadKThreadMain6M_v

[56] ff27cd28 HTThreadBeginProc

[57] fda04f40 ThreadWrapper

[58] fd5bb01c _thread_start

Subject: LsxLC crashed server

Hi,

This just struck me since you’d said that ur agent “crashes ur server once or twice in a month”!

Is “Run Web Agents asynchronously” Enabled in your server document? U can check the same from the NOTES.INI from setting DominoAsynchronizeAgents = 0/1

If yes then you must make sure your LSX code is thread-safe. U can find information on the same Notes Designer Help itself. Also am not sure if this is the reason for your server crash.

Sorry if my post is lil vague…

Regds,

Bruno.

Subject: RE: LsxLC crashed server

Hi Bruno,

Thanks for the suggestion… Yes, “Run Web Agents asynchronously” is Enabled in the server.

I have tried running the agent concurrently and it is working. I suspect whether thread safe is a cause. Anyway will give a try.

How to make the agent thread safe?.. Read the help but no useful information. Any suggestion

Also Iam using Solaris plaftform. I have read some forums that LSX is not working properly in Solaris. Is that may be cause…