public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* found an overlapping data buffer in file natGCInfo.cc
@ 2009-07-27  8:29 Martin Ettl
  2009-07-27 10:03 ` Andrew Haley
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Ettl @ 2009-07-27  8:29 UTC (permalink / raw)
  To: java

Hello,

while checking the sources of gcc-4.4.1 with the static code analysis tool cppcheck i found an overlapping data buffer in file gcc-4.4.1/libjava/gnu/gcj/natGCInfo.cc at line 410. 

Take a look at the file:

static void *
nomem_handler(size_t size)
{
  if (oomDumpName)
    {
      char temp[strlen(oomDumpName) + 20];
410   sprintf(temp, "%s%03d", temp, GC_dump_count++);
      printf("nomem_handler(%zd) called\n", size);
      gc_ok--;
      GC_enumerator x(temp);
      x.enumerate();
      gc_ok++;
    }
  return (void*)0;
}

Indeed, the buffer overlapps. This can lead to segmentation faults!

Best regards

Ettl Martin

-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser

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

* Re: found an overlapping data buffer in file natGCInfo.cc
  2009-07-27  8:29 found an overlapping data buffer in file natGCInfo.cc Martin Ettl
@ 2009-07-27 10:03 ` Andrew Haley
  2009-07-27 14:43   ` David Daney
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Haley @ 2009-07-27 10:03 UTC (permalink / raw)
  To: Martin Ettl; +Cc: java

On 07/27/2009 10:29 AM, Martin Ettl wrote:
> Hello,
> 
> while checking the sources of gcc-4.4.1 with the static code analysis tool cppcheck i found an overlapping data buffer in file gcc-4.4.1/libjava/gnu/gcj/natGCInfo.cc at line 410. 
> 
> Take a look at the file:
> 
> static void *
> nomem_handler(size_t size)
> {
>   if (oomDumpName)
>     {
>       char temp[strlen(oomDumpName) + 20];
> 410   sprintf(temp, "%s%03d", temp, GC_dump_count++);
>       printf("nomem_handler(%zd) called\n", size);
>       gc_ok--;
>       GC_enumerator x(temp);
>       x.enumerate();
>       gc_ok++;
>     }
>   return (void*)0;
> }
> 
> Indeed, the buffer overlapps. This can lead to segmentation faults!

Thanks. How very weird; I wonder what that code was supposed to do.

Andrew.

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

* Re: found an overlapping data buffer in file natGCInfo.cc
  2009-07-27 10:03 ` Andrew Haley
@ 2009-07-27 14:43   ` David Daney
  2009-07-27 17:01     ` Andrew Haley
  0 siblings, 1 reply; 8+ messages in thread
From: David Daney @ 2009-07-27 14:43 UTC (permalink / raw)
  To: Andrew Haley; +Cc: Martin Ettl, java

Andrew Haley wrote:
> On 07/27/2009 10:29 AM, Martin Ettl wrote:
>> Hello,
>>
>> while checking the sources of gcc-4.4.1 with the static code analysis tool cppcheck i found an overlapping data buffer in file gcc-4.4.1/libjava/gnu/gcj/natGCInfo.cc at line 410. 
>>
>> Take a look at the file:
>>
>> static void *
>> nomem_handler(size_t size)
>> {
>>   if (oomDumpName)
>>     {
>>       char temp[strlen(oomDumpName) + 20];
>> 410   sprintf(temp, "%s%03d", temp, GC_dump_count++);

The second instance of temp should be oomDumpName.


>>       printf("nomem_handler(%zd) called\n", size);
>>       gc_ok--;
>>       GC_enumerator x(temp);
>>       x.enumerate();
>>       gc_ok++;
>>     }
>>   return (void*)0;
>> }
>>
>> Indeed, the buffer overlapps. This can lead to segmentation faults!
> 
> Thanks. How very weird; I wonder what that code was supposed to do.
> 

Someone should fix it.  If nobody does soon, I suppose I will as I added 
it in the first place.

David Daney

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

* Re: found an overlapping data buffer in file natGCInfo.cc
  2009-07-27 14:43   ` David Daney
@ 2009-07-27 17:01     ` Andrew Haley
  2009-07-27 19:09       ` Martin Ettl
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Haley @ 2009-07-27 17:01 UTC (permalink / raw)
  To: David Daney; +Cc: Martin Ettl, java

On 07/27/2009 04:42 PM, David Daney wrote:
> Andrew Haley wrote:

>> Thanks. How very weird; I wonder what that code was supposed to do.
>> 
> Someone should fix it.  If nobody does soon, I suppose I will as I added
> it in the first place.

Please.  I'm a great believer in the idea that one should fix one's own bugs.
Good karma...

Andrew.

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

* Re: found an overlapping data buffer in file natGCInfo.cc
  2009-07-27 17:01     ` Andrew Haley
@ 2009-07-27 19:09       ` Martin Ettl
  2009-07-28  8:08         ` Andrew Haley
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Ettl @ 2009-07-27 19:09 UTC (permalink / raw)
  To: Andrew Haley, ddaney; +Cc: java

Hello friends,

there are more bugs, not specially in the natGCInfo.cc but in e.g: libjava. I have no time to report all of them. I used cppcheck (an open source static code analysis tool) to find the bugs.
Here the output of the libjava scan with cppcheck:

gcc-4.4.1/libjava/classpath/native/fdlibm/dtoa.c,250,style,The scope of the variable ieps can be limited
gcc-4.4.1/libjava/classpath/native/fdlibm/dtoa.c,250,style,The scope of the variable ilim0 can be limited
gcc-4.4.1/libjava/classpath/native/fdlibm/dtoa.c,250,style,The scope of the variable k0 can be limited
gcc-4.4.1/libjava/classpath/native/jawt/jawt.c,109,error,Memory leak: surface_info
gcc-4.4.1/libjava/classpath/native/fdlibm/strtod.c,111,style,The scope of the variable esign can be limited
gcc-4.4.1/libjava/classpath/native/jni/classpath/jcl.c,170,style,Redundant condition. It is safe to deallocate a NULL pointer
gcc-4.4.1/libjava/classpath/native/jni/java-net/javanet.c,497,style,The scope of the variable result can be limited
gcc-4.4.1/libjava/classpath/native/jni/java-net/javanet.c,1077,style,The scope of the variable optval can be limited
gcc-4.4.1/libjava/classpath/native/jni/java-net/javanet.c,1079,style,The scope of the variable mid can be limited
gcc-4.4.1/libjava/classpath/native/jni/java-net/javanet.c,1284,style,The scope of the variable result can be limited
gcc-4.4.1/libjava/classpath/native/jni/java-net/javanet.c,1285,style,The scope of the variable obj can be limited
gcc-4.4.1/libjava/classpath/native/jni/java-net/java_net_VMNetworkInterface.c,106,style,struct or union member 'netif_entry::name' is
gcc-4.4.1/libjava/classpath/native/jni/java-net/java_net_VMNetworkInterface.c,107,style,struct or union member 'netif_entry::netif' i
gcc-4.4.1/libjava/classpath/native/jni/java-net/java_net_VMNetworkInterface.c,108,style,struct or union member 'netif_entry::numaddrs
gcc-4.4.1/libjava/classpath/native/jni/java-net/java_net_VMNetworkInterface.c,109,style,struct or union member 'netif_entry::next' is
gcc-4.4.1/libjava/classpath/native/jni/java-lang/java_lang_VMProcess.c,301,style,Redundant condition. It is safe to deallocate a NULL
gcc-4.4.1/libjava/classpath/native/jni/java-lang/java_lang_VMDouble.c,262,style,The scope of the variable i can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_transform.c,208,style,The scope of the variable i can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_transform.c,209,style,The scope of the variable newobj can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_sax.c,427,style,The scope of the variable j_publicId can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_sax.c,428,style,The scope of the variable j_systemId can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_sax.c,429,style,The scope of the variable j_value can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_io.c,364,style,The scope of the variable ctx can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_io.c,365,style,The scope of the variable options can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_io.c,460,style,The scope of the variable sax can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_io.c,550,style,The scope of the variable ret can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_io.c,551,style,The scope of the variable input can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_io.c,572,style,The scope of the variable ret can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_node.c,162,style,The scope of the variable ns can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_node.c,165,style,The scope of the variable ret can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_dom.c,1102,style,The scope of the variable ns can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_dom.c,1450,style,The scope of the variable attr can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_dom.c,1451,style,The scope of the variable count can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_dom.c,1517,style,The scope of the variable attr can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_dom.c,1518,style,The scope of the variable count can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_dom.c,2268,style,The scope of the variable ns2 can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_dom.c,2455,style,The scope of the variable attribute can be limited
gcc-4.4.1/libjava/classpath/native/jni/xmlj/xmlj_dom.c,2504,style,The scope of the variable attribute can be limited
gcc-4.4.1/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c,157,style,The scope of the variable j can be limited
gcc-4.4.1/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c,292,style,The scope of the variable i can be limi
gcc-4.4.1/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c,293,style,The scope of the variable num_items can
gcc-4.4.1/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c,420,style,The scope of the variable i can be limi
gcc-4.4.1/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c,509,style,The scope of the variable row can be li
gcc-4.4.1/libjava/classpath/native/jni/gtk-peer/gtk_jawt.c,164,style,The scope of the variable drawable can be limited
gcc-4.4.1/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice.c,67,style,The scope of the variable di
gcc-4.4.1/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkScreenGraphicsDevice.c,68,style,The scope of the variable di
gcc-4.4.1/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkSelection.c,74,style,The scope of the variable i can be limi
gcc-4.4.1/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkSelection.c,339,style,The scope of the variable i can be lim
gcc-4.4.1/libjava/classpath/native/jni/gstreamer-peer/gstreamer_io_peer.c,92,style,struct or union member '_AudioProperties::header_s
gcc-4.4.1/libjava/classpath/native/jni/gstreamer-peer/gstreamer_io_peer.c,98,style,struct or union member '_AudioProperties::samplera
gcc-4.4.1/libjava/classpath/native/jni/java-nio/gnu_java_nio_VMSelector.c,216,style,The scope of the variable current_thread can be l
gcc-4.4.1/libjava/classpath/native/jni/gstreamer-peer/gst_native_pipeline.c,590,error,Resource leak: read_fd
gcc-4.4.1/libjava/classpath/native/jni/java-nio/javanio.c,95,style,The scope of the variable ret can be limited
gcc-4.4.1/libjava/classpath/native/jni/java-nio/javanio.c,95,style,The scope of the variable ret can be limited
gcc-4.4.1/libjava/classpath/native/jni/java-nio/gnu_java_nio_charset_iconv_IconvDecoder.c,74,style,The scope of the variable cls can 
gcc-4.4.1/libjava/classpath/native/jni/java-nio/gnu_java_nio_VMChannel.c,203,style,The scope of the variable arr can be limited
gcc-4.4.1/libjava/classpath/native/jni/java-nio/gnu_java_nio_VMChannel.c,1098,style,The scope of the variable flags can be limited
gcc-4.4.1/libjava/classpath/native/jni/java-nio/gnu_java_nio_VMChannel.c,1238,style,The scope of the variable flags can be limited
gcc-4.4.1/libjava/classpath/native/jni/java-nio/gnu_java_nio_VMChannel.c,1628,style,The scope of the variable n can be limited
gcc-4.4.1/libjava/classpath/native/jni/java-nio/gnu_java_nio_charset_iconv_IconvEncoder.c,75,style,The scope of the variable cls can 
gcc-4.4.1/libjava/classpath/native/jni/java-io/java_io_VMObjectStreamClass.c,109,style,The scope of the variable classClass can be li
gcc-4.4.1/libjava/classpath/native/jni/java-io/java_io_VMObjectStreamClass.c,112,style,The scope of the variable typeClass can be lim
gcc-4.4.1/libjava/classpath/native/jni/java-io/java_io_VMObjectStreamClass.c,119,style,The scope of the variable tname can be limited
gcc-4.4.1/libjava/classpath/native/jni/java-io/java_io_VMObjectStreamClass.c,120,style,The scope of the variable i can be limited
gcc-4.4.1/libjava/classpath/native/jni/native-lib/cpnet.c,639,style,The scope of the variable i can be limited
gcc-4.4.1/libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c,1114,style,The scope of the variable _bi can be limited
gcc-4.4.1/libjava/classpath/native/jni/native-lib/cpio.c,162,style,The scope of the variable n can be limited
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtdialogpeer.cpp,50,style,Member variable not initialized in the constructor 'MyDialog
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtfontmetrics.cpp,121,style,Redundant condition. It is safe to deallocate a NULL point
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtgraphics.cpp,74,style,C-style pointer casting
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtgraphics.cpp,102,style,C-style pointer casting
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtgraphics.cpp,147,style,C-style pointer casting
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtgraphics.cpp,257,style,C-style pointer casting
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtgraphics.cpp,269,style,C-style pointer casting
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtgraphics.cpp,289,style,C-style pointer casting
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtgraphics.cpp,306,style,C-style pointer casting
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtgraphics.cpp,337,style,C-style pointer casting
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtgraphics.cpp,458,,Memory leak: p
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtgraphics.cpp,475,,Memory leak: p
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/mainqtthread.cpp,92,error,Memory leak: argc
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/componentevent.h,40,style,Redundant condition. It is safe to deallocate a NULL pointer
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/componentevent.h,40,style,Redundant condition. It is safe to deallocate a NULL pointer
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/componentevent.h,40,style,Redundant condition. It is safe to deallocate a NULL pointer
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/componentevent.h,40,style,Redundant condition. It is safe to deallocate a NULL pointer
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/componentevent.h,40,style,Redundant condition. It is safe to deallocate a NULL pointer
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/componentevent.h,40,style,Redundant condition. It is safe to deallocate a NULL pointer
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtscrollpanepeer.cpp,57,style,Member variable not initialized in the constructor 'MySc
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qpen.cpp,105,style,Redundant condition. It is safe to deallocate a NULL pointer
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtmenupeer.cpp,92,style,Member variable not initialized in the constructor 'MenuAction
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/mainthreadinterface.cpp,56,style,C-style pointer casting
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtvolatileimage.cpp,151,style,Redundant condition. It is safe to deallocate a NULL poi
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/componentevent.cpp,219,,Memory leak: p
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/componentevent.cpp,44,style,Member variable not initialized in the constructor 'AWTIni
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/componentevent.cpp,149,style,Member variable not initialized in the constructor 'AWTGe
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/componentevent.cpp,182,style,Member variable not initialized in the constructor 'GetSi
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtpanelpeer.cpp,47,style,Member variable not initialized in the constructor 'MyPanel::
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtembeddedwindowpeer.cpp,108,style,C-style pointer casting
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtembeddedwindowpeer.cpp,72,style,Member variable not initialized in the constructor '
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtcanvaspeer.cpp,48,style,Member variable not initialized in the constructor 'MyCanvas
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtscrollbarpeer.cpp,52,style,Member variable not initialized in the constructor 'MyScr
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtwindowpeer.cpp,54,style,Member variable not initialized in the constructor 'MyWindow
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtlabelpeer.cpp,55,style,Member variable not initialized in the constructor 'MyLabel::
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtfontpeer.cpp,88,style,Redundant condition. It is safe to deallocate a NULL pointer
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qmatrix.cpp,92,style,Redundant condition. It is safe to deallocate a NULL pointer
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtbuttonpeer.cpp,53,style,Member variable not initialized in the constructor 'MyButton
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtscreendevice.cpp,63,style,Redundant condition. It is safe to deallocate a NULL point
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qpainterpath.cpp,126,style,Redundant condition. It is safe to deallocate a NULL pointe
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/slotcallbacks.cpp,75,style,Member variable not initialized in the constructor 'SlotCal
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/slotcallbacks.cpp,75,style,Member variable not initialized in the constructor 'SlotCal
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/slotcallbacks.cpp,75,style,Member variable not initialized in the constructor 'SlotCal
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtimage.cpp,200,,Memory leak: image
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtimage.cpp,233,,Memory leak: image
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtimage.cpp,103,style,Redundant condition. It is safe to deallocate a NULL pointer
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtcheckboxpeer.cpp,108,style,Redundant condition. It is safe to deallocate a NULL poin
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtcheckboxpeer.cpp,72,style,Member variable not initialized in the constructor 'MyChec
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtframepeer.cpp,119,style,C-style pointer casting
gcc-4.4.1/libjava/classpath/native/jni/qt-peer/qtframepeer.cpp,62,style,Member variable not initialized in the constructor 'MyFrame::
gcc-4.4.1/libjava/prims.cc,1697,,Memory leak: ft
gcc-4.4.1/libjava/prims.cc,1876,error,Memory leak: ptr
gcc-4.4.1/libjava/prims.cc,1772,,Memory leak: jdwp
gcc-4.4.1/libjava/java/lang/natVMClassLoader.cc,114,,Memory leak: sb
gcc-4.4.1/libjava/java/lang/natThreadLocal.cc,79,style,C-style pointer casting
gcc-4.4.1/libjava/java/lang/natThreadLocal.cc,91,style,C-style pointer casting
gcc-4.4.1/libjava/java/lang/natThreadLocal.cc,104,style,C-style pointer casting
gcc-4.4.1/libjava/java/lang/natThreadLocal.cc,121,style,C-style pointer casting
gcc-4.4.1/libjava/java/lang/natThreadLocal.cc,133,style,C-style pointer casting
gcc-4.4.1/libjava/java/lang/natString.cc,69,style,The scope of the variable step can be limited
gcc-4.4.1/libjava/java/lang/natObject.cc,864,style,The scope of the variable count can be limited
gcc-4.4.1/libjava/java/lang/natObject.cc,1266,style,The scope of the variable count can be limited
gcc-4.4.1/libjava/java/lang/natObject.cc,365,style,struct or union member 'heavy_lock::reserved_for_gc' is never used
gcc-4.4.1/libjava/java/lang/ref/natReference.cc,77,style,The scope of the variable step can be limited
gcc-4.4.1/libjava/nogc.cc,166,,Memory leak: obj
gcc-4.4.1/libjava/nogc.cc,174,,Memory leak: obj
gcc-4.4.1/libjava/interpret.cc,47,error,Invalid number of character ((). Can't process file.
gcc-4.4.1/libjava/link.cc,66,style,struct or union member 'aligner::c' is never used
gcc-4.4.1/libjava/interpret-run.cc,14,error,Invalid number of character ({). Can't process file.
gcc-4.4.1/libjava/interpret-run.cc,507,style,The scope of the variable tmpval can be limited
gcc-4.4.1/libjava/libltdl/ltdl.c,493,style,The scope of the variable status can be limited
gcc-4.4.1/libjava/libltdl/ltdl.c,2977,style,The scope of the variable i can be limited
gcc-4.4.1/libjava/libltdl/ltdl.c,852,style,struct or union member 'lt_dlhandle_struct::system' is never used
gcc-4.4.1/libjava/libltdl/ltdl.c,3807,error,Possible null pointer dereference
gcc-4.4.1/libjava/libltdl/ltdl.c,1741,style,The scope of the variable j can be limited
gcc-4.4.1/libjava/gnu/classpath/natSystemProperties.cc,278,style,Redundant condition. It is safe to deallocate a NULL pointer
gcc-4.4.1/libjava/gnu/java/nio/channels/natFileChannelWin32.cc,162,,Memory leak: iioe
gcc-4.4.1/libjava/gnu/java/nio/channels/natFileChannelWin32.cc,189,,Memory leak: iioe
gcc-4.4.1/libjava/gnu/java/nio/channels/natFileChannelPosix.cc,228,,Memory leak: iioe
gcc-4.4.1/libjava/gnu/java/nio/channels/natFileChannelPosix.cc,330,,Memory leak: iioe
gcc-4.4.1/libjava/gnu/java/nio/channels/natFileChannelPosix.cc,368,,Memory leak: iioe
gcc-4.4.1/libjava/gnu/java/nio/channels/natFileChannelPosix.cc,523,,Memory leak: buf
gcc-4.4.1/libjava/gnu/java/net/natPlainSocketImplPosix.cc,252,,Memory leak: se
gcc-4.4.1/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc,54,style,struct or union member 'InAddr::addr6' is never used
gcc-4.4.1/libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc,735,style,The scope of the variable level can be limited
gcc-4.4.1/libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc,735,style,The scope of the variable opname can be limited
gcc-4.4.1/libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc,67,style,struct or union member 'InAddr::addr6' is never used
gcc-4.4.1/libjava/gnu/gcj/convert/make-trie.c,143,style,The scope of the variable node_index can be limited
gcc-4.4.1/libjava/gnu/gcj/util/natGCInfo.cc,71,style,struct or union member 'gc_debug_info::used' is never used
gcc-4.4.1/libjava/gnu/gcj/util/natGCInfo.cc,72,style,struct or union member 'gc_debug_info::free' is never used
gcc-4.4.1/libjava/gnu/gcj/util/natGCInfo.cc,73,style,struct or union member 'gc_debug_info::wasted' is never used
gcc-4.4.1/libjava/gnu/gcj/util/natGCInfo.cc,74,style,struct or union member 'gc_debug_info::blocks' is never used
gcc-4.4.1/libjava/gnu/gcj/util/natGCInfo.cc,410,error,Overlapping data buffer temp
gcc-4.4.1/libjava/verify.cc,160,,Memory leak: _Jv_BytecodeVerifier::current_state
gcc-4.4.1/libjava/verify.cc,1127,style,Redundant condition. It is safe to deallocate a NULL pointer
gcc-4.4.1/libjava/verify.cc,1129,style,Redundant condition. It is safe to deallocate a NULL pointer
gcc-4.4.1/libjava/verify.cc,3174,style,Member variable not initialized in the constructor '_Jv_BytecodeVerifier::next_verify_state'
gcc-4.4.1/libjava/verify.cc,3174,style,Member variable not initialized in the constructor '_Jv_BytecodeVerifier::current_state'
gcc-4.4.1/libjava/verify.cc,3174,style,Member variable not initialized in the constructor '_Jv_BytecodeVerifier::start_PC'
gcc-4.4.1/libjava/verify.cc,3174,style,Member variable not initialized in the constructor '_Jv_BytecodeVerifier::PC'

Feel free to download and use cppcheck yourself.

Best regards

Ettl Martin

-------- Original-Nachricht --------
> Datum: Mon, 27 Jul 2009 19:01:31 +0200
> Von: Andrew Haley <aph@redhat.com>
> An: David Daney <ddaney@caviumnetworks.com>
> CC: Martin Ettl <ettl.martin@gmx.de>, java@gcc.gnu.org
> Betreff: Re: found an overlapping data buffer in file natGCInfo.cc

> On 07/27/2009 04:42 PM, David Daney wrote:
> > Andrew Haley wrote:
> 
> >> Thanks. How very weird; I wonder what that code was supposed to do.
> >> 
> > Someone should fix it.  If nobody does soon, I suppose I will as I added
> > it in the first place.
> 
> Please.  I'm a great believer in the idea that one should fix one's own
> bugs.
> Good karma...
> 
> Andrew.

-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser

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

* Re: found an overlapping data buffer in file natGCInfo.cc
  2009-07-27 19:09       ` Martin Ettl
@ 2009-07-28  8:08         ` Andrew Haley
  2009-07-28 14:17           ` Martin Ettl
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Haley @ 2009-07-28  8:08 UTC (permalink / raw)
  To: Martin Ettl; +Cc: ddaney, java

On 07/27/2009 09:09 PM, Martin Ettl wrote:
> Hello friends,
> 
> there are more bugs, not specially in the natGCInfo.cc but in e.g: libjava. I have no time to report all of them. I used cppcheck (an open source static code analysis tool) to find the bugs.
> Here the output of the libjava scan with cppcheck:
> 
> 
> Feel free to download and use cppcheck yourself.

Are any of these actual bugs?  I haven't checked every one, but those I have
are style nag messages.

Andrew.

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

* Re: found an overlapping data buffer in file natGCInfo.cc
  2009-07-28  8:08         ` Andrew Haley
@ 2009-07-28 14:17           ` Martin Ettl
  2009-07-29  7:11             ` Andrew Haley
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Ettl @ 2009-07-28 14:17 UTC (permalink / raw)
  To: Andrew Haley; +Cc: java, ddaney


-------- Original-Nachricht --------
> Datum: Tue, 28 Jul 2009 10:07:56 +0200
> Von: Andrew Haley <aph@redhat.com>
> An: Martin Ettl <ettl.martin@gmx.de>
> CC: ddaney@caviumnetworks.com, java@gcc.gnu.org
> Betreff: Re: found an overlapping data buffer in file natGCInfo.cc

> On 07/27/2009 09:09 PM, Martin Ettl wrote:
> > Hello friends,
> > 
> > there are more bugs, not specially in the natGCInfo.cc but in e.g:
> libjava. I have no time to report all of them. I used cppcheck (an open source
> static code analysis tool) to find the bugs.
> > Here the output of the libjava scan with cppcheck:
> > 
> > 
> > Feel free to download and use cppcheck yourself.
> 
> Are any of these actual bugs?  I haven't checked every one, but those I
> have
> are style nag messages.
> 
> Andrew.

I know, cppcheck brings a lots of stylistic warnings. These can be surpressed by not using the --style option. Then only memleaks, resource leaks and so on are shown.
The intention of my last message was to show you the possibilities of cppcheck, nothing more. I was not my intention to offend you, or your work. Gcc is a great tool, i am using it every day on serveral projects.... keep on guys!

Best regards

Martin


-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser

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

* Re: found an overlapping data buffer in file natGCInfo.cc
  2009-07-28 14:17           ` Martin Ettl
@ 2009-07-29  7:11             ` Andrew Haley
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Haley @ 2009-07-29  7:11 UTC (permalink / raw)
  To: Martin Ettl; +Cc: java, ddaney

On 07/28/2009 04:17 PM, Martin Ettl wrote:
> -------- Original-Nachricht --------
>> Datum: Tue, 28 Jul 2009 10:07:56 +0200
>> Von: Andrew Haley <aph@redhat.com>
>> An: Martin Ettl <ettl.martin@gmx.de>
>> CC: ddaney@caviumnetworks.com, java@gcc.gnu.org
>> Betreff: Re: found an overlapping data buffer in file natGCInfo.cc
> 
>> On 07/27/2009 09:09 PM, Martin Ettl wrote:
>>> Hello friends,
>>>
>>> there are more bugs, not specially in the natGCInfo.cc but in e.g:
>> libjava. I have no time to report all of them. I used cppcheck (an open source
>> static code analysis tool) to find the bugs.
>>> Here the output of the libjava scan with cppcheck:
>>>
>>>
>>> Feel free to download and use cppcheck yourself.

>> Are any of these actual bugs?  I haven't checked every one, but those I
>> have are style nag messages.

> 
> I know, cppcheck brings a lots of stylistic warnings. These can be surpressed by not using the --style option. Then only memleaks, resource leaks and so on are shown.
> The intention of my last message was to show you the possibilities of cppcheck, nothing more. I was not my intention to offend you, or your work. Gcc is a great tool, i am using it every day on serveral projects.... keep on guys!

Sure, I'm not complaining.  You have already found one nasty bug, for which I thank you.

cppcheck looks pretty useful.

Andrew.

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

end of thread, other threads:[~2009-07-29  7:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-27  8:29 found an overlapping data buffer in file natGCInfo.cc Martin Ettl
2009-07-27 10:03 ` Andrew Haley
2009-07-27 14:43   ` David Daney
2009-07-27 17:01     ` Andrew Haley
2009-07-27 19:09       ` Martin Ettl
2009-07-28  8:08         ` Andrew Haley
2009-07-28 14:17           ` Martin Ettl
2009-07-29  7:11             ` Andrew Haley

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