NetTalk Central

Author Topic: NTWS crashing with 'Index Out Of Range'...  (Read 4180 times)

Devan

  • Full Member
  • ***
  • Posts: 230
    • View Profile
    • Email
NTWS crashing with 'Index Out Of Range'...
« on: December 14, 2011, 11:50:40 PM »
This is happening to one of our sites almost on a daily basis, and I am at my wits end trying to duplicate it in our test environment.

I have recompiled the project with GPF Reporter etc., but because the program isn't actually GPFing, I am not getting the log (or a notification that the EXE is down).  It just pops up the message box with 'Index Out Of Range' and that stops the EXE from handling any more threads with users until the app is shut down and restarted.

The program is compiled in full debug mode.  Is there any way to trap this run time error when it happens, and either automatically kill the thread, or generate some sort of debug report that I can use to trace where it is happening?

Thanks,
Devan

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: NTWS crashing with 'Index Out Of Range'...
« Reply #1 on: December 15, 2011, 12:37:24 AM »
Hi Devan,

I tried to find that error in the Clarion Help but could not. I think it is caused by string slicing eg Name[5:6] = 'ie' where the slice is out of bounds but I could be totally wrong. So not sure if you use this technique anywhere including on blobs.

The other way to track it down is to add a p_web._trace to the start of ever procedure and leave debugview running. It should then tell you the last procedure called before the error and then adding more traces to isolate the code. Of course the error may be in a 3rd party library. Still, a slow and painful way to track it down.

Good luck...

Kev

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NTWS crashing with 'Index Out Of Range'...
« Reply #2 on: December 15, 2011, 06:03:20 AM »
Index Out Of Range means an array is being used, where the index(s) of the array exceed the boundaries for the array variable.

For example
x  Long,dim(5)

  x[0] = 1
  x[6] = 2
both these lines would generate an Index out Of Range.
A string is an implicit array so accessing str[0] or str[len+x] would also both trigger this error.

In C6 you were able to GPF the app when an IOOR error occurred - very useful because then the GPF Log shows you exactly where the error is. I've lobbied for this to be added back to C8, but not successfully(not yet anyway).

your best bet for at least narrowing the search area is the logs. check the most recent request - that may give you some clues.
A visual inspection of any array variables you may have - or any string slicing you may be doing is a good idea, but of course that's not to say the error might not be somewhere in the generated code - anything is possible.

Another option may be to compile the app with "Array Index checking" turned _off_. In this case you won't get the error - indeed it's a complete lottery what you will get - but if you're lucky you'll get a GPF, and enough info in the log to get closer.

cheers
Bruce




terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: NTWS crashing with 'Index Out Of Range'...
« Reply #3 on: December 15, 2011, 07:15:22 AM »
Devan
This is probably out of left field  and probably has nothing to do with your problem but I had this error when I converted an application (NOT NTWS) from Clarion6 to Clarion8.
Following a thread in the Clarion8 newsgroup I disabled FM3 and the application worked.
I am working with Geoff at CapeSoft to track down the problem since the Clarion6 app is very solid and in operation at many sites running operating systems from Windows 98 to Windows 7 64 bit and most Windows Servers.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: NTWS crashing with 'Index Out Of Range'...
« Reply #4 on: December 16, 2011, 03:44:30 AM »
Hi all,

Devan is not alone. I have this too every now and then.
I am still trying to recall the steps I have executed with my app when it happens.
Closing the thread does not allways help. Restarting the app neither.

I am using Firefox. And I have a hint of a clue that closing down FF and restarting it seems to help.
That is, the site can be connected to after restarting FF. But this might be completely off.

Rene
Rene Simons
NT14.14