Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


How do I fix mscorwks.dll error?

Posted on 2009-04-01
Medium Priority
Last Modified: 2012-05-06
I am programming in 2008, .Net Framework 3.5 SP1 on a Vista computer.

I have ported my vb6 project to 2008. All was going great except when testing the new number crunching calculations with arrays that can get quite large. This creates and runs a batch file with 25000 runs.

I have tried run the program multiple times with the same input data for each of the 25000 times to make sure that the data is known and reliable each and every time.
Sometimes the program crashes at line 252, the next run at line 776, next at 345...that it to say that it is random. This happens on both a Vista and XP machines.

The first thing I did was check my event viewer:
Faulting application FlawCheck2008.vshost.exe, version 9.0.21022.8, time stamp 0x47316898, faulting module mscorwks.dll, version 2.0.50727.3074, time stamp 0x48ead734, exception code 0xc0000005, fault offset 0x00123bd9, process id 0xd48, application start time 0x01c9ac9433342989.
Event ID: 1000

Researching this error, I found 2 patches for mscorwks.dll, neither of which installs on my computer since apparently I don't need it.

Next step:
I am currently trying to figure this out with windbg.exe, and don't have much experience with this. I've never had to use it. This is what I have found:

0:005> K
ChildEBP RetAddr
0776fa8c 68d05dda mscorwks!WKS::gc_heap::mark_object_simple1+0x148
0776fab8 68c9f515 mscorwks!WKS::gc_heap::mark_object_simple+0x19d
0776faec 68c9efc1 mscorwks!WKS::gc_heap::c_drain_mark_list+0x95
0776fb18 68c9f9b3 mscorwks!WKS::gc_heap::c_mark_phase+0xaa
0776fb34 68d0ed65 mscorwks!WKS::gc_heap::gc1+0x59
0776fb4c 68d0edb7 mscorwks!WKS::gc_heap::gc_thread_function+0x9f
0776fb54 75e04911 mscorwks!WKS::gc_heap::gc_thread_stub+0x73
0776fb60 76e3e4b6 KERNEL32!BaseThreadInitThunk+0xe
0776fba0 76e3e489 ntdll!__RtlUserThreadStart+0x23
0776fbb8 00000000 ntdll!_RtlUserThreadStart+0x1b

0:005> r
eax=00000000 ebx=024ac378 ecx=08420a20 edx=0a110000 esi=024aaa38 edi=00000001
eip=68d05f16 esp=0776fa60 ebp=0776fa8c iopl=0 nv up ei pl zr na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010246
68d05f16 f70000000080 test dword ptr [eax],80000000h ds:0023:00000000=????????

I have done some research on the garbage collector and have added the IDisposable class to my number crunching classes.

Program still crashes ungracefully (to put it mildly)

I am having a problem with windbg.exe and using the sos.dll in order to use the !verifyheap to get the 'last good object'.

Any insights would be greatly appreciated.

Question by:Fleetech
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
LVL 83

Expert Comment

ID: 24047547
Do you use threading? What does the batch file do? What type of number crunching? Can you possibly show us some code snippet?

Author Comment

ID: 24051009
No I don't use threading, perhaps I should?  The batch (csv file) file holds the data for each run.  Each line in the batch file represents a complete analysis.  The file is read in and stored in a user defined structure.  

This is an engineering tool used in the calculation of fatigue and fracture in metal and so the number crunching routines are full of algorithms.  I have multiple classes depending on the type of calculations to be done and these are being instantiated and disposed of as needed.  

The area/class where I believe the problem is (I have commented out code and successfully run up to this point) holds 8 ArrayLists and many arrays to hold my data.  These ArrayLists can be as few as a couple of hundred up to a million entries depending on the analysis and how quickly the crack grows before the limits are reached.  As stated above, this code was ported from vb6 so I kept all the old code except in the calculations.  The data from the ArrayLists are then copied back to my class to hold results for reporting, graphing and file saving.

How do I get there?  See attached doc file.  

Thanks in advance for your help.  It is much appreciated.

LVL 83

Accepted Solution

CodeCruiser earned 2000 total points
ID: 24051189
You really need to consider your approach in my opinion. As you said the arrays could hold upto millions of items, you should consider using some other, more suitable, structure to hold these items. Arrays require continueous memory addresses and this may be part of the problem as it would be difficult to get contigeous memory for millions of items in array. Also consider using threading.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 24052011
I will start with trying threading first and see how that goes.  I've never done so and will have to learn how.  I'll let you know in a couple of days.

Also, you say that I should look for a more suitable structure to hold my items.  Could you point me in the right direction?

LVL 83

Expert Comment

ID: 24057863
If you show me what type of custom structures you are using and what type of arrays you are using then i may be able to suggest something specific. There are many options like Lists, Collections, Dictionay, HashTable, DataTable etc.

Author Comment

ID: 24107795
Hi again,

I have implemented threading and gone through my code and optimized it where I could.  So far I am cautiously optimistic.  I will know more when the code has been more thoroughly tested.

If all goes well, I will close the topic then and accept your solution.

LVL 83

Expert Comment

ID: 24110705
Glad to hear back from you. Hope it goes well.

Author Closing Comment

ID: 31570494
I added threading to my code, I optimized my code where I could and I added IDisposable to my classes.  The combination of these 3 helped my program to run again!  Thanks again!!!

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA:…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question