mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2019-03-28, 14:13   #1
pokemonlover123
 
Mar 2016

2·3·5 Posts
Exclamation ntdll.dll error when starting Prime95 from a task scheduler action

I am on a laptop and run Prime95 (and mfaktc) whenever I plug in my laptop. After a bit of research, I managed to create a task scheduler entry with a custom event filter that listens for KernelPower event id 105 (source change) and checks if event data AcPower is true, if this gets triggered, I have it run mfaktc and prime95. mfaktc works fine, however prime95 never starts and after looking in event viewer, I see its faulting from ntdll.dll. It works perfectly fine if I start the program normally. Is it a bug? Or an issue with my task scheduler entry config?
pokemonlover123 is offline   Reply With Quote
Old 2019-03-28, 14:16   #2
pokemonlover123
 
Mar 2016

2×3×5 Posts
Default

I'll add relevant screenshots with more info in about an hour

Last fiddled with by pokemonlover123 on 2019-03-28 at 14:16
pokemonlover123 is offline   Reply With Quote
Old 2019-03-28, 14:54   #3
pokemonlover123
 
Mar 2016

2×3×5 Posts
Default First five screenshots

This post contains the first 5 screenshots relevant to the issue. Device specs and part of the task scheduler entry configuration are included.
Attached Thumbnails
Click image for larger version

Name:	Screenshot (1)_LI.jpg
Views:	42
Size:	634.4 KB
ID:	20119   Click image for larger version

Name:	Screenshot (2)_LI.jpg
Views:	36
Size:	670.7 KB
ID:	20120   Click image for larger version

Name:	Screenshot (3).png
Views:	42
Size:	74.4 KB
ID:	20121   Click image for larger version

Name:	Screenshot (4).png
Views:	39
Size:	69.6 KB
ID:	20122   Click image for larger version

Name:	Screenshot (5)_LI.jpg
Views:	40
Size:	622.4 KB
ID:	20123  

pokemonlover123 is offline   Reply With Quote
Old 2019-03-28, 14:58   #4
pokemonlover123
 
Mar 2016

2×3×5 Posts
Default Rest of screenshots

Remaining task scheduler entry pages, and the crash log for Prime95 in event viewer.
Attached Thumbnails
Click image for larger version

Name:	Screenshot (6).png
Views:	37
Size:	108.6 KB
ID:	20124   Click image for larger version

Name:	Screenshot (7).png
Views:	36
Size:	99.1 KB
ID:	20125   Click image for larger version

Name:	Screenshot (8)_LI.jpg
Views:	40
Size:	683.5 KB
ID:	20126  
pokemonlover123 is offline   Reply With Quote
Old 2019-03-28, 15:42   #5
sdbardwick
 
sdbardwick's Avatar
 
Aug 2002
North San Diego County

23·5·17 Posts
Default

No thoughts on your exact error, but perhaps an end run around it: Prime95 offers the option to stop when on battery power - checkbox in Options->Preferences menu. I'd check functionality of the menu option and see if it moots the problem.
sdbardwick is offline   Reply With Quote
Old 2019-03-28, 15:45   #6
pokemonlover123
 
Mar 2016

2×3×5 Posts
Default Another potential workaround

Quote:
Originally Posted by sdbardwick View Post
No thoughts on your exact error, but perhaps an end run around it: Prime95 offers the option to stop when on battery power - checkbox in Options->Preferences menu. I'd check functionality of the menu option and see if it moots the problem.
That could work. But I prefer Smart Guy solutions (Honestly I really put a lot of hard work on myself and always choose the hardest solutions sooo... Kinda kicking myself here)

I could try having the action launch Prime95 indirectly by having it run a batch file that runs Prime95 and see if that works.

Last fiddled with by pokemonlover123 on 2019-03-28 at 15:48
pokemonlover123 is offline   Reply With Quote
Old 2019-03-28, 15:51   #7
pokemonlover123
 
Mar 2016

2·3·5 Posts
Default Not a race condition

I tried removing mfaktc from the action list to see if a race condition was happening and both programs were trying to access the same memory or something. No difference.
pokemonlover123 is offline   Reply With Quote
Old 2019-03-28, 18:28   #8
kriesel
 
kriesel's Avatar
 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest

7·673 Posts
Default

Try creating and launching a batch wrapper for prime95.
cmd /k (full path)(batchfile)
(/k means keep; launch window hangs around afterward to display any launch related error messages sent to stderr until you explicitly close it)

The batch file can contain explicit
cd <working directory>
where the dlls, config files, prime95.exe, savefiles etc are
start prime95.exe
(launches the app and immediately returns to the batch file for the next step) or
prime95.exe
(waits for the named app to terminate)

Also for troubleshooting the batch file is a place to add set, dir /q /a commands etc temporarily such as for troubleshooting permissions & ownership of the process and files. On some OS versions the process properties of the batch file are not those of the interactive or other process that launched it unless you take steps to ensure that.

Initially this approach may be clunky/cluttered. After you get it working, then you may be able to prune off some of it, a bit at a time, by initially commenting out a bit, in case that's the line that if absent breaks it, or will prove useful again later.

I'd be inclined to prefix mfaktc.exe with cmd /k for some of the same reasons.

Last fiddled with by kriesel on 2019-03-28 at 18:31
kriesel is offline   Reply With Quote
Old 2019-03-28, 19:02   #9
pokemonlover123
 
Mar 2016

2·3·5 Posts
Default

Quote:
Originally Posted by kriesel View Post
Try creating and launching a batch wrapper for prime95.
cmd /k (full path)(batchfile)
(/k means keep; launch window hangs around afterward to display any launch related error messages sent to stderr until you explicitly close it)

The batch file can contain explicit
cd <working directory>
where the dlls, config files, prime95.exe, savefiles etc are
start prime95.exe
(launches the app and immediately returns to the batch file for the next step) or
prime95.exe
(waits for the named app to terminate)

Also for troubleshooting the batch file is a place to add set, dir /q /a commands etc temporarily such as for troubleshooting permissions & ownership of the process and files. On some OS versions the process properties of the batch file are not those of the interactive or other process that launched it unless you take steps to ensure that.

Initially this approach may be clunky/cluttered. After you get it working, then you may be able to prune off some of it, a bit at a time, by initially commenting out a bit, in case that's the line that if absent breaks it, or will prove useful again later.

I'd be inclined to prefix mfaktc.exe with cmd /k for some of the same reasons.
When using the batch file solution it works fine. Nothing to debug since the bug doesn't happen. Seems entirely related to task scheduler starting the process. Just the cmd /k prime95.exe and setting working directory in the task scheduler to the prime95 directory works perfectly. I don't know how to figure out what goes wrong with the task scheduler action, as I don't know how task scheduler runs actions. And that may be related to the issue. It's also weird that mfaktc displays no such issue. My original suspicion was that it had something to do with how Prime95 defaults to opening in the tray. Is there a way to disable that? I was unable to find the configuration value for it.
pokemonlover123 is offline   Reply With Quote
Old 2019-03-28, 19:18   #10
kriesel
 
kriesel's Avatar
 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest

7·673 Posts
Default

Quote:
Originally Posted by pokemonlover123 View Post
When using the batch file solution it works fine. Nothing to debug since the bug doesn't happen. Seems entirely related to task scheduler starting the process. Just the cmd /k prime95.exe and setting working directory in the task scheduler to the prime95 directory works perfectly. I don't know how to figure out what goes wrong with the task scheduler action, as I don't know how task scheduler runs actions. And that may be related to the issue. It's also weird that mfaktc displays no such issue. My original suspicion was that it had something to do with how Prime95 defaults to opening in the tray. Is there a way to disable that? I was unable to find the configuration value for it.
In Prime95, Options, uncheck Tray Icon.
An obvious difference is prime95 has Windows GUI code and mfaktc is command line.

Note, a web search for 0xc0000005 leads to some serious system diagnostics recommendations. Might want to be proactive on backups and system checks, just in case, before your bits hit the fan.
kriesel is offline   Reply With Quote
Old 2019-03-28, 19:27   #11
pokemonlover123
 
Mar 2016

1E16 Posts
Default

Quote:
Originally Posted by kriesel View Post
In Prime95, Options, uncheck Tray Icon.
An obvious difference is prime95 has Windows GUI code and mfaktc is command line.

Note, a web search for 0xc0000005 leads to some serious system diagnostics recommendations. Might want to be proactive on backups and system checks, just in case, before your bits hit the fan.
Yeah, I've already looked that up. Apparently, it's an access violation, which I find weird. Why would Prime95 cause an access violation from being run from a task scheduler action as opposed to manually or even from the command line? It's almost like task scheduler does something a tiny bit differently and that causes an issue. I'll keep looking into it. Currently running an SFC.
pokemonlover123 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to stop and restart assigned Prime95 task? rgirard1 Information & Answers 8 2019-01-14 15:18
Prime95 v29.2 multi-task question Bananarama Software 4 2017-08-25 14:28
Tea Party In Action R.D. Silverman Soap Box 12 2011-09-13 23:03
GPUs in action? davieddy PrimeNet 21 2011-04-02 12:33
Our Courts in Action R.D. Silverman Soap Box 17 2009-05-03 13:01

All times are UTC. The time now is 08:08.

Fri Nov 27 08:08:54 UTC 2020 up 78 days, 5:19, 4 users, load averages: 1.04, 1.19, 1.23

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.