This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgomp/29949] New: implement argument checking for user accessable runtime routines
- From: "franke dot daniel at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Nov 2006 22:49:13 -0000
- Subject: [Bug libgomp/29949] New: implement argument checking for user accessable runtime routines
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Arguments for omp_set_num_threads/OMP_NUM_THREADS are used without checking for
validity, i.e.
$> cat omp_set_num_threads.f90
PROGRAM main
USE OMP_LIB
CALL omp_set_num_threads(-3)
!$OMP PARALLEL
WRITE(*,*) "thread:", omp_get_thread_num()
!$OMP END PARALLEL
END PROGRAM
$> gfortran-4.3 -g -Wall -fbounds-check omp_set_num_threads.f90
$> ./a.out
-3
libgomp: Out of memory allocating 4294967288 bytes
Segmentation Fault
The specifications v2.5, section 3.2.1, state:
"If the number of threads requested exceeds the number the implementation can
support, or is not a positive integer, the behavior of this routine is
implementation defined."
Although crashing is a form of "implementation", it is not very user friendly.
--
Summary: implement argument checking for user accessable runtime
routines
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: libgomp
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: franke dot daniel at gmail dot com
GCC host triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29949