VB6 Timer(), Space() Form_Initialize() causes Immediate Crash - windows-7

Create a new VB6 project. Paste the code below as your project code. Hit Run. See if it crashes... Remove or simplify anything you like in this code, and then it will work fine. Can anyone please shed some light on why this is crashing?
This has been tested on eight PC's so far, all running various combinations of Windows XP, Windows Vista, Windows 7, Office 2010, and Office 2007. The ones where it was tested in the Visual Basic IDE have Visual Basic 6 SP 6 installed.
Private Sub Sleep(ByVal nSeconds As Long)
Dim nStart As Long: nStart = Timer
Do
DoEvents
Loop Until (Timer - nStart) >= nSeconds
End Sub
Private Sub Crash()
Dim sTempPath As String: sTempPath = Space(255)
End Sub
Private Sub Form_Initialize()
Sleep 1
Crash
End Sub
Addendum #1:
I put this as a macro in Excel 2010, replacing Form_Initialize() with Workbook_Open(), and sure enough, when you open the document. It crashes!
Addendum #2:
I added break points to every line before hitting "Run" and it crashed before it got to the first break point. But again, if I simplify or remove anything in this, it works fine and does not crash.
Addendum #3:
Tried MicSim's suggestion of removing the colon, and it did not crash. Added it back, ran it again and it did not crash. Closed Visual Basic, and put in the original code and it crashed.
Addendum #4:
Problem Details from Visual Basic 6 IDE:
Problem signature:
Problem Event Name: APPCRASH
Application Name: VB6.EXE
Application Version: 6.0.81.76
Application Timestamp: 3592011f
Fault Module Name: VBA6.dll
Fault Module Version: 6.0.0.8169
Fault Module Timestamp: 358b0c74
Exception Code: c0000005
Exception Offset: 00026329
OS Version: 6.1.7601.2.1.0.256.4
Locale ID: 1033
Additional Information 1: 7e3b
Additional Information 2: 7e3beb1e9ccf6d519c5b994ca59a280f
Additional Information 3: 7b83
Additional Information 4: 7b833c57ebcf54809fd3aaccd8ea4f46
Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt
Addendum #5:
Problem Details from Microsoft Excel 2010:
Problem signature:
Problem Event Name: APPCRASH
Application Name: EXCEL.EXE
Application Version: 14.0.4756.1000
Application Timestamp: 4b9c08e8
Fault Module Name: VBE7.DLL
Fault Module Version: 7.0.15.90
Fault Module Timestamp: 4b7b1248
Exception Code: c0000005
Exception Offset: 00045b6a
OS Version: 6.1.7601.2.1.0.256.4
Locale ID: 1033
Additional information about the problem:
LCID: 1033
skulcid: 1033
Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt

After reviewing your question and all the addendums, I realized that your computer is running the release version of VB6, and not SP6.
Your crash details indicate the following versions:
VB6.exe: 6.0.81.76
VBA6.dll: 6.0.0.8179
The exact build numbers of Visual Basic 6.0 SP6 files are as follows:
VB6.exe: 6.0.97.82
VBA6.dll: 6.0.0.9782
Exception code c0000005 corresponds to an access violation in module vba6.dll. A similar problem is documented on Microsoft KB
I have not found an accurate source listing build numbers for each VB6 service packs, but it looks like this is the RTM version. Even though you might have installed SP6 yourself, a rogue installer may have overwritten shared system files by an older version after the service pack was installed. This would explain why a lot of users commented that the code is working fine for them with a seemingly similar setup.

Related

VB6 Crystal Reports 8.5.0.217 - Access Violation Application Crash

Background:
Our company uses Crystal Reports in our legacy product written in VB6 which I'm performing some maintenance duties for.
Its using version 8.5.0.217 [RTM] with no service packs.
The Problem:
Has worked perfectly on Windows XP x86 to date.
In Windows 7 [x86 and x64] we get an Access Violation followed by an application crash and no further usable error information.
The Details:
The application crashes with a large datasets for any report using the active x viewer.
Visual Studio will crash whilst debugging.
The offending code is here:
Crv_Obj(0).ReportSource = ReportParametersFrm.Report
Crv_Obj(0).EnablePopupMenu = True
Crv_Obj(0).ViewReport
I have checked that:
Crv_Obj(0) is a valid object reference.
ReportParametersFrm.Report is a valid reference.
The only information I have is from the event viewer:
Faulting application name: Pyramid.exe, version: 2.2.0.8, time stamp: 0x51e53053
Faulting module name: craxdrt.dll, version: 8.5.0.217, time stamp: 0x3a849e1a
Exception code: 0xc0000005
Fault offset: 0x002ac3d1
Faulting process id: 0x15a8
Faulting application start time: 0x01ce8228a295c8c8
Faulting application path: C:\Program Files\Pyramid\Pyramid.exe
Faulting module path: C:\Program Files\Pyramid\CrystalSys\craxdrt.dll
I have also tried:
Disabling the DEP to no effect.
Changing Compatibility to Windows XP and below.
Running as both privileged and nonprivileged users.
Tried adding in new error handlers to catch the error
[Fruitlessly] searching on Google and this site.
Contacting SAP [to then be ignored].
What I need help with:
Have you seen this before?
Are there any workarounds or something I should be looking for that is obviously wrong?
Is there more recent version of Crystal that supports VB6 or at least
an upgrade path that you know of that I can attempt?
Any and all help would be most appreciated.
After quite a lot of research and digging around it seems that a slightly newer version of craxdrt.dll crviewer.dll fixes the problem.
Simply a case of replacing these libraries in the application lib folder and in C:\Windows\System32\
I've put a copy of the libs here in the event anyone else has this problem as there was very little consistent help/information out there on the internet.

Microsoft Visual Studio 2005 has stopped working?

Crashes on startup of VS2005 or any VS2005 project.
Not sure what has changed... other than our IT departement keeps doing updates... still no clue why?
Problem signature:
Problem Event Name: APPCRASH
Application Name: devenv.exe
Application Version: 8.0.50727.42
Application Timestamp: 4333e699
Fault Module Name: StackHash_b07c
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 00000000
Exception Code: c000041d
Exception Offset: 777e1221
OS Version: 6.1.7601.2.1.0.256.49
Locale ID: 1033
Additional Information 1: b07c
Additional Information 2: b07c9f334ed23629f31261200e2152db
Additional Information 3: c5e2
Additional Information 4: c5e2938eff61fd2d71b1da696b2907b3
Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt
Tried debugging and get this:(and just cycles back to the original error)

All of a sudden can't open solution in VS2010 - why?

So all of a sudden every time I open this one particular solution it crashes and gives me the following error. Anyone know what might be causing this? Here is the error I get:
Problem signature:
Problem Event Name: APPCRASH
Application Name: devenv.exe
Application Version: 10.0.40219.1
Application Timestamp: 4d5f2a73
Fault Module Name: KERNELBASE.dll
Fault Module Version: 6.1.7601.18015
Fault Module Timestamp: 50b83c8a
Exception Code: e0434352
Exception Offset: 0000c41f
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 1033
Additional information about the problem:
LCID: 1033
Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt
Just found the answer accidentally by searching the MSDN forums:
DELETE THE .SUO FILE
This fixed it! Thanks everyone!
This is a dublicate question (Why is Visual Studio crashing after a few seconds [StackOverflow], Visual Studio crash [StackOverflow]).
Possible Solutions
StackOverflow
StackExchange
MSDN Forums
Also see
/LCID (devenv.exe) [MSDN]

VS2005 crashes often when compiling

I can change one small thing commenting/un-commenting it and VS2005 will either crash or not crash for no additional reason in either case.
Problem signature:
Problem Event Name: APPCRASH
Application Name: devenv.exe
Application Version: 8.0.50727.867
Application Timestamp: 45d2c842
Fault Module Name: StackHash_0646
Fault Module Version: 6.1.7601.17725
Fault Module Timestamp: 4ec49b8f
Exception Code: c0000374
Exception Offset: 000ce6c3
OS Version: 6.1.7601.2.1.0.256.4
Locale ID: 1033
Additional Information 1: 0646
Additional Information 2: 06468f0034e46fb7e5e65a0a8a306ffb
Additional Information 3: 9aba
Additional Information 4: 9abaaa502ccb3837971bddc9d127747d
Since the above is really of no help to me, is there some way I can diagnose what's going on? All I'm able to get out of debugging the compile crash (in VS2005) that is that there is a corrupted heap.
Some options you can try out:
You can get a log when booting Visual Studio using /log as attribute.
http://msdn.microsoft.com/en-us/library/vstudio/ms241272(v=vs.80).aspx
Creating a crash dump
http://blogs.msdn.com/b/mikhailarkhipov/archive/2006/07/25/678308.aspx
Uninstall ReSharpen (if you use it)
Reinstall Visual Studio
Create a new Windows User and see if you get the same trouble
Ehh.. Solution: Get rid of the outdated buggy IDE and upgrade to a more recent one. Went to VSC15. No crashes since.

Fluent NHib causing visual studio 2010 hanging at runtime

Just installed and migrated a 2008 solution on Vista ultimate 64 and .net 4.0. Everything builds and tests run surprisingly well but I got the hang description below while trying to run the app under SQLite.
It turns out that the hang has got something to do when the call is made for FNH to build the session factory during a run, the only feedback I get is that the database wasn't configure properly without any inner exception. The strange part is that the exact code works perfectly under tests.
Any clues?
FluentNHibernate.Cfg.FluentConfigurationException was unhandled
Message: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.
* Database was not configured through Database method.
Description: A problem caused this
program to stop interacting with
Windows.
Problem signature: Problem Event
Name: AppHangB1 Application
Name: devenv.exe Application
Version: 10.0.30319.1 Application
Timestamp: 4ba1fab3 Hang
Signature: b9ed Hang Type: 6152
OS Version: 6.0.6002.2.2.0.256.1
Locale ID: 1033 Additional Hang
Signature
1: 005de38e6b4bb3afd8e147932c6431cc
Additional Hang Signature 2: d54c
Additional Hang Signature
3: 05f671c8289bf8dd31e6ccfe265baa77
Additional Hang Signature 4: 784c
Additional Hang Signature
5: c8207f54dadf3eb38dfcf1ae152f4229
Additional Hang Signature 6: ff83
Additional Hang Signature
7: 220932152f3f04fffb6ca3abf15e6dc6
This is a SQLite issue, not FNH; see this post

Resources