public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug fortran/28105] New: Check for memory allocations bigger than size_t @ 2006-06-20 19:01 tobias dot burnus at physik dot fu-berlin dot de 2007-02-14 15:43 ` [Bug fortran/28105] " manu at gcc dot gnu dot org ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: tobias dot burnus at physik dot fu-berlin dot de @ 2006-06-20 19:01 UTC (permalink / raw) To: gcc-bugs sizeof(size_t) on ia32 is 4 thus 2^32 = 4,294,967,296 Byte can be accessed by unsigned. real(4), dimension(1025*1024*1024) :: m can thus not be accessed on ia32. Currently, gfortran does detect this overflow at compile time. Expected: The same as ifort: fortcom: Error: mem.f, line 3: A common block or variable may not exceed 2147483647 bytes REAL(4), DIMENSION(1074790400) :: T -----------------------------------^) (2147483647 = 2^31-1 -> signed int32.) Analogously for allocate() of pointers and arrays. Currently this does not fail even if sizeof(datatype)*size overflows size_t. As size_t is always possitive, the malloc() works sucessfully. In my case it produces: 1074790400*4 = 4194304. I get a coredump if I access T(1048577) as I only allocated T(1:1048576:1). Other compilers seem to have an overflow check somewhere. Maybe it works the following [symbolically written] if(size > 2**sizeof(size_t)/sizeof(datatype)) call error() at least they return a non-successful status with allocate. -- Summary: Check for memory allocations bigger than size_t Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tobias dot burnus at physik dot fu-berlin dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28105 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/28105] Check for memory allocations bigger than size_t 2006-06-20 19:01 [Bug fortran/28105] New: Check for memory allocations bigger than size_t tobias dot burnus at physik dot fu-berlin dot de @ 2007-02-14 15:43 ` manu at gcc dot gnu dot org 2007-04-18 6:06 ` fxcoudert at gcc dot gnu dot org 2009-04-15 12:30 ` dfranke at gcc dot gnu dot org 2 siblings, 0 replies; 4+ messages in thread From: manu at gcc dot gnu dot org @ 2007-02-14 15:43 UTC (permalink / raw) To: gcc-bugs ------- Comment #1 from manu at gcc dot gnu dot org 2007-02-14 15:43 ------- Will this be appropriate for all front-ends? Then, this is a duplicate of (or very related to) bug 18063. -- manu at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28105 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/28105] Check for memory allocations bigger than size_t 2006-06-20 19:01 [Bug fortran/28105] New: Check for memory allocations bigger than size_t tobias dot burnus at physik dot fu-berlin dot de 2007-02-14 15:43 ` [Bug fortran/28105] " manu at gcc dot gnu dot org @ 2007-04-18 6:06 ` fxcoudert at gcc dot gnu dot org 2009-04-15 12:30 ` dfranke at gcc dot gnu dot org 2 siblings, 0 replies; 4+ messages in thread From: fxcoudert at gcc dot gnu dot org @ 2007-04-18 6:06 UTC (permalink / raw) To: gcc-bugs ------- Comment #2 from fxcoudert at gcc dot gnu dot org 2007-04-18 07:05 ------- (In reply to comment #1) > Will this be appropriate for all front-ends? Then, this is a duplicate of (or > very related to) bug 18063. We probably want runtime checks generated by the Fortran front-end for this case, unlike what people want for C, thus it's not a complete duplicate. -- fxcoudert at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords| |diagnostic Last reconfirmed|0000-00-00 00:00:00 |2007-04-18 07:05:54 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28105 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/28105] Check for memory allocations bigger than size_t 2006-06-20 19:01 [Bug fortran/28105] New: Check for memory allocations bigger than size_t tobias dot burnus at physik dot fu-berlin dot de 2007-02-14 15:43 ` [Bug fortran/28105] " manu at gcc dot gnu dot org 2007-04-18 6:06 ` fxcoudert at gcc dot gnu dot org @ 2009-04-15 12:30 ` dfranke at gcc dot gnu dot org 2 siblings, 0 replies; 4+ messages in thread From: dfranke at gcc dot gnu dot org @ 2009-04-15 12:30 UTC (permalink / raw) To: gcc-bugs ------- Comment #3 from dfranke at gcc dot gnu dot org 2009-04-15 12:30 ------- *** Bug 39772 has been marked as a duplicate of this bug. *** -- dfranke at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jv244 at cam dot ac dot uk http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28105 ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-04-15 12:30 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2006-06-20 19:01 [Bug fortran/28105] New: Check for memory allocations bigger than size_t tobias dot burnus at physik dot fu-berlin dot de 2007-02-14 15:43 ` [Bug fortran/28105] " manu at gcc dot gnu dot org 2007-04-18 6:06 ` fxcoudert at gcc dot gnu dot org 2009-04-15 12:30 ` dfranke at gcc dot gnu dot org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).