when exit outside ide get "stopped working" error

This is the forum for miscellaneous technical/programming questions.

Moderator: 2ffat

when exit outside ide get "stopped working" error

Postby Azazaz » Thu Sep 03, 2015 1:54 pm

When I build and run my VCL project inside the IDE, it runs fine, it exits fine. When I run the same executable outside the IDE, it runs fine, but when it exits, I get that Windows error message that says "the program has stopped working, Windows is looking for a solution" -- something like that.

I haven't seen anything like this before, and the only things I can think of that have changed recently are, a), upgrading from Win7 to Win10, b), a trial installation of EurekaLog, which I have since uninstalled, and c), a trial installation of TwineCompile, also uninstalled.

Does anyone have any ideas about what to look for? And how to look for it? Obviously, I can't use breakpoints or the debugger tools in the IDE since the problem isn't even happening there.

Oh yeah, this is in XE7.
Azazaz
BCBJ Guru
BCBJ Guru
 
Posts: 105
Joined: Wed Sep 26, 2012 9:08 am

Re: when exit outside ide get "stopped working" error

Postby smd » Thu Sep 03, 2015 4:15 pm

I am having the same issue. Seems to be a setting in windows that I have not yet found. The timeout for when it decides that something is not responding is too short. Get that often with programs under windows 8.1

It pops up after only a second or two where if it waited just a couple more seconds it finishes. Problem with that alert is that if clicking the corner X to close that notification window causes an abort of the process and closing of the main program.

ADDED:

I found a solution. Open windows control panel

Control_Panel -> Action Center -> Problem Reporting Settings

There are 4 check boxes that are probably greyed out. Probably is set to
"Each time a problem occurs, ask before checking for solutions"

you need to click the blue link below
"Change report settings for all users"

to be able to change the setting.
Select
"Never check for solutions"

This fixes one of the more annoying problems with windows. If it checks, it goes online and takes a while to give you a totally unusable solution. Probably more about microsloth spyware than actually helping anybody.
-----------------------------
Scott
smd
BCBJ Guru
BCBJ Guru
 
Posts: 130
Joined: Sat Nov 29, 2014 8:02 pm
Location: Las Vegas

Re: when exit outside ide get "stopped working" error

Postby Azazaz » Thu Sep 03, 2015 9:24 pm

Thanks!

I would/will hate to have to tell end users to do this, but it's a lot better than no solution at all!
Azazaz
BCBJ Guru
BCBJ Guru
 
Posts: 105
Joined: Wed Sep 26, 2012 9:08 am

Re: when exit outside ide get "stopped working" error

Postby Azazaz » Sat Dec 19, 2015 3:00 am

It is happening with an XE8-built application as well.

Does anyone know a better solution for this?
Azazaz
BCBJ Guru
BCBJ Guru
 
Posts: 105
Joined: Wed Sep 26, 2012 9:08 am

Re: when exit outside ide get "stopped working" error

Postby 2ffat » Sat Dec 19, 2015 5:34 pm

I've never seen this in a program that didn't crash. The closest I've come with this was in XP. One of my components, a thread that watched for serial communication, wasn't being closed correctly when I closed the program. I would close the program but the thread was still running until it realized the main program was closed then crashed sending out a nasty error message. Do you have a component or thread running that isn't being closed?
James P. Cottingham

Look at me still talking
when there is science to do.
User avatar
2ffat
Forum Mod
Forum Mod
 
Posts: 427
Joined: Wed Jun 23, 2004 7:07 am
Location: South Hill, VA

Re: when exit outside ide get "stopped working" error

Postby Azazaz » Sat Jan 02, 2016 12:04 am

The program isn't crashing. It doesn't indicate any threads are still running when closing it while running it from the IDE -- but then, it isn't not closing correctly in the IDE either.

And it was not happening at all before Windows 10.

I don't know. Scott said he's seen this behavior as well.

I'm wondering if my code is somehow signaling to Windows 10 that the application is closing before it's really closing. I'll have to look into that.

