Fulltrim on an agent array crashes the notes client

Hi,

when I build an array of agents, and remove a few from that array:

agentlist = db.Agents

Forall a In agentlist

	vtarget = a.target

	Select Case vtarget

	Case TARGET_SELECTED_DOCS : Set a = Nothing

	Case TARGET_ALL_DOCS_IN_VIEW : Set a = Nothing

	Case TARGET_UNREAD_DOCS_IN_VIEW : Set a = Nothing	

	End Select

End Forall

the following line:

agentlist = Fulltrim(agentlist)

crashes my client - reproducible

Of course will I find a work around - but…

Uwe

Subject: first: you’re right / second: WHY?

you’re right: it crashes in perhaps all versions of notes (i checked in R6.53 and 8.01)

but your action makes no sense: why do you want to fulltrim an agents-array? it won’t return ‘empty agents’…

Subject: RE to 2nd - to remove agents which I do not want in my collection

WHY: as shown in the code snippet: I wanted to remove certain types of agents.

So my idea was to replace them with “nothing” and fulltrim that array at last - with the known crash result.

I changed the code: Now I copy the names of wanted agents into a 2nd, dynamic string array.

=====================================

Forall a In agentlist

	vtarget = a.target

	AName = a.Name

	If (vtarget <> TARGET_SELECTED_DOCS And vtarget <> TARGET_ALL_DOCS_IN_VIEW And vtarget <> TARGET_UNREAD_DOCS_IN_VIEW) Then

		Redim Preserve AgentNamesArray(i)

		If Instr(AName,"|") > 0 Then

			AName = Strleft(AName,"|")

		End If

		AgentNamesArray(i) = AName

		i = i+1

	End If

End Forall	

It works and is OK for me - I just wanted to post that crash (because I strongly believe that “I, a notes developer” should NOT be able to crash the client with any LS or @formula coding).

Uwe

Subject: crashes in 6.5.6 as well

Dim ses As New NotesSession

x = ses.CurrentDatabase.Views

x = Fulltrim(x)

'or

x = ses.CurrentDatabase.Agents

x = Fulltrim(x)

you dont need to clear out any of the entries, just pass it along and it’ll crash. doesnt like arrays of objects

Subject: Any NSD?

Hi

Can you post the FATAL THREAD section of the NSD files with the few lines under it

For example:

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

FATAL THREAD 1/2 [ domdsm:107a8:67076]

FP=0x0012a34c, PC=0x60069a86, SP=0x0012a2f0, stksize=92

EAX=0x01a3088c, EBX=0x01a48650, ECX=0x0000bffe, EDX=0x01a325e6

ESI=0x00004000, EDI=0x0032ff78, CS=0x0000001b, SS=0x00000023

DS=0x00000023, ES=0x00000023, FS=0x0000003b, GS=0x00000000 Flags=0x00010206

Exception code: c0000005 (ACCESS_VIOLATION)

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

@[ 1] 0x60069a86 nnotes._fdDelete@4+118 (4000,12a368,608770ef,4000)

@[ 2] 0x60069a0c nnotes._OSFileClose@4+12 (4000,12adc0,12a380,60872ea7)

@[ 3] 0x608770ef nnotes._sqloclose+15 (4000,12b59c,5010,0)

@[ 4] 0x60872ea7 nnotes._sqlpgclf+71 (12adc0,1aaa2cb,70,1aaa2f3)

@[ 5] 0x60885458 nnotes._sqlpgfdl+616 (12b9a4,1aaa2cb,41,12be44)

@[ 6] 0x60876a6f nnotes._sqlpgcdl+927 (12bf44,12b9a4,0,12be44).

Date

Topic

Frequently asked question - How to analyze Notes/Domino NSDs? (Jean-Yves Riverin)

JYR

Subject: NSD Fatal Thread

Hi Jean-Ives, here it is:

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

FATAL THREAD 1/16 [ NLNOTES: 0e5c: 0bd0]

FP=0x0013d460, PC=0x60144742, SP=0x0013d438

stkbase=00140000, total stksize=212992, used stksize=11208

EAX=0xffffffff, EBX=0x00000000, ECX=0x00000000, EDX=0x00000000

ESI=0x0013d4e4, EDI=0x00000000, CS=0x0000001b, SS=0x00000023

DS=0x00000023, ES=0x00000023, FS=0x0000003b, GS=0x00000000 Flags=0x00010246

