Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Bug Reports / DBP cannot survive a ctrl-alt-del

Author
Message
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 7th Aug 2007 04:28
I'm sorry but.. why does DBP flush its video memory on a ctrl-alt-del?

Try running this project and hitting the good 'ol ctrl-alt-del.



http://3dfolio.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Aug 2007 13:02
Crashes here - with an "Object does not exist" error when I try to return to the DBP app.

Looks like a valid question to me - other applications, presumably also using DirectX (?), don't crash when I return to them after pressing ctrl-alt-del.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Aug 2007 13:29
Quote: "Running on XP SP1 "


Ah! I'm running SP2. So perhaps it's an MS issue?

I'm seriously thinking of turning off "automatic updates" because my system seems to slow up after each one.
The Nerd
19
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 7th Aug 2007 14:58
Crashes here with an "object does not exist" on Windows XP with SP2.

Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 7th Aug 2007 16:24
Quote: "Tried again, still no crash. Running on XP SP1 @ 1024x768x32, compiled with 6.6b. I guess my system is just too stable."


Is the cube still visible as well?

I think it's odd that you don't crash. :?

http://3dfolio.com
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 7th Aug 2007 16:54
Quote: "Yes, the cube remains visible. There's no reason why the video memory would be flushed anyway, since it's running in windowed mode. From the reports so far, it seems to be SP2 related."


Yes, of course. My point exactly. What I don't understand is what SP2 would have anything to do with it. If this is indeed the case I never would have guessed.

http://3dfolio.com
qwe
20
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 7th Aug 2007 20:10
i have SP2 and the cube stays when i ctrl-alt-del. 2Ghz centrino duo, 6.6b
NeX the Fairly Fast Ferret
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 7th Aug 2007 20:16
Quote: "because my system seems to slow up after each one"

Duh. It's what I've been saying for years. Updates slow bootup because the hard drive has to go back and forth getting them from all over the place, and because there is more going on, the system will run slower.


Since the other one was scaring you guys so much...
Red Ocktober
20
Years of Service
User Offline
Joined: 6th Dec 2003
Location:
Posted: 7th Aug 2007 22:13
try running the app in a window... then run it full screen again...

DB apps aren't the only ones to do this...

if you need fullscreen, run the app in a fullscreen window... of course, those apps that do any gamma control logic will sacrifice that lil bit when in windowed mode...

--Mike
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 7th Aug 2007 22:18
Stay on topic, please.

http://3dfolio.com
Red Ocktober
20
Years of Service
User Offline
Joined: 6th Dec 2003
Location:
Posted: 7th Aug 2007 23:03
what are you talkin' about Mistrel... this IS the topic...

run the app in the windowed mode, then run it in the full screen mode... press ctl-alt-del in both instances...

do they respond the same?!?!

--Mike
Red Ocktober
20
Years of Service
User Offline
Joined: 6th Dec 2003
Location:
Posted: 7th Aug 2007 23:13 Edited at: 7th Aug 2007 23:14
first of all WK, i'm not saying it is about fullscreen... that is only an single aspect of running the app... if you think that it has nothing to do with the problem he is experiencing, you are mistaken...

second... interesting as it may be... i just ran his code in a window, and in fullscreen mode... did ctl-alt-del... and both worked fine...

no faults, no crashing...

but, if i run another app i just made, and it runs fine in windowed mode, and crashes in full screen... with the same results as indicated above (object not found)....

so it would appear that the display mode has something to do with it...

--Mike
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Aug 2007 23:18
Come on you two, Red Ocktober was obviously trying to help. Surely, the question of which mode is being used is just as likely to be relevant as the SP2 issue which I raised - till we actually find out the cause of the problem, of course.

On my system that code crashes when I return from Task Manager with an "object does not exist" error whichever mode I'm using.
Red Ocktober
20
Years of Service
User Offline
Joined: 6th Dec 2003
Location:
Posted: 7th Aug 2007 23:25 Edited at: 7th Aug 2007 23:26
forgot to mention, i'm running xp, service pack2 here...

i got similar error message with larger app (evolved's soft shadow demo) running full screen when i did ctl-alt-del... but lil test app above runs fine...

???

--Mike
Red Ocktober
20
Years of Service
User Offline
Joined: 6th Dec 2003
Location:
Posted: 7th Aug 2007 23:28 Edited at: 7th Aug 2007 23:29
i don't have the patience to argue it with you WK... you're of a singular mindset on just about everything...

logical deduction and reasoning seems to evade anything you come up with...

my posts are for the open minded people here interested in locating a possible fault... anyone else can simply ignore em...


--Mike
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 7th Aug 2007 23:34 Edited at: 7th Aug 2007 23:36
When I said stay on topic I was referring to NeX the Fairly Fast Ferret. Red Ocktober's post wasn't even visible until after I submitted mine.

I'll try to be more specific the next time things begin to go off-topic.

Now, stay on topic, please, Red Ocktober.

http://3dfolio.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Aug 2007 00:13
Mistrel

Thanks for the explanation - we all get caught out by that when we don't bother to address our posts properly.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 8th Aug 2007 00:22
Works fine here as well in Win XP Pro SP2. No crash.

Alquerian
18
Years of Service
User Offline
Joined: 29th Mar 2006
Location: Reno Nevada
Posted: 8th Aug 2007 02:32
It ran fine on my machine in all windowed modes. I am running XP Pro w/ Service Pack 2 and DBP 6.6

Visit the Wip!
White knight
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location:
Posted: 8th Aug 2007 05:14
it works fine for me i tried to see if it would crash in full screen also and rpeadedly pressed alt-ctrl-del np here
xp sp2
celeron(m) 1.4 mobile
also tested it on my p4 2 gig with same os and servicepack
maybe it's your system

new learning center comming soon http://911.bounceme.net/
Jane Doe
16
Years of Service
User Offline
Joined: 29th Jun 2007
Location:
Posted: 8th Aug 2007 08:54 Edited at: 8th Aug 2007 09:06
XP Home w/SP2 P4 - no problems doing Ctrl+Alt+Del with the window either normal size or maximised.

Edit: Using latest DBPro version.

- Jane
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Aug 2007 12:33
The plot thickens - I'll see what happens on my laptop when I get time later today.

Quote: "maybe it's your system"


Quite possibly. I have been experiencing a few predictable, but so far inexplicable, problems like that recently.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Aug 2007 14:28 Edited at: 13th Aug 2007 14:39
Quote: "I'll see what happens on my laptop when I get time later today."


A bit late perhaps - but here's the result anyway.

No crash whatever I do with the window - and the cube stays on screen unless I minimize the window. Task Manager opens and closes cleanly with no crash.

Laptop details: AMD Turion 64/1.8 GHz,Windows XP SP2.

Doesn't look like an SP2 issue - the code crashes on my PC and the cube disappears when I open Task Manager (the PC also has SP2 but has an Intel processor).

Any more guesses what the common factor might be?

Edit

Just noticed a difference between the way my laptop and PC handle ctrl-alt-delete. The laptop brings up Task Manager, but the PC brings up a Windows Security screen which has Task Manager as a button (for some obscure reason alt-printscreen won't let me copy the window to show you ). Perhaps that is the source of the problem? [The PC was set up for work use and has a logon procedure amongst other things.]
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 13th Aug 2007 19:12
I can confirm Green Gandalf's theory by opening the task manager with the hotkey ctrl-alt-esc. My DBP program does not crash.

For anyone who is participating in this report please confirm if your ctrl-alt-del crashes your program and if ctrl-alt-del brings up the Windows Security box or the task manager.

http://3dfolio.com
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Aug 2007 21:51
This problem happens for me when switching to the logon screen.

I'm not really sure what to do about this one - it appears that GG's theory of the security screen is the right one.

The reason I'm not sure is because the problem may be the same one as the fullscreen-exclusive problem - On windows NT, 2K, XP and Vista there is more than one desktop - there's the standard one, one for the screen saver, and one for the logon screen. Switching desktops may be causing a mode change.

Quote: "I guess the people who don't get the crash with SP2 have the Security Center disabled"


I think we're talking about the same thing here - I'm not too hot on Windows Admin

I'll confirm this for Lee to take a look at sometime and leave the final decision to him.

LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 11th Jan 2008 19:40
Sorry if someone has already reported the solution, but the reason you get the object not exist is because when the video card is forced to flush its resources, DBP removes all the objects/images/bitmaps that relied on those resources as well. You can detect this event by using the SCREEN INVALID command, which when set to one indicates the windows desktop has caused the video card and DBP to flush its resources. The modfieid code below resolves this problem:



This has been reported as a bug by some users, but to build the reconstruction of resources as an automatic feature of the language would be a nightmare task. The language allows users to modify the resources in many ways, and they are not always saved in system memory in the event the video memory is flushed. The best course of action is to either prevent the user from switching away from your application, or provide a friendly prompt to the user if this event occurs. If the application is data critical, you are still able to save out data in the normal way, only the objects and other video memory based resources have been cleared. If you want to emulate how top games handle this event, then you must reconstruct the entire applications visual resources after such an event, which means reloading and preparing all your objects, images and bitmaps, etc. An ideal way to do this is creating a subroutine or function which is soley responsible for (a) creating and (b) destroying all your video memory based resources. This third approach ensures that when you resize the desktop, toggle to administrator windows, fast user switch or hit an admin screensaver, your application not only survives, but restores itself to its former state. This technique is best used in title screens where changing the resolution can be performed, and the title graphics reloaded without interuption.

"Small, smart, and running around the legs of dinosaurs to find enough food to survive, bedroom programmers aren't extinct after all "
Dewi Morgan
16
Years of Service
User Offline
Joined: 16th Jan 2008
Location: London, UK
Posted: 22nd Jan 2008 06:08 Edited at: 22nd Jan 2008 06:09
My suspicion here is that the issue is desktop switching.

The videocard must, for security reasons, have its memory flushed when switching desktops. Otherwise, you could come to a machine someone had used fast user switching on, query the videocard buffers and see all the confidential info that had been on the other user's screens. Or you could write a screensaver which did the same (screensavers run under another security context too).

So this is absolutely not avoidable, and will never be "fixed". Also, you will never have warning of a desktop switching event, since it could trigger on a ctrl-alt-del interrupt.

Any method found that could be used to avoid it will be a security bug that should be reported to MS.

Since context switching is *really common* in newer versions of windows (even the UAC popups I think), DBPro does need to handle it. Fortunately, there's help on MSDN2 - they're pushing the whole Vista gaming platform thing hard right now too, so you could probably even get real human devs to help you.

Yet another game programmer
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Jan 2008 14:20
Quote: "DBPro does need to handle it"

Alternatively, it needs to give you the opportunity to handle it - this is what it does (via the SCREEN INVALID function).

Having said that, maybe it needs a few more functions that allow you to pick up where you left off (for example, current position within music that is playing at the time of the switch).

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Jan 2008 19:41
I don't know about the 2D commands, but the 'render' type commands such as sprites & objects will only cause DBPro to fail at the point of syncing, so a single check before the sync will catch those.

Dewi Morgan
16
Years of Service
User Offline
Joined: 16th Jan 2008
Location: London, UK
Posted: 22nd Jan 2008 20:39
The best workaround would be to write wrapper functions for every graphics command.

But when you get to a point where programmers are expected to write an identical wrapper for every call in order to make your program a well-behaved citizen, then the identical wrapper should really be in the language anyway: perhaps with an optional argument on the function to avoid the tax-paying if it makes a significant hit.

A language should ideally make paying taxes the default, rather than make the tax-paying a difficult and undocumented task. Otherwise, in the majority of programs, the taxes won't get paid.

Yet another game programmer
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Jan 2008 21:01 Edited at: 22nd Jan 2008 21:09
@WK, you should know better than that. Without a SYNC ON, DBPro will sync every line unless in a for/next loop, so yes, you made 'pure chance' into 'guaranteed'.



IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Jan 2008 21:14 Edited at: 22nd Jan 2008 21:14
Yes, I noticed something.

So to enumerate - The sync can happen in any or all of the following places:
- Between the do and for
- Between the next and if
- Between the endif and loop

In fact, your code will sync immediately before the 'if screen invalid() = 1' line, and will crash out there, so there is no chance that statement would ever detect the loss of directx.

Only when you take total control of syncing can you correctly detect and deal with the problem: That's the 'tax' you have to pay

Login to post a reply

Server time is: 2024-05-04 06:36:20
Your offset time is: 2024-05-04 06:36:20