public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/26858]  New: NullPointerException not generated for large classes...
@ 2006-03-24 23:41 daney at gcc dot gnu dot org
  2006-03-25  1:56 ` [Bug libgcj/26858] " daney at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: daney at gcc dot gnu dot org @ 2006-03-24 23:41 UTC (permalink / raw)
  To: java-prs

When running on some Linux kernels, the heap is mapped into memory low in the
address space.  Dereferencing a null pointer for class with a lot of fields an
erroneously access the heap instead of throwing a NullPointerException.


-- 
           Summary: NullPointerException not generated for large classes...
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: daney at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug libgcj/26858] NullPointerException not generated for large classes...
  2006-03-24 23:41 [Bug libgcj/26858] New: NullPointerException not generated for large classes daney at gcc dot gnu dot org
@ 2006-03-25  1:56 ` daney at gcc dot gnu dot org
  2006-03-25  1:57 ` daney at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: daney at gcc dot gnu dot org @ 2006-03-25  1:56 UTC (permalink / raw)
  To: java-prs



------- Comment #1 from daney at gcc dot gnu dot org  2006-03-25 01:56 -------
*** Bug 26860 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug libgcj/26858] NullPointerException not generated for large classes...
  2006-03-24 23:41 [Bug libgcj/26858] New: NullPointerException not generated for large classes daney at gcc dot gnu dot org
  2006-03-25  1:56 ` [Bug libgcj/26858] " daney at gcc dot gnu dot org
@ 2006-03-25  1:57 ` daney at gcc dot gnu dot org
  2006-03-27 18:28 ` mckinlay at redhat dot com
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: daney at gcc dot gnu dot org @ 2006-03-25  1:57 UTC (permalink / raw)
  To: java-prs



------- Comment #2 from daney at gcc dot gnu dot org  2006-03-25 01:57 -------
The testcase has been committed to the libgcj testsuite as
testsuite/libjava.lang/PR26858.java


-- 


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


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

* [Bug libgcj/26858] NullPointerException not generated for large classes...
  2006-03-24 23:41 [Bug libgcj/26858] New: NullPointerException not generated for large classes daney at gcc dot gnu dot org
  2006-03-25  1:56 ` [Bug libgcj/26858] " daney at gcc dot gnu dot org
  2006-03-25  1:57 ` daney at gcc dot gnu dot org
@ 2006-03-27 18:28 ` mckinlay at redhat dot com
  2006-03-27 18:42 ` ddaney at avtrex dot com
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mckinlay at redhat dot com @ 2006-03-27 18:28 UTC (permalink / raw)
  To: java-prs



------- Comment #3 from mckinlay at redhat dot com  2006-03-27 18:28 -------
GCJ could be made to generate explicit null checks when large offsets are used.
It is probably relatively rare to have a normal object that is larger than a
page, so performance for most apps shouldn't be effected.

Note that array accesses should not need this as the "length" field will be
dereferenced first, triggering NullPointerException, assuming bounds checks are
used. I would also expect Strings should not have a problem.

Do we know who's heap exactly is mapped at such a low address? If its mapped by
Java/Boehm GC, then we can probably just fix the GC to not map things at such
low addresses (or to insert guard pages there instead).


-- 


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


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

* [Bug libgcj/26858] NullPointerException not generated for large classes...
  2006-03-24 23:41 [Bug libgcj/26858] New: NullPointerException not generated for large classes daney at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-03-27 18:28 ` mckinlay at redhat dot com
@ 2006-03-27 18:42 ` ddaney at avtrex dot com
  2006-03-30 14:24 ` aph at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ddaney at avtrex dot com @ 2006-03-27 18:42 UTC (permalink / raw)
  To: java-prs



------- Comment #4 from ddaney at avtrex dot com  2006-03-27 18:42 -------
Subject: Re:  NullPointerException not generated for large
 classes...

mckinlay at redhat dot com wrote:
> ------- Comment #3 from mckinlay at redhat dot com  2006-03-27 18:28 -------
> GCJ could be made to generate explicit null checks when large offsets are used.
> It is probably relatively rare to have a normal object that is larger than a
> page, so performance for most apps shouldn't be effected.
> 
> Note that array accesses should not need this as the "length" field will be
> dereferenced first, triggering NullPointerException, assuming bounds checks are
> used. I would also expect Strings should not have a problem.
> 
> Do we know who's heap exactly is mapped at such a low address? If its mapped by
> Java/Boehm GC, then we can probably just fix the GC to not map things at such
> low addresses (or to insert guard pages there instead).

It is libgcj's (Boehm GC) heap in my tests that is at 0x1000.

This message:

http://gcc.gnu.org/ml/java/2006-03/msg00206.html

Has more thoughts on the subject.

David Daney.


-- 


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


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

* [Bug libgcj/26858] NullPointerException not generated for large classes...
  2006-03-24 23:41 [Bug libgcj/26858] New: NullPointerException not generated for large classes daney at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2006-03-30 14:24 ` aph at gcc dot gnu dot org
@ 2006-03-30 14:24 ` aph at gcc dot gnu dot org
  2006-03-31 11:43 ` aph at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: aph at gcc dot gnu dot org @ 2006-03-30 14:24 UTC (permalink / raw)
  To: java-prs



------- Comment #5 from aph at gcc dot gnu dot org  2006-03-30 14:24 -------
I'm testing a patch for this.


-- 

aph at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aph at gcc dot gnu dot org


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


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

* [Bug libgcj/26858] NullPointerException not generated for large classes...
  2006-03-24 23:41 [Bug libgcj/26858] New: NullPointerException not generated for large classes daney at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-03-27 18:42 ` ddaney at avtrex dot com
@ 2006-03-30 14:24 ` aph at gcc dot gnu dot org
  2006-03-30 14:24 ` aph at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: aph at gcc dot gnu dot org @ 2006-03-30 14:24 UTC (permalink / raw)
  To: java-prs



-- 

aph at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |aph at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-03-30 14:24:24
               date|                            |


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


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

* [Bug libgcj/26858] NullPointerException not generated for large classes...
  2006-03-24 23:41 [Bug libgcj/26858] New: NullPointerException not generated for large classes daney at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2006-03-30 14:24 ` aph at gcc dot gnu dot org
@ 2006-03-31 11:43 ` aph at gcc dot gnu dot org
  2006-03-31 13:05 ` aph at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: aph at gcc dot gnu dot org @ 2006-03-31 11:43 UTC (permalink / raw)
  To: java-prs



------- Comment #6 from aph at gcc dot gnu dot org  2006-03-31 11:43 -------
Subject: Bug 26858

Author: aph
Date: Fri Mar 31 11:43:43 2006
New Revision: 112574

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=112574
Log:
2006-03-30  Andrew Haley  <aph@redhat.com>

        PR java/26858
        * lang.c (java_attribute_table): New.
        (LANG_HOOKS_ATTRIBUTE_TABLE): Define.
        * expr.c (build_field_ref): Add a null pointer check for all
        fields of offset > 4k.  Don't do so for accesses via the this
        pointer, which we know can never be null.
        * class.c (build_java_method_type): Mark arg 1 of all nonstatic
        methods nonnull.


Modified:
    trunk/gcc/java/ChangeLog
    trunk/gcc/java/class.c
    trunk/gcc/java/expr.c
    trunk/gcc/java/lang.c


-- 


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


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

* [Bug libgcj/26858] NullPointerException not generated for large classes...
  2006-03-24 23:41 [Bug libgcj/26858] New: NullPointerException not generated for large classes daney at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2006-03-31 11:43 ` aph at gcc dot gnu dot org
@ 2006-03-31 13:05 ` aph at gcc dot gnu dot org
  2006-04-03 14:31 ` aph at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: aph at gcc dot gnu dot org @ 2006-03-31 13:05 UTC (permalink / raw)
  To: java-prs



------- Comment #7 from aph at gcc dot gnu dot org  2006-03-31 13:05 -------
Subject: Bug 26858

Author: aph
Date: Fri Mar 31 13:05:32 2006
New Revision: 112575

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=112575
Log:
2006-03-30  Andrew Haley  <aph@redhat.com>

        PR java/26858
        * lang.c (java_attribute_table): New.
        (LANG_HOOKS_ATTRIBUTE_TABLE): Define.
        * expr.c (build_field_ref): Add a null pointer check for all
        fields of offset > 4k.  Don't do so for accesses via the this
        pointer, which we know can never be null.
        * class.c (build_java_method_type): Mark arg 1 of all nonstatic
        methods nonnull.


Modified:
    branches/gcc-4_1-branch/gcc/java/ChangeLog
    branches/gcc-4_1-branch/gcc/java/class.c
    branches/gcc-4_1-branch/gcc/java/expr.c
    branches/gcc-4_1-branch/gcc/java/lang.c


-- 


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


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

* [Bug libgcj/26858] NullPointerException not generated for large classes...
  2006-03-24 23:41 [Bug libgcj/26858] New: NullPointerException not generated for large classes daney at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2006-03-31 13:05 ` aph at gcc dot gnu dot org
@ 2006-04-03 14:31 ` aph at gcc dot gnu dot org
  2006-04-03 15:22 ` aph at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: aph at gcc dot gnu dot org @ 2006-04-03 14:31 UTC (permalink / raw)
  To: java-prs



------- Comment #8 from aph at gcc dot gnu dot org  2006-04-03 14:31 -------
Subject: Bug 26858

Author: aph
Date: Mon Apr  3 14:31:56 2006
New Revision: 112640

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=112640
Log:
2006-04-03  Andrew Haley  <aph@redhat.com>

        PR java/26858
        * expr.c (build_field_ref): Don't check the field offset if
        flag_syntax_only.


Modified:
    trunk/gcc/java/ChangeLog
    trunk/gcc/java/expr.c


-- 


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


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

* [Bug libgcj/26858] NullPointerException not generated for large classes...
  2006-03-24 23:41 [Bug libgcj/26858] New: NullPointerException not generated for large classes daney at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2006-04-03 14:31 ` aph at gcc dot gnu dot org
@ 2006-04-03 15:22 ` aph at gcc dot gnu dot org
  2006-04-18 16:53 ` aph at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: aph at gcc dot gnu dot org @ 2006-04-03 15:22 UTC (permalink / raw)
  To: java-prs



------- Comment #9 from aph at gcc dot gnu dot org  2006-04-03 15:22 -------
Subject: Bug 26858

Author: aph
Date: Mon Apr  3 15:22:21 2006
New Revision: 112641

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=112641
Log:
2006-04-03  Andrew Haley  <aph@redhat.com>

        PR java/26858
        * expr.c (build_field_ref): Don't check the field offset if
        flag_syntax_only.


Modified:
    branches/gcc-4_1-branch/gcc/java/ChangeLog
    branches/gcc-4_1-branch/gcc/java/expr.c


-- 


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


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

* [Bug libgcj/26858] NullPointerException not generated for large classes...
  2006-03-24 23:41 [Bug libgcj/26858] New: NullPointerException not generated for large classes daney at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2006-04-03 15:22 ` aph at gcc dot gnu dot org
@ 2006-04-18 16:53 ` aph at gcc dot gnu dot org
  2006-04-30  4:24 ` pinskia at gcc dot gnu dot org
  2006-05-04 13:54 ` aph at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: aph at gcc dot gnu dot org @ 2006-04-18 16:53 UTC (permalink / raw)
  To: java-prs



-- 

aph at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |WAITING


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


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

* [Bug libgcj/26858] NullPointerException not generated for large classes...
  2006-03-24 23:41 [Bug libgcj/26858] New: NullPointerException not generated for large classes daney at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2006-04-18 16:53 ` aph at gcc dot gnu dot org
@ 2006-04-30  4:24 ` pinskia at gcc dot gnu dot org
  2006-05-04 13:54 ` aph at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-04-30  4:24 UTC (permalink / raw)
  To: java-prs



------- Comment #10 from pinskia at gcc dot gnu dot org  2006-04-30 04:24 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

* [Bug libgcj/26858] NullPointerException not generated for large classes...
  2006-03-24 23:41 [Bug libgcj/26858] New: NullPointerException not generated for large classes daney at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2006-04-30  4:24 ` pinskia at gcc dot gnu dot org
@ 2006-05-04 13:54 ` aph at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: aph at gcc dot gnu dot org @ 2006-05-04 13:54 UTC (permalink / raw)
  To: java-prs



------- Comment #11 from aph at gcc dot gnu dot org  2006-05-04 13:54 -------
Subject: Bug 26858

Author: aph
Date: Thu May  4 13:54:15 2006
New Revision: 113526

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113526
Log:
2006-05-04  Andrew Haley  <aph@redhat.com>

        PR java/26858
        * testsuite/libjava.lang/PR26858.xfail: Delete.


Removed:
    trunk/libjava/testsuite/libjava.lang/PR26858.xfail
Modified:
    trunk/libjava/ChangeLog


-- 


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


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

end of thread, other threads:[~2006-05-04 13:54 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-24 23:41 [Bug libgcj/26858] New: NullPointerException not generated for large classes daney at gcc dot gnu dot org
2006-03-25  1:56 ` [Bug libgcj/26858] " daney at gcc dot gnu dot org
2006-03-25  1:57 ` daney at gcc dot gnu dot org
2006-03-27 18:28 ` mckinlay at redhat dot com
2006-03-27 18:42 ` ddaney at avtrex dot com
2006-03-30 14:24 ` aph at gcc dot gnu dot org
2006-03-30 14:24 ` aph at gcc dot gnu dot org
2006-03-31 11:43 ` aph at gcc dot gnu dot org
2006-03-31 13:05 ` aph at gcc dot gnu dot org
2006-04-03 14:31 ` aph at gcc dot gnu dot org
2006-04-03 15:22 ` aph at gcc dot gnu dot org
2006-04-18 16:53 ` aph at gcc dot gnu dot org
2006-04-30  4:24 ` pinskia at gcc dot gnu dot org
2006-05-04 13:54 ` aph 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).