Exception code: c0000094 (INT_DIVIDE_BY_ZERO)

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

@[ 1] 0x60144742 nnotes.LSsThread::ArrayInitBounds+370 (64443f0,6368374,0,13d4a8)

@[ 2] 0x60b05c9b nnotes.LSsThread::ArrayCreateNewDynamic+75 (64443f0,3fb028,13d4c8,1)

@[ 3] 0x60afd0f4 nnotes.LScBuiltIn::FullTrim+484 (64445e4,3fb028,1,64443f0)

@[ 4] 0x600dec78 nnotes.LSsThread::OP_BUILTIN+216 (60afcf10,81,1,6552514)

@[ 5] 0x6002011c nnotes.LSsThread::NRun+204 (64443f0,3fa140,3fb028,13d610)

@[ 6] 0x60021ed6 nnotes.LSsThread::Run+182 (64443f0,13d5f8,6207c0fa,3fb028)

@[ 7] 0x600a8d2d nnotes.LSsInstance::Resume+29 (3fb028,3fa078,0,3fa140)

@[ 8] 0x6207c0fa nnotesws.LSEcInstance::StepClientScript+106 (3fa078,6552614,3fa078,0)

@[ 9] 0x616a53df nnotesws.LSEcInstance::Resume+239 (3fa078,0,6552614,0)

@[10] 0x6207c5f8 nnotesws.LSEcInstance::DebugClientScript+168 (3fa078,6552514,2,13d8c4)

@[11] 0x6207b0d2 nnotesws.LSEDebugStepInto@8+18 (3fa078,6552514)

@[12] 0x61af7fd9 nnotesws.CLSDDocument::DebugScript+217 (6563e74,2)

@[13] 0x61afcf67 nnotesws.CDebuggerPaneSubprogram::ExecuteScript+215 (6553814,2)

@[14] 0x61afcada nnotesws.CDebuggerPaneSubprogram::WMCtrlNotify+74 (6554814,704e2)

@[15] 0x61afc975 nnotesws.CDebuggerPaneSubprogram::SubMessageProc+933 (6554814,111)

@[16] 0x61684d09 nnotesws.MainWndProc@16+7881 (704e2,111,80000007,904c4)

[17] 0x7e418734 USER32.GetDC+109 (61682e40,704e2,111,80000007)

[18] 0x7e418816 USER32.GetDC+335 (0,61682e40,704e2,111)

[19] 0x7e41b4c0 USER32.DefWindowProcW+388 (8b7390,111,80000007,904c4)

[20] 0x7e41b50c USER32.DefWindowProcW+464 (13dea4,18,8b7390,111)

[21] 0x7c90eae3 ntdll.KiUserCallbackDispatcher+19 (8b7390,111,80000007,904c4)

[22] 0x7e42f3cc USER32.SendMessageA+73 (704e2,111,80000007,904c4)

@[23] 0x6168b3d3 nnotesws.BmpButtonWndProc@16+2819 (6554a14,202,0,a0026)

[24] 0x7e418734 USER32.GetDC+109 (6168a8d0,904c4,202,0)

[25] 0x7e418816 USER32.GetDC+335 (0,6168a8d0,904c4,202)

[26] 0x7e4189cd USER32.GetWindowLongW+295 (13e25c,0,13e214,7e42d99d)

[27] 0x7e418a10 USER32.DispatchMessageW+15 (13e25c,7e42f383,1a,13e25c)

[28] 0x7e42d99d USER32.IsDialogMessageW+219 (704e2,7f96f8,604e8,0)

@[29] 0x617d2097 nnotesws.ModelessWindowDispatch+247 (1,3fa078,6552614,0)

@[30] 0x617d21e4 nnotesws.NEMMainLoopIDE@8+260 (0,0)

@[31] 0x61af839f nnotesws.CLSDDocument::LoadObject+175 (6550001,6555514)

@[32] 0x61af8b3d nnotesws.CLSDDocument::AddScriptObject+477 (6563b14,655267c)

@[33] 0x61af766c nnotesws.CLSUIDocument::RunScript+364 (1c32854,168)

@[34] 0x605f2417 nnotes.CRawActionLotusScript::Run+679 (16d,6552614)

@[35] 0x605ee88a nnotes.CRawAction::Run+58 (0,6552514)

@[36] 0x605ef49d nnotes.CRawAction::Execute+221 (65522b4,0)

@[37] 0x605e77e6 nnotes.CAssistant::RunAlone+22 (6553014,6552514)

