May 21, 2024, 09:37:29 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Program crashing with exception code

Started by Andy, September 23, 2016, 05:52:16 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

September 23, 2016, 05:52:16 AM Last Edit: September 23, 2016, 06:16:16 AM by Andy
Well this is a new one for me.

I've started to add in services to my alternative task manager, and "houston, we have a problem".

It happens when I stop / start a service a third time like so (and it doesn't matter if the third time is a start or a stop action):

I added a button "View Services" so that when you click it, a new screen appears with the list of services and their state (running / stopped).

Now let's take a service that is running - I click on the service name then on a button "Stop service" which in turn runs another exe I made to stop the service - which it does.

The services screen is closed, the services are re-read and the screen opens again with the services and their state - so the service that I stopped now says "Stopped" - okay so far.

Now I click on the service name then on a button "Start service" which in turn runs another exe I made to start the service - which it does.

Finally, if I stop the service again, the service stops and my taskman4 program quits - which it shouldn't.

Note :- Attached are the files needed, you can compile all three .iwb files (but not execute) and the run taskman4.exe as an Adminstrator or it won't work, and I have not cleaned up the code yet - still in testing mode.

I've look now at the event viewer and I see this for my program (taskman4.exe):

Faulting application name: taskman4.exe, version: 0.0.0.0, time stamp: 0x57e5147a
Faulting module name: ntdll.dll, version: 10.0.10586.306, time stamp: 0x571af2dc
Exception code: 0xc0000005
Fault offset: 0x00039045
Faulting process id: 0xdf0
Faulting application start time: 0x01d2158f366b3a44
Faulting application path: C:\Services\taskman4.exe
Faulting module path: C:\WINDOWS\SYSTEM32\ntdll.dll
Report Id: daff7dee-9ee7-4d93-bd25-f945ec7d0665
Faulting package full name:
Faulting package-relative application ID:

Has anyone any ideas on this?

Thanks,
Andy.




 
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Egil

Andy,

What you are doing now is beyond my knowledge, but just when I was reading your post a friend of mine called. He has been teaching C++ for years, and he told me that when you get an "Exception code: 0xC0000005" message, it is most likely because of DEP (Data Execution Prevention). Something Microsoft introduced some years ago for securety reasons.

In most of the cases he had seen, the error dissapeared after DEP was disabled. And it is also possible to set DEP to make an exeption for the service you try to run. I did not understand what he meant, so he sent these two links:

http://www.eassos.com/how-to/fix-error-code-0xc0000005.php
http://compfreakstars.blogspot.no/2011/11/0xc0000005-error-every-day-many.html

Hopefully some of the information there can be of help.

Egil
Support Amateur Radio  -  Have a ham  for dinner!

Andy

Thanks Egil,

I will look at these links now.

I can tell you the PC is virus free for sure, I have had ram issues with one stick - what I really need is for someone to re-create the exe files and see if they get the same problem.

Many thanks Egil as always!

Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

LarryMc

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

Thanks Larry for the link,

Think this is going to take some time to sort it out, I will copy the programs to the laptop (windows 7) tomorrow when my better half lets me on to see if it is code or machine related.

Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

LarryMc

September 23, 2016, 07:59:56 AM #5 Last Edit: September 23, 2016, 08:11:38 AM by LarryMc
Your instructions above are confusing.  the start and stop files in the crash zip won't compile so I can't test anything for you.
Got to go get my iron IV right now.

Later
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

Larry,

Sorry you cannot compile them, I will look into it.

Think it is more important for you to get your iron sorted out, but thanks for trying.

Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy

Attached are the screenshots after downloading, compiling (all iwb files) and running taskman4.exe run as admin from the folder it resides in.

I get the same result.

1.jpg - select "View services"
2.jpg - select "Stop service"
3.png - select "Start service"
4.png - select "Stop service" - service stops and taskman4.exe quits here...

Thanks,
Andy.

Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.