mersenneforum.org  

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

Reply
 
Thread Tools
Old 2014-08-19, 04:08   #1
Explorer09
 
May 2014

3310 Posts
Default Prime95 minor bug, "TortureThreads" not checked for maximum threads

It is better test this with the 32-bit command-line version (mprime).
It's about the undocumented "TortureThreads" INI parameter.
1. Write "TortureThreads=33" in prime.txt (In 32-bit mprime, MAX_NUM_WORKER_THREADS=32)
2. Run "./mprime -t"
3. Press Ctrl+C to terminate the torture test. Then see it segmentation-faults.

Patch proposed below.
Code:
diff -r -u a/linux/prime.c b/linux/prime.c
--- a/linux/prime.c	2014-05-16 09:45:24.000000000 +0800
+++ b/linux/prime.c	2014-08-19 10:57:04.761676405 +0800
@@ -280,5 +280,8 @@
 		NO_GUI = FALSE;
 		num_threads = IniGetInt (INI_FILE, "TortureThreads",
 					 NUM_CPUS * CPU_HYPERTHREADS);
+		if (num_threads < 1) num_threads = 1;
+		if (num_threads > MAX_NUM_WORKER_THREADS)
+			num_threads = MAX_NUM_WORKER_THREADS;
 		LaunchTortureTest (num_threads, TRUE);
 	}
Explorer09 is offline   Reply With Quote
Old 2014-08-19, 04:13   #2
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

2×11×349 Posts
Default

Fixed as suggested in next release. Thanks.
Prime95 is online now   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Master" and "helper" threads Madpoo Software 0 2016-09-08 01:27
Maximum number of threads for Prime95 treesong Information & Answers 11 2012-06-18 13:35
What exactly does the "Drop checked CPUs" button do? Dubslow Information & Answers 15 2011-11-29 13:19
"no threads newer" counter cheesehead Forum Feedback 0 2008-09-17 05:14
Only 10 threads per page for "New Posts"? Mystwalker Forum Feedback 6 2007-03-04 14:45

All times are UTC. The time now is 22:21.


Wed Dec 1 22:21:08 UTC 2021 up 131 days, 16:50, 1 user, load averages: 1.44, 1.63, 1.50

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, 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.