public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/15204] New: ADJUSTR intrinsic accesses corrupted pointer
@ 2004-04-29 18:00 gcc-bugzilla at gcc dot gnu dot org
  2004-04-29 18:02 ` [Bug fortran/15204] [gfortran] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2004-04-29 18:00 UTC (permalink / raw)
  To: gcc-bugs


Compile the following program with "gfortran -static -o adjustr adjustr.f90"
Then try to execute the generated binray.

  program test_adjustr
  implicit none
  character(len=10) s1, s2
       !0123456789
  s1 = 'Steve'
  s2 = adjustr(s1)
  print*, 's1          = "', s1, '"'
  print*, 'adjustr(s1) = "', s2, '"'
       !0123456789
  s1 = '  Steve'
  s2 = adjustr(s1)
  print*, 's1          = "', s1, '"'
  print*, 'adjustr(s1) = "', s2, '"'
       !0123456789
  s1 = '     Steve'
  s2 = adjustr(s1)
  print*, 's1          = "', s1, '"'
  print*, 'adjustr(s1) = "', s2, '"'

  end program test_adjustr

kargl[262] valgrind adjustr
==14500== Memcheck, a memory error detector for x86-linux.
==14500== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward.
==14500== Using valgrind-2.1.0, a program supervision framework for x86-linux.
==14500== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward.
==14500== Estimated CPU clock rate is 1219 MHz
==14500== For more details, rerun with: -v
==14500== 
==14500== Conditional jump or move depends on uninitialised value(s)
==14500==    at 0x804D9EA: _gfortran_adjustr (in adjustr)
==14500==    by 0x8048201: MAIN__ (adjustr.f90:20)
==14500==    by 0x80484B3: main (in adjustr)
s1          = "Steve     "
==14500== 
==14500== Syscall param write(buf) contains uninitialised or unaddressable byte(s)
==14500==    at 0x8051E53: (within adjustr)
==14500==    by 0x804985C: _gfortran_next_record (in adjustr)
==14500==    by 0x804A6AE: finalize_transfer (in adjustr)
==14500==    by 0x804A78A: _gfortran_st_write_done (in adjustr)
==14500==  Address 0x8078083 is not stack'd, malloc'd or free'd
adjustr(s1) = "@G3"
==14500== 
==14500== ERROR SUMMARY: 5 errors from 3 contexts (suppressed: 0 from 0)
==14500== malloc/free: in use at exit: 0 bytes in 0 blocks.
==14500== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.

Environment:
System: FreeBSD c-67-168-59-70.client.comcast.net 5.2-CURRENT FreeBSD 5.2-CURRENT #2: Sat Apr 24 10:33:08 PDT 2004 kargl@c-67-168-59-70.client.comcast.net:/usr/obj/usr/src/sys/HOTRATS i386


	
host: i386-unknown-freebsd5.2
build: i386-unknown-freebsd5.2
target: i386-unknown-freebsd5.2
configured with: ../gcc/configure --prefix=/home/kargl/gcc/work --disable-libmudflap --enable-languages=c,f95 --with-gmp=/usr/local

How-To-Repeat:
	
See above.

-- 
           Summary: ADJUSTR intrinsic accesses corrupted pointer
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kargl at c-67-168-59-70 dot client dot comcast dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386-unknown-freebsd5.2
  GCC host triplet: i386-unknown-freebsd5.2
GCC target triplet: i386-unknown-freebsd5.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15204


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/15204] [gfortran] ADJUSTR intrinsic accesses corrupted pointer
  2004-04-29 18:00 [Bug fortran/15204] New: ADJUSTR intrinsic accesses corrupted pointer gcc-bugzilla at gcc dot gnu dot org
@ 2004-04-29 18:02 ` pinskia at gcc dot gnu dot org
  2004-04-29 19:09 ` [Bug libfortran/15204] " pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-29 18:02 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ADJUSTR intrinsic accesses  |[gfortran] ADJUSTR intrinsic
                   |corrupted pointer           |accesses corrupted pointer
   Target Milestone|---                         |tree-ssa
            Version|unknown                     |tree-ssa


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15204


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libfortran/15204] [gfortran] ADJUSTR intrinsic accesses corrupted pointer
  2004-04-29 18:00 [Bug fortran/15204] New: ADJUSTR intrinsic accesses corrupted pointer gcc-bugzilla at gcc dot gnu dot org
  2004-04-29 18:02 ` [Bug fortran/15204] [gfortran] " pinskia at gcc dot gnu dot org
@ 2004-04-29 19:09 ` pinskia at gcc dot gnu dot org
  2004-04-30  1:13 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-29 19:09 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|fortran                     |libfortran


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15204


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libfortran/15204] [gfortran] ADJUSTR intrinsic accesses corrupted pointer
  2004-04-29 18:00 [Bug fortran/15204] New: ADJUSTR intrinsic accesses corrupted pointer gcc-bugzilla at gcc dot gnu dot org
  2004-04-29 18:02 ` [Bug fortran/15204] [gfortran] " pinskia at gcc dot gnu dot org
  2004-04-29 19:09 ` [Bug libfortran/15204] " pinskia at gcc dot gnu dot org
@ 2004-04-30  1:13 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
  2004-04-30  3:45 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Tobias dot Schlueter at physik dot uni-muenchen dot de @ 2004-04-30  1:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Tobias dot Schlueter at physik dot uni-muenchen dot de  2004-04-30 00:56 -------
This is because adjustr is wrong and reads to the right from the end of the
string intead of the left. I have a patch, will submit with testcases once I've
finished building and testing.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15204


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libfortran/15204] [gfortran] ADJUSTR intrinsic accesses corrupted pointer
  2004-04-29 18:00 [Bug fortran/15204] New: ADJUSTR intrinsic accesses corrupted pointer gcc-bugzilla at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-04-30  1:13 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
@ 2004-04-30  3:45 ` pinskia at gcc dot gnu dot org
  2004-05-06 21:18 ` bdavis at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-30  3:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-30 02:13 -------
Confirmed, patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-04/msg01948.html>.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |patch
   Last reconfirmed|0000-00-00 00:00:00         |2004-04-30 02:13:15
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15204


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libfortran/15204] [gfortran] ADJUSTR intrinsic accesses corrupted pointer
  2004-04-29 18:00 [Bug fortran/15204] New: ADJUSTR intrinsic accesses corrupted pointer gcc-bugzilla at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-04-30  3:45 ` pinskia at gcc dot gnu dot org
@ 2004-05-06 21:18 ` bdavis at gcc dot gnu dot org
  2004-05-14 16:22 ` cvs-commit at gcc dot gnu dot org
  2004-05-14 16:26 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: bdavis at gcc dot gnu dot org @ 2004-05-06 21:18 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |bdavis9659 at comcast dot
                   |dot org                     |net
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15204


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libfortran/15204] [gfortran] ADJUSTR intrinsic accesses corrupted pointer
  2004-04-29 18:00 [Bug fortran/15204] New: ADJUSTR intrinsic accesses corrupted pointer gcc-bugzilla at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-05-06 21:18 ` bdavis at gcc dot gnu dot org
@ 2004-05-14 16:22 ` cvs-commit at gcc dot gnu dot org
  2004-05-14 16:26 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-05-14 16:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-05-13 22:41 -------
Subject: Bug 15204

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pinskia@gcc.gnu.org	2004-05-13 22:41:37

Modified files:
	libgfortran    : ChangeLog 

Log message:
	Fix format in (and bug number):
	2004-05-13  Bud Davis  <bdavis9659@comcast.net>
	
	PR fortran/15204
	* io/intrinsic/string_intrinsics.c (adjustr): rework logic.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&r1=1.3&r2=1.4



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15204


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libfortran/15204] [gfortran] ADJUSTR intrinsic accesses corrupted pointer
  2004-04-29 18:00 [Bug fortran/15204] New: ADJUSTR intrinsic accesses corrupted pointer gcc-bugzilla at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-05-14 16:22 ` cvs-commit at gcc dot gnu dot org
@ 2004-05-14 16:26 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-14 16:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-13 22:42 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15204


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-05-13 22:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-29 18:00 [Bug fortran/15204] New: ADJUSTR intrinsic accesses corrupted pointer gcc-bugzilla at gcc dot gnu dot org
2004-04-29 18:02 ` [Bug fortran/15204] [gfortran] " pinskia at gcc dot gnu dot org
2004-04-29 19:09 ` [Bug libfortran/15204] " pinskia at gcc dot gnu dot org
2004-04-30  1:13 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
2004-04-30  3:45 ` pinskia at gcc dot gnu dot org
2004-05-06 21:18 ` bdavis at gcc dot gnu dot org
2004-05-14 16:22 ` cvs-commit at gcc dot gnu dot org
2004-05-14 16:26 ` pinskia 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).