This is the mail archive of the java-prs@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug java/18091] Valgrind errors building libjava


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]