5

I am trying to create 100-300 HTTP objects/requests at the same time using MSXML2.serverXMLHTTP.6.0 or WinHttp.WinHttpRequest.5.1.

These requests are created on separate threads using a test application. Everything works fine with up-to 90 create objects/requests running at the same time.

When more then 100 are created/called at the same time, the application crashes with an exception in KERNELBASE.dll.

Code:

CreateObject("MSXML2.serverXMLHTTP.6.0")
CreateObject("WinHttp.WinHttpRequest.5.1")

set obj = CreateObject("MSXML2.serverXMLHTTP.6.0")
'set obj = CreateObject("WinHttp.WinHttpRequest.5.1")

obj.open "GET", "https://httpbin.org/get", true
'https://resttesttest.com/

obj.send   ' Mostly crashes here.
obj.WaitForResponse

result =  obj.responseTEXT

set obj = Nothing

Event Viewer Report:

Faulting module name: KERNELBASE.dll, version: 6.1.7601.18015, time stamp: 0x50b83c8a Exception code: 0xc00000fd Faulting module path: C:\Windows\syswow64\KERNELBASE.dll

I have tried with Async being set to "true" and set to "false".

Can anyone please provide any pointers to debug this?

Bugs
  • 4,491
  • 9
  • 32
  • 41
DoIt
  • 313
  • 3
  • 12
  • It's not clear to me exactly how your code demonstrates the problem. Are you running this code 100 times in some sort of outer loop? Are you running multiple copies of your application? Are you doing some crazy stuff with threads? Please ensure you're providing a [mcve]. –  Apr 06 '17 at 15:35
  • 2
    What do you mean by "These requests are created on separate threads"? Do you fiddle with manual multithreading in VBA? – GSerg Apr 06 '17 at 16:48
  • I am running this vb script on a multi threaded VOIP application. This application has multiple voice channels (which can run vb scripts), running this script on up-to 90 channels works fine. Crash is reported with more than 100 objects. Script does not do anything other than sending request and waiting for result. – DoIt Apr 06 '17 at 18:09
  • 4
    There is no "vb script" but perhaps you are trying to say VBScript? In that case this is not VBA or VB6. Why tag it as such? It might actually be VBA but it surely isn't VB6. – Bob77 Apr 07 '17 at 06:11
  • I think you found the right forum for this problem. 0xc00000fd is the code for Stack Overflow :). This means that you are storing too much information on the stack. I would check two things: (1) Does your environment use recursion in some form? (2) Does your environment store data related to each instance in local variables? If so, you should use less memory on the stack (e.g. iterating instead of recursing or by using more memory on the heap) or you should increase the size of the stack. The exact method to this, however, depends on your environment, which I didn't see, yet. – z32a7ul Apr 07 '17 at 08:12
  • I'm thinking you need to release some resources. Can you set some logic to break at say 99? E.g. objCount = objCount + 1 if objCount = 99 etc? – Absinthe Apr 10 '17 at 20:07

2 Answers2

1

If you are doing this to thrash your REST server and stress test it for volume/throughput then I can suggest you give yourself multiple processes each with their own thread pool (although I'm still not clear how you managed to create your own threads with VBScript).

S Meaden
  • 8,050
  • 3
  • 34
  • 65
  • I think the OP has said that the VOIP application is multi-threaded and each thread is launching it's own VBScript. – ThunderFrame Apr 12 '17 at 06:03
0

If you have exhausted other possible cause I would make sure that there is not something wrong with the .dll here is the system file repair tool

https://support.microsoft.com/en-us/help/929833/use-the-system-file-checker-tool-to-repair-missing-or-corrupted-system-files

Also, I did a little digging into that specific .dll and most issues with KERNALBASE.dll are related to incompatibility between 32 and 64 bit applications

https://social.msdn.microsoft.com/Forums/vstudio/en-US/2556a86b-f82e-4efb-bcdd-19919facbff6/application-error-faulting-module-name-kernelbasedll-version-61760016385?forum=vcgeneral

http://zahirkhan.com/dotnet/faulting-module-path-kernelbasedll

I hope that this resolves your issue or at least gets you moving in the right direction.

Dillon_Su
  • 91
  • 7