public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/47674] New: gfortran.dg/realloc_on_assign_5.f03: Segfault at run time Date: Thu, 10 Feb 2011 08:43:00 -0000 [thread overview] Message-ID: <bug-47674-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47674 Summary: gfortran.dg/realloc_on_assign_5.f03: Segfault at run time Product: gcc Version: 4.6.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: burnus@gcc.gnu.org CC: pault@gcc.gnu.org gfortran.dg/realloc_on_assign_5.f03 segfaults here; it works if I unset the environment variable MALLOC_CHECK_. Valgrind shows: Invalid read of size 1 at 0x4C285C8: memmove (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x400B41: MAIN__ (realloc_on_assign_5.f03:15) by 0x400BF7: main (realloc_on_assign_5.f03:18) Address 0x5b524c1 is 0 bytes after a block of size 1 alloc'd at 0x4C26682: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x400B0C: MAIN__ (realloc_on_assign_5.f03:15) by 0x400BF7: main (realloc_on_assign_5.f03:18) Excerpt from the test: a = 'ab' ! OK a = (a(2:2)) ! seems to fail thus print '(">",a,"<")', a prints ">", STX (start of text character), "<" and a new line. Without MALLOC_CHECK_ the desired ">b<" and a new line is printed. DUMP: The first "if" does not make sense - at least in this special case - and there is the issue that "a" is also used on the RHS without using a temporary. D.1531 = .a; if (D.1531 != 0) { if ((<unnamed-unsigned:64>) D.1531 <= 1) { __builtin_memmove (a, &(*a)[2]{lb: 1 sz: 1}, D.1531); } else { __builtin_memcpy (a, &(*a)[2]{lb: 1 sz: 1}, 1); __builtin_memset (a + 1, 32, D.1531 + 0x0ffffffffffffffff); } }
next reply other threads:[~2011-02-10 7:03 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-02-10 8:43 burnus at gcc dot gnu.org [this message] 2011-02-12 19:28 ` [Bug fortran/47674] " burnus at gcc dot gnu.org 2011-08-03 7:24 ` [Bug fortran/47674] gfortran.dg/realloc_on_assign_5.f03: Segfault at run time for deferred (allocatable) string length burnus at gcc dot gnu.org 2013-04-08 20:25 ` tkoenig at gcc dot gnu.org 2013-06-16 20:39 ` dominiq at lps dot ens.fr 2013-09-02 11:18 ` dominiq at lps dot ens.fr 2013-11-23 14:04 ` dominiq at lps dot ens.fr 2014-03-16 10:09 ` tkoenig at gcc dot gnu.org 2014-09-28 21:48 ` bernd.edlinger at hotmail dot de 2014-12-29 17:17 ` tkoenig at gcc dot gnu.org 2015-01-05 17:16 ` tkoenig at gcc dot gnu.org 2015-01-05 19:21 ` tkoenig at gcc dot gnu.org 2015-05-16 6:04 ` tkoenig at gcc dot gnu.org 2015-06-04 9:28 ` tkoenig at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-47674-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).