@[38] 0x605ec816 nnotes.CAssistant::Run+3590 (6553014,13ef14)

@[39] 0x61ae8872 nnotesws.RunAssistantEx@28+482 (1c30814,1c30172,0,0,0,0,0)

@[40] 0x61ae8bf0 nnotesws.RunAssistant@20+32 (1c30814,0,0,0,0)

@[41] 0x62069c00 nnotesws.CAgentDocSelection::Command+96 (6552814,13f05c,40280005,0,0)

@[42] 0x617d10ff nnotesws.CSelectionManager::ProcessCommand+1167 (1,40280005,0,0,0)

@[43] 0x617d124d nnotesws.ProcessWMCommand@8+173 (40280005,0)

@[44] 0x61683eca nnotesws.MainWndProc@16+4234 (703fe,111,40280005,0)

[45] 0x7e418734 USER32.GetDC+109 (61682e40,703fe,111,40280005)

[46] 0x7e418816 USER32.GetDC+335 (0,61682e40,703fe,111)

[47] 0x7e41c63f USER32.IsWindowUnicode+161 (61682e40,703fe,111,40280005)

[48] 0x7e41f65d USER32.CallWindowProcA+27 (61682e40,703fe,111,40280005)

[49] 0x052326db ncodesnip.GetFileVersion@4+5851 (5233170)

[50] 0x7e418816 USER32.GetDC+335 (0)

[51] 0x7e4189cd USER32.GetWindowLongW+295 (13f7b4)

[52] 0x7e418a10 USER32.DispatchMessageW+15 (13f7b4)

@[53] 0x6171a0b6 nnotesws.NEMMainLoop@4+742 (4013d0)

@[54] 0x0040197b NLNOTES.WinMain@16+1451 (617595a0,0,16231c,1)

@[55] 0x00401e39 NLNOTES.WinMainCRTStartup+389 (12b1bc,7c90ee18,7ffde000,8054a6ed)

[56] 0x7c816fd7 kernel32.RegisterWaitForInputIdle+73 (401cb4,0,78746341,20)

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

PASS 2 : FATAL THREAD with STACK FRAMES 1/16 [ NLNOTES: 0e5c: 0bd0]

FP=0013d460, PC=60144742, SP=0013d438

stkbase=00140000, total stksize=212992, used stksize=11208

Exception code: c0000094 (INT_DIVIDE_BY_ZERO)

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

Disassembly of c. 10 instructions before and after faulting address 60144742:



    60144728 66b80900         mov     ax,0x9

    6014472c 5b               pop     ebx

    6014472d 8be5             mov     esp,ebp

    6014472f 5d               pop     ebp

    60144730 c21800           ret     0x18

    60144733 8b550c           mov     edx,[ebp+0xc]             ss:01d080c6=00124500

    60144736 8b4204           mov     eax,[edx+0x4]             ds:01bcac66=00088525

    60144739 0fb74806         movzx   ecx,word ptr [eax+0x6]        ds:01bcac66=8525

    6014473d 83c8ff           or      eax,0xff

    60144740 33d2             xor     edx,edx

FAULT ->60144742 f7f1 div ecx

    60144744 8b7518           mov     esi,[ebp+0x18]            ss:01d080c6=00124500

    60144747 3bf0             cmp     esi,eax

    60144749 760d             jbe     60144758

    6014474b 5f               pop     edi

    6014474c 5e               pop     esi

    6014474d 66b8ab00         mov     ax,0xab

    60144751 5b               pop     ebx

    60144752 8be5             mov     esp,ebp

    60144754 5d               pop     ebp

    60144755 c21800           ret     0x18

    60144758 8bd1             mov     edx,ecx

and a bit down (i looked for 60144742):

@[ 1] 0x60144742 nnotes.LSsThread::ArrayInitBounds+370 (64443f0,6368374,0,13d4a8)

        0013d460 94D41300 9B5CB060 F0434406 74833606 | .... .\.` .CD. t.6. |

        0013d470 00000000 A8D41300 13000000 E4D41300 | .... .... .... .... |

        0013d480 E8823606 DC823606 13000000 00000000 | ..6. ..6. .... .... |

        0013d490 74833606                            | t.6.                |

Kind Regards, Uwe

Subject: array can’t reference itself

looking in the designer help, it would appear that you can’t do agentlist=fulltrim(agentlist)

You need to do this:

dim localarray

localarray=fulltrim(agentlist)