public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/18091] New: Valgrind errors building libjava
@ 2004-10-20 20:04 drow at gcc dot gnu dot org
  2004-10-20 20:24 ` [Bug java/18091] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: drow at gcc dot gnu dot org @ 2004-10-20 20:04 UTC (permalink / raw)
  To: java-prs

I saw several kinds of errors, in huge quantity.

/home/drow/valgrind/gcc/gcj -B/home/drow/valgrind/gcc/
-B/usr/local/i686-pc-linux-gnu/bin/ -B/usr/local/
i686-pc-linux-gnu/lib/ -isystem /usr/local/i686-pc-linux-gnu/include -isystem
/usr/local/i686-pc-linux-g
nu/sys-include --encoding=UTF-8 -Wno-deprecated -C -g -classpath ''
-bootclasspath /home/drow/valgrind/i
686-pc-linux-gnu/libjava:/home/drow/src/gcc/libjava -d
/home/drow/valgrind/i686-pc-linux-gnu/libjava /ho
me/drow/src/gcc/libjava/java/lang/Class.java

==21511== Source and destination overlap in memcpy(0x1BE08FEC, 0x1BE08FEC, 5)
==21511==    at 0x1B904BCE: memcpy (mac_replace_strmem.c:113)
==21511==    by 0x80D37F2: write_classfile (jcf-write.c:2800)

/home/drow/valgrind/gcc/gcj -B/home/drow/valgrind/gcc/
-B/usr/local/i686-pc-linux-gnu/bin/ -B/usr/local/
i686-pc-linux-gnu/lib/ -isystem /usr/local/i686-pc-linux-gnu/include -isystem
/usr/local/i686-pc-linux-g
nu/sys-include --encoding=UTF-8 -Wno-deprecated -C -g -classpath ''
-bootclasspath /home/drow/valgrind/i
686-pc-linux-gnu/libjava:/home/drow/src/gcc/libjava -d
/home/drow/valgrind/i686-pc-linux-gnu/libjava /ho
me/drow/src/gcc/libjava/java/lang/Integer.java

==21620== Conditional jump or move depends on uninitialised value(s)
==21620==    at 0x80C4165: get_attribute (jcf-parse.c:160)
==21620== 
==21620== Conditional jump or move depends on uninitialised value(s)
==21620==    at 0x1B90478B: strlen (mac_replace_strmem.c:189)
==21620==    by 0x85E6B68: get_identifier (stringpool.c:111)
==21620== 
==21620== Conditional jump or move depends on uninitialised value(s)
==21620==    at 0x1B904795: strlen (mac_replace_strmem.c:189)
==21620==    by 0x85E6B68: get_identifier (stringpool.c:111)
==21620== 
==21620== Invalid read of size 1
==21620==    at 0x1B904791: strlen (mac_replace_strmem.c:189)
==21620==    by 0x85E6B68: get_identifier (stringpool.c:111)
==21620==  Address 0x1BD5595A is 0 bytes after a block of size 26 alloc'd
==21620==    at 0x1B904EDD: malloc (vg_replace_malloc.c:131)
==21620==    by 0x8779F1C: xmalloc (xmalloc.c:143)
==21620==    by 0x80C4157: get_attribute (jcf-parse.c:156)

-- 
           Summary: Valgrind errors building libjava
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: drow at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org
  GCC host triplet: i686-pc-linux-gnu


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


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

* [Bug java/18091] Valgrind errors building libjava
  2004-10-20 20:04 [Bug java/18091] New: Valgrind errors building libjava drow at gcc dot gnu dot org
@ 2004-10-20 20:24 ` pinskia at gcc dot gnu dot org
  2004-10-20 20:27 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-20 20:24 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-20 20:24 -------
This is definitely a bug:
          /* Concatenate current package prefix with new sfname. */
          char *buf = xmalloc (i+new_len+3);
          /* Replace '.' by DIR_SEPARATOR. */
          for (; i >= 0;  i--)
            {
              if (buf[i] == '.')
                buf[i] = DIR_SEPARATOR;
            }