The only thing I can think of is that, when closing, right before exiting, I run some sql execute statements to update the database. I'm thinking Windows 10 expects the application to close sooner than the execution of these statements allows ... but again, is only happening in Windows 10 (i.e., none of this code has been changed since updating from Windows 7), and it only happens when the executable is run outside of the IDE.

Sorry to be so long to reply. Thanks for the response.
Azazaz
BCBJ Guru
BCBJ Guru
 
Posts: 105
Joined: Wed Sep 26, 2012 9:08 am

Re: when exit outside ide get "stopped working" error

Postby pidgi2009 » Mon Jan 04, 2016 10:38 am

I once had the very same problem, which I finally assumed came from threads opened in components and not closing fast enough.
I added a short delay just before leaving the application, in a window saying something like:
The application is now closing. Wait a short moment...
With a timer closing the said window in, say, half a second.
This is a just a poor workaround but it looks like something very professionnal, and did work like a charm for me.

Just my 2 cents...
pidgi2009
BCBJ Veteran
BCBJ Veteran
 
Posts: 53
Joined: Sat Apr 25, 2009 11:44 am

Re: when exit outside ide get "stopped working" error

Postby Azazaz » Tue Feb 09, 2016 5:01 am

I'm wondering if anyone has come up with an answer for this?

To reiterate the trouble:

The program is NOT crashing and no data is being corrupted.

It is NOT happening inside the IDE.

It ONLY happens when the application has been launched OUTSIDE the IDE upon exiting the application.

It ONLY happens in Windows 10.

There are no threads that are not being terminated, at least not when it is run and exited inside the IDE.

If at all possible, I don't want to tell the end user to modify Problem Reporting Settings just so this error doesn't occur.

As there is no way I know of to trace the application except inside the IDE (when the problem is not occurring), I'm unsure how to proceed.

Any suggestions?
Azazaz
BCBJ Guru
BCBJ Guru
 
Posts: 105
Joined: Wed Sep 26, 2012 9:08 am

Re: when exit outside ide get "stopped working" error

Postby HsiaLin » Tue Feb 09, 2016 9:07 am

Its most definately a new OS thing i do believe. I had a similar problem back when windows XP
first came out. What i did to stop it was set the "unresponsive" timeout a good bit higher. Im not
sure how to do that manually in win10 but i do know that a program called "Windows 10 Manager"
will allow you to set the timers for 3 different scenarios, one of which is how long to wait before
killing a working program.
HsiaLin
BCBJ Master
BCBJ Master
 
Posts: 281
Joined: Sun Jul 08, 2007 6:29 pm

Re: when exit outside ide get "stopped working" error

Postby theLizard » Tue Feb 09, 2016 2:09 pm

I agree with 2ffat, I had similar problems a while ago and turned out to be something i did / did not do in code, I can't remember what it was but it went away when I fixed the code, sorry I can't be more specific.
theLizard
BCBJ Master
BCBJ Master
 
Posts: 447
Joined: Wed Mar 18, 2009 2:14 pm

Re: when exit outside ide get "stopped working" error

Postby Azazaz » Tue Feb 09, 2016 9:31 pm

Yet the exact same binary exits without error in Windows 7 ...

So it is certainly masquerading as a Windows 10 issue.

Just saying.
Azazaz
BCBJ Guru
BCBJ Guru
 
Posts: 105
Joined: Wed Sep 26, 2012 9:08 am

Re: when exit outside ide get "stopped working" error

Postby Azazaz » Mon Feb 22, 2016 11:05 pm

The problem has now gone mysteriously away.

Some recent Windows 10 update perhaps?

Just hoping it doesn't come back.
Azazaz
BCBJ Guru
BCBJ Guru
 
Posts: 105
Joined: Wed Sep 26, 2012 9:08 am


Return to Technical

Who is online

Users browsing this forum: Bing [Bot] and 9 guests

cron