Strange MAV on Vista
Blitz3D Forums/Blitz3D Programming/Strange MAV on Vista
| ||
Hi there, Somebody using the trial version of my application reported me a "Memory Access Violation". After some investigation I sent to her a very basic program (a spinning cube) compiled with Blitz3D and, still, she has this "Memory Access Violation" on startup. Here follows the code: Graphics3D 640,480,32,2 SetBuffer BackBuffer() camera=CreateCamera() light=CreateLight() RotateEntity light,90,0,0 ; Create cube cube=CreateCube() PositionEntity cube,0,0,5 While Not KeyDown( 1 ) TurnEntity cube,0.1,0.1,0.1 RenderWorld Flip Wend End The executable is available here: http://www.slide-effect.com/tmp/cube1.exe Configuration where it crashes: Vista 64-bit with an AMD Phenom 9850 Quad-Core Processor 2.50 GHz, 6GB RAM, NVIDIA Geforce 9800 GT display adapter. I am aware of the texture flag problem on Vista, but this example does not use any texture at all. Any idea? I really pull my hairs off on this one. PS:It works perfectly on my 2 vista boxes and on my xp PC. |
| ||
1. Could be UAC? Try "Run as Administrator". 2. Are you forcing a weird screen resolution that the target PC may not like? The cube demo works fine here; Pentium Dualcore T2310 @ 1.5GHz, Intel GMA965 graphics, 2GB RAM, Vista Home Premium (32-bit). |
| ||
It runs windowed... (exactly the same code and executable as linked) UAC.. well.. maybe, I will ask her to run the sample as administrator.. but I cannot see why the UAC would do a memory access violation on a single exe that write nothing on the disk. Any other idea? My software works well on many other customers with Vista, and on my Vista Box with UAC enabled too. It seems that when I try to do related to DirectX it crashes... |
| ||
It runs windowed... (exactly the same code and executable as linked) The cube demo is running fullscreen here.Maybe you could find out what her native monitor resolution is, and hard code the cube demo to that. |
| ||
mmh my fault. I sent her 3 versions (windowed, full screen and textured) and all 3 versions are crashing. So I don't think it is the fault of the weird screen resolution (and I think all monitors are accepting 640x480 resolution) But anyway I asked her to test with "run as administrator" I am waiting her answer. |
| ||
Is every version using a 32-bit bitdepth ? |
| ||
Yes. But as the faulty computer uses a NVIDIA Geforce 9800 GT display adapter, I don't think it is the issue. (This is quiet a recent board that supports 32 bit display) Or maybe you think about something else? |
| ||
Try this version, it should at least tell you where the error occured (have her send you the log file):file=WriteFile("Error Log.txt") If file=0 Then RuntimeError "File could not be written, please move program." WriteLine file,"Log opened." Graphics3D 640,480,32,2 WriteLine file,"Graphics init ok" SetBuffer BackBuffer() WriteLine file,"Double buffering ok" camera=CreateCamera() WriteLine file,"Camera ok" light=CreateLight() WriteLine file,"Light ok" RotateEntity light,90,0,0 WriteLine file,"Light rotated ok" ; Create cube cube=CreateCube() WriteLine file,"Cube created ok" PositionEntity cube,0,0,5 WriteLine file,"Cube positioned ok" x=0 While Not KeyDown( 1 ) If x<4 Then WriteLine file,"Entered loop ok":x=x+1 TurnEntity cube,0.1,0.1,0.1 If x<4 Then WriteLine file,"Cube rotated ok":x=x+1 RenderWorld If x<4 Then WriteLine file,"Render ok":x=x+1 Flip If x<4 Then WriteLine file,"Switch buffers ok":x=x+1 Wend WriteLine file,"Exit loop, closing log." CloseFile file End |
| ||
Thanks, I sent it to my customer. In the meantime I have asked her to run DxDiag and everything seems to be correct. Very strange issue. |
| ||
Are you running a recent B3D version? The pre-V1.92 versions had issues with DEP (Data Execution Prevention) on computers that have it enabled. |
| ||
I have got 1.99 and 1.100 on my two development computers. |
| ||
Have you tried compiling the exe with Debug Enabled ? Maybe it says something else than "memory acces violation". And even though the graphics card may support 32-bit, it might be worth at least a try setting it to zero. Maybe you could try something like this to get an idea of which screenmodes are available: |
| ||
I have the result of the log from my customer: nothing, nada, void, empty... I suspect the file buffer has not been flushed before the crash. The debug idea is a good one I will do that and will add your code Warner too. Thanks for all the ideas, btw. |
| ||
I sent the following test program (in debug mode)file=WriteFile("Error Log.txt") If file=0 Then RuntimeError "File could not be written, please move program." WriteLine file,"Log opened." Graphics3D 640,480,0,2 WriteLine file,"Graphics init (0) ok" For b = 2 To 4 bt = 8 * b For w = 0 To 2048 For h = 0 To 2048 If GfxModeExists(w, h, bt) WriteLine file,w + " x " + h + " x " + bt + " ...... tested OK" EndIf Next Next Next ;Graphics3D 640,480,32,2 ;WriteLine file,"Graphics init (32) ok" SetBuffer BackBuffer() WriteLine file,"Double buffering ok" camera=CreateCamera() WriteLine file,"Camera ok" light=CreateLight() WriteLine file,"Light ok" RotateEntity light,90,0,0 WriteLine file,"Light rotated ok" ; Create cube cube=CreateCube() WriteLine file,"Cube created ok" PositionEntity cube,0,0,5 WriteLine file,"Cube positioned ok" WriteLine file,"Entered loop ok" TurnEntity cube,0.1,0.1,0.1 WriteLine file,"Cube rotated ok" RenderWorld WriteLine file,"Render ok" Flip WriteLine file,"Switch buffers ok" WriteLine file,"Exit loop, closing log." CloseFile file End We will see... |
| ||
Forgot to ask: Does she have dual monitors? Blitz really doesn't like dual monitors. Aside from that, if that version doesn't work, try closing the file every time - should force it to save (although it will only be the first line). file=WriteFile("Error Log.txt") If file=0 Then RuntimeError "File could not be written, please move program." WriteLine file,"Log opened." CloseFile file Graphics3D 640,480,32,2 file=WriteFile("Error Log.txt") If file=0 Then RuntimeError "File could not be written, please move program." WriteLine file,"Graphics init ok" CloseFile file SetBuffer BackBuffer() file=WriteFile("Error Log.txt") If file=0 Then RuntimeError "File could not be written, please move program." WriteLine file,"Double buffering ok" CloseFile file camera=CreateCamera() file=WriteFile("Error Log.txt") If file=0 Then RuntimeError "File could not be written, please move program." WriteLine file,"Camera ok" CloseFile file light=CreateLight() file=WriteFile("Error Log.txt") If file=0 Then RuntimeError "File could not be written, please move program." WriteLine file,"Light ok" CloseFile file RotateEntity light,90,0,0 file=WriteFile("Error Log.txt") If file=0 Then RuntimeError "File could not be written, please move program." WriteLine file,"Light rotated ok" CloseFile file ; Create cube cube=CreateCube() file=WriteFile("Error Log.txt") If file=0 Then RuntimeError "File could not be written, please move program." WriteLine file,"Cube created ok" CloseFile file PositionEntity cube,0,0,5 file=WriteFile("Error Log.txt") If file=0 Then RuntimeError "File could not be written, please move program." WriteLine file,"Cube positioned ok" CloseFile file ;Guessing the error happens before the main loop, so no error checking after this line x=0 While Not KeyDown( 1 ) TurnEntity cube,0.1,0.1,0.1 RenderWorld Flip Wend End |
| ||
I sent the latest code to my customer (I added 3D graphics driver list and I changed the code to save the file everytime I log something, I compiled it in debug mode too. Result: Memory Access Violation and no log file anywhere in the disk. It seems Blitz3D, on this machine is not even able to load itself... (but she said me the usual blitz black window appears very briefly) ...well, I don't really know what I can check now... DxDiag say the following: ------------------ System Information ------------------ Time of this report: 2/20/2009, 20:22:51 Machine name: JULIE-PC Operating System: Windows Vista™ Home Premium (6.0, Build 6001) Service Pack 1 (6001.vistasp1_gdr.080917-1612) Language: English (Regional Setting: English) System Manufacturer: HP-Pavilion System Model: KQ498AA-A2L m9350f BIOS: BIOS Date: 05/16/08 14:20:57 Ver: 5.18 Processor: AMD Phenom(tm) 9850 Quad-Core Processor (4 CPUs), ~2.5GHz Memory: 6142MB RAM Page File: 2106MB used, 10364MB available Windows Dir: C:\Windows DirectX Version: DirectX 10 DX Setup Parameters: Not found DxDiag Version: 6.00.6001.18000 32bit Unicode -------------------- DirectX Debug Levels -------------------- Direct3D: 0/4 (retail) DirectDraw: 0/4 (retail) DirectInput: 0/5 (retail) DirectMusic: 0/5 (retail) DirectPlay: 0/9 (retail) DirectSound: 0/5 (retail) DirectShow: 0/6 (retail) --------------- Display Devices --------------- Card name: NVIDIA Geforce 9800 GT Manufacturer: NVIDIA Chip type: GeForce 9800 GT DAC type: Integrated RAMDAC Device Key: Enum\PCI\VEN_10DE&DEV_0601&SUBSYS_90081043&REV_A2 Display Memory: 2539 MB Dedicated Memory: 493 MB Shared Memory: 2046 MB Current Mode: 1680 x 1050 (32 bit) (60Hz) Monitor: HP w2207 Wide LCD Monitor Driver Name: nvd3dum,nvd3dumx.dll,nvwgf2um, nvwgf2umx.dll Driver Version: 7.15.0011.7556 (English) DDI Version: 10 Driver Attributes: Final Retail Driver Date/Size: 4/17/2008 06:21:00, 5545984 bytes WHQL Logo'd: Yes WHQL Date Stamp: Device Identifier: {D7B71E3E-4541-11CF-776E-03B002C2CA35} Vendor ID: 0x10DE Device ID: 0x0601 SubSys ID: 0x90081043 Revision ID: 0x00A2 Revision ID: 0x00A2 Video Accel: ModeMPEG2_A ModeMPEG2_C ModeVC1_C ModeWMV9_C ModeVC1_B ModeWMV9_B ModeVC1_A ModeWMV9_A Deinterlace Caps: {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(YUY2,YUY2) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_PixelAdaptive {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(YUY2,YUY2) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(YUY2,YUY2) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_BOBVerticalStretch {B338D50D-A64A-4790-AC01-475B64252A78}: Format(In/Out)=(YUY2,YUY2) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_BOBVerticalStretch {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(UYVY,UYVY) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_PixelAdaptive {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(UYVY,UYVY) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(UYVY,UYVY) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_BOBVerticalStretch {B338D50D-A64A-4790-AC01-475B64252A78}: Format(In/Out)=(UYVY,UYVY) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_BOBVerticalStretch {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(YV12,0x32315659) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_PixelAdaptive {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(YV12,0x32315659) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(YV12,0x32315659) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_BOBVerticalStretch {B338D50D-A64A-4790-AC01-475B64252A78}: Format(In/Out)=(YV12,0x32315659) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_BOBVerticalStretch {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(NV12,0x3231564e) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_PixelAdaptive {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(NV12,0x3231564e) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(NV12,0x3231564e) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_BOBVerticalStretch {B338D50D-A64A-4790-AC01-475B64252A78}: Format(In/Out)=(NV12,0x3231564e) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_BOBVerticalStretch {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(IMC1,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(IMC1,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(IMC1,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {B338D50D-A64A-4790-AC01-475B64252A78}: Format(In/Out)=(IMC1,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(IMC2,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(IMC2,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(IMC2,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {B338D50D-A64A-4790-AC01-475B64252A78}: Format(In/Out)=(IMC2,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(IMC3,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(IMC3,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(IMC3,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {B338D50D-A64A-4790-AC01-475B64252A78}: Format(In/Out)=(IMC3,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(IMC4,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(IMC4,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(IMC4,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {B338D50D-A64A-4790-AC01-475B64252A78}: Format(In/Out)=(IMC4,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(S340,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(S340,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(S340,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {B338D50D-A64A-4790-AC01-475B64252A78}: Format(In/Out)=(S340,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(S342,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(S342,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(S342,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= {B338D50D-A64A-4790-AC01-475B64252A78}: Format(In/Out)=(S342,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps= DDraw Status: Enabled D3D Status: Enabled AGP Status: Enabled ..cut... |
| ||
You could try a program such as:print "hello world" If that doesn't run, that's bad. Maybe the 2D modes can be set? graphics 800, 600, 0, 2 setbuffer backbuffer() text 0, 0, "tested!" flip waitkey end And I would advise to only test one thing at the time. Combining all tests into a big program could give distorted testresults. You could however create a batch file that runs several testprograms after each other. Anyway, I would try this program: I used it once in a similair situation and it turned out that there were NO graphics modes that could be found. If every test fails, and this customer isn't fed up, you could consider using BMax+MiniB3D. If you need a test program for that, here: link to yousendit It is your original test program, ported to minib3d. |
| ||
no log file anywhere in the disk Is she looking in her virtual store for the file? |
| ||
Ow, yes, and Vista has some compatibiltymodes as well. Not sure how usable they are, you can reach them by right-clicking the program. I vaguely remember a thread a while ago, I believe a bug report, where -again bad memory I think it was- Mark mentions to start blitz3d from the command prompt instead of clicking on the icon. Maybe something similair can be done with your application, again using a .bat file maybe ? If the customer lives not too far away, you could maybe bring along blitz3d and try it yourself. It would save the hassle of creating testprograms etc. Else, you could maybe still consider using minib3d instead. |
| ||
. Last edited 2012 |
| ||
Warner: The hello world program won't work as even the first line of my logfile is not written in the disk (and it is before any graphic/3d or whatever initialization) And she searched all the disks for the file but she did not find anything (And it seems she is not a computer newbie) About BlitzMax/minib3d, thanks for the port I will give it a try, but if it works it won't help me a lot, as I don't want to rewrite my entire application on bmax :) RGR: Yes you are right, I have tons of customers (well, several :) ) using Vista and it is working like a charm. Even this customer is able to run it on her laptop but not on the desktop PC. I am sure it comes from something outside of Blitz or my program, but I have no clue what it can be. She is not running a dual screen machine btw. And yes, it would be great to test directly on the customer machine, but she is on the exact opposite of the world than me :) Anyway, thanks for all your ideas and code sample, I have to think what I can do now. |
| ||
Vista Doesnt Support 6GB RAM I dont think. Tell ur customer to turn off MAV in control panel |
| ||
Have you tried anything that doesn't use Graphics/Graphics3D, eg.Print "Click the mouse" MouseWait End This would print to the black window that apparently still appears. Do you know if other Direct3D programs run on the machine? |
| ||
Vista Doesnt Support 6GB RAM I dont think. Yes it does. He's running Vista 64 bit, which supports anything from 8 to 128GB of ram, depending on the version. Tell ur customer to turn off MAV in control panel You cannot disable memory access violations in control panel. I'm guessing you really mean DEP or UAC, in which I would disagree with you as it's very bad advice to be telling people to disable important security settings that are there for a reason. If the user was experienced enough to know about them and want to disable them, she would already have done so. Does Blitz3D still default to using DirectInput? And there's a command to disable it, isn't there? DisableDirectInput True/False or DirectInputOn True/False, something like that? If it's happening before Graphics3D, which it apparently is, there aren't many possibilities left. EDIT: And we're answering a six month old post thanks to the necro. Hopefully the issue was already resolved. |
| ||
I don't know if the issue has been resolved, because after a few mails my customer did not answer to my latest message.. but afaik it was not working... Anyway thanks for the late answers :) |
| ||
I think i may know whats causing your problem. There is a strong chance this could be linked to the loadtexture command bug. It caused some computers to crash, if you don't specify the flags you want, when loading a texture, in particular the alpha flag. |
| ||
You could investigate my Data Execution Prevention solution that solved a similar problem for me - see http://www.blitzbasic.com/Community/posts.php?topic=86872 Peter |