This could cause problems.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-10-20 20:24:29
               date|                            |


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


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

* [Bug java/18091] Valgrind errors building libjava
  2004-10-20 20:04 [Bug java/18091] New: Valgrind errors building libjava drow at gcc dot gnu dot org
  2004-10-20 20:24 ` [Bug java/18091] " pinskia at gcc dot gnu dot org
@ 2004-10-20 20:27 ` pinskia at gcc dot gnu dot org
  2004-10-20 20:49 ` mckinlay at redhat dot com
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-20 20:27 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-20 20:27 -------
memcpy(0x1BE08FEC, 0x1BE08FEC, 5)

          new_ptr -= n;
          old_ptr -= n;
          if (n > 0)
            memcpy (new_ptr, old_ptr, n);

Someone needs to look into this part though because I don't understand the code at all.

-- 


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


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

* [Bug java/18091] Valgrind errors building libjava
  2004-10-20 20:04 [Bug java/18091] New: Valgrind errors building libjava drow at gcc dot gnu dot org
  2004-10-20 20:24 ` [Bug java/18091] " pinskia at gcc dot gnu dot org
  2004-10-20 20:27 ` pinskia at gcc dot gnu dot org
@ 2004-10-20 20:49 ` mckinlay at redhat dot com
  2004-10-20 21:04 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mckinlay at redhat dot com @ 2004-10-20 20:49 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From mckinlay at redhat dot com  2004-10-20 20:49 -------
For the memcpy() thing, in the error given we seem to be relocating something to
the exact same position. In this case the memcpy() should be harmless. But,
maybe it is possible to get real overlapping relocations. Its probably best just
to replace the memcpy() with a memmove() here.

I'm not sure the "unitialized conditional move" errors are really bugs. I've
seen this a bit when running valgrind on code compiled with recent GCCs ?


-- 


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


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

* [Bug java/18091] Valgrind errors building libjava
  2004-10-20 20:04 [Bug java/18091] New: Valgrind errors building libjava drow at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-10-20 20:49 ` mckinlay at redhat dot com
@ 2004-10-20 21:04 ` pinskia at gcc dot gnu dot org
  2004-10-21 14:38 ` cvs-commit at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-20 21:04 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-20 21:04 -------
I think the "unitialized conditional move" will get fixed when:
==21620== Conditional jump or move depends on uninitialised value(s)
==21620==    at 0x80C4165: get_attribute (jcf-parse.c:160)
is fixed.

See comment #1 where I show the problem.

-- 


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


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

* [Bug java/18091] Valgrind errors building libjava
  2004-10-20 20:04 [Bug java/18091] New: Valgrind errors building libjava drow at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-10-20 21:04 ` pinskia at gcc dot gnu dot org
@ 2004-10-21 14:38 ` cvs-commit at gcc dot gnu dot org
  2004-12-16 14:29 ` aph at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-10-21 14:38 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-10-21 14:38 -------
Subject: Bug 18091

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	aph@gcc.gnu.org	2004-10-21 14:38:17

Modified files:
	gcc/java       : jcf-parse.c ChangeLog 

Log message:
	2004-10-21  Andrew Haley  <aph@redhat.com>
	
	PR java/18091:
	* jcf-parse.c (set_source_filename): Add code to build new sfname.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/jcf-parse.c.diff?cvsroot=gcc&r1=1.176&r2=1.177
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1489&r2=1.1490



-- 


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


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

* [Bug java/18091] Valgrind errors building libjava
  2004-10-20 20:04 [Bug java/18091] New: Valgrind errors building libjava drow at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-10-21 14:38 ` cvs-commit at gcc dot gnu dot org
@ 2004-12-16 14:29 ` aph at gcc dot gnu dot org
  2005-01-03 22:25 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: aph at gcc dot gnu dot org @ 2004-12-16 14:29 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From aph at gcc dot gnu dot org  2004-12-16 14:29 -------
comment

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


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


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

* [Bug java/18091] Valgrind errors building libjava
  2004-10-20 20:04 [Bug java/18091] New: Valgrind errors building libjava drow at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-12-16 14:29 ` aph at gcc dot gnu dot org
@ 2005-01-03 22:25 ` pinskia at gcc dot gnu dot org
  2005-01-21  2:38 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-03 22:25 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-03 22:25 -------
Not totally fixed.
The following is not fixed yet:
==21511== Source and destination overlap in memcpy(0x1BE08FEC, 0x1BE08FEC, 5)
==21511==    at 0x1B904BCE: memcpy (mac_replace_strmem.c:113)
==21511==    by 0x80D37F2: write_classfile (jcf-write.c:2800)

Yes this is harmless but we should not do memcpy at all.
The easy fix would be the following:
          if (n > 0)
            memcpy (new_ptr, old_ptr, n);
Changed to:
          if (n > 0 && new_ptr != old_ptr)
            memcpy (new_ptr, old_ptr, n);

The comment above explains how this can happen.

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


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


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

* [Bug java/18091] Valgrind errors building libjava
  2004-10-20 20:04 [Bug java/18091] New: Valgrind errors building libjava drow at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2005-01-03 22:25 ` pinskia at gcc dot gnu dot org
@ 2005-01-21  2:38 ` cvs-commit at gcc dot gnu dot org
  2005-01-21  2:39 ` tromey at gcc dot gnu dot org
  2005-01-21  2:40 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-01-21  2:38 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-01-21 02:38 -------
Subject: Bug 18091

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tromey@gcc.gnu.org	2005-01-21 02:38:24

Modified files:
	gcc/java       : ChangeLog jcf-write.c 

Log message:
	2005-01-20  Andrew Pinski  <pinskia@gcc.gnu.org>
	
	PR java/18091:
	* jcf-write.c (perform_relocations): Don't call memcpy if source
	and destination are the same.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1530&r2=1.1531
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/jcf-write.c.diff?cvsroot=gcc&r1=1.158&r2=1.159



-- 


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


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

* [Bug java/18091] Valgrind errors building libjava
  2004-10-20 20:04 [Bug java/18091] New: Valgrind errors building libjava drow at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2005-01-21  2:38 ` cvs-commit at gcc dot gnu dot org
@ 2005-01-21  2:39 ` tromey at gcc dot gnu dot org
  2005-01-21  2:40 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-01-21  2:39 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2005-01-21 02:39 -------
I checked in Andrew Pinski's fix.


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


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


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

* [Bug java/18091] Valgrind errors building libjava
  2004-10-20 20:04 [Bug java/18091] New: Valgrind errors building libjava drow at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2005-01-21  2:39 ` tromey at gcc dot gnu dot org
@ 2005-01-21  2:40 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-21  2:40 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.0.0


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


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

end of thread, other threads:[~2005-01-21  2:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-20 20:04 [Bug java/18091] New: Valgrind errors building libjava drow at gcc dot gnu dot org
2004-10-20 20:24 ` [Bug java/18091] " pinskia at gcc dot gnu dot org
2004-10-20 20:27 ` pinskia at gcc dot gnu dot org
2004-10-20 20:49 ` mckinlay at redhat dot com
2004-10-20 21:04 ` pinskia at gcc dot gnu dot org
2004-10-21 14:38 ` cvs-commit at gcc dot gnu dot org
2004-12-16 14:29 ` aph at gcc dot gnu dot org
2005-01-03 22:25 ` pinskia at gcc dot gnu dot org
2005-01-21  2:38 ` cvs-commit at gcc dot gnu dot org
2005-01-21  2:39 ` tromey at gcc dot gnu dot org
2005-01-21  2:40 ` 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).