This is the mail archive of the java-prs@sources.redhat.com 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]

gcj/381: gcj miscompiles some loops with -O2



>Number:         381
>Category:       gcj
>Synopsis:       gcj miscompiles some loops with -O2
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apbianco
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 11 07:29:59 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     jeff.sturm@commerceone.com
>Release:        001125
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
The attached test program, derived from java.util.Properties,
dumps core if compiled with -O2.
>How-To-Repeat:
Compile and run TestProperties.java with -O or higher.   If you
break on each iteration of the loop in gdb and do a "print $esp"
you'll see the stack pointer creeping.  Eventually it
overwrites the return address.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="PropertiesTest.java"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="PropertiesTest.java"

aW1wb3J0IGphdmEuaW8uKjsKCnB1YmxpYyBjbGFzcyBQcm9wZXJ0aWVzVGVzdCB7CiAgICBwdWJs
aWMgdm9pZCBsb2FkKFN0cmluZ1JlYWRlciBpbikgdGhyb3dzIElPRXhjZXB0aW9uIHsKICAgICAg
ICBCdWZmZXJlZFJlYWRlciByZWFkZXIgPSBuZXcgQnVmZmVyZWRSZWFkZXIoaW4pOwogICAgICAg
IHdoaWxlICh0cnVlKSB7CgkJCVN0cmluZyBsaW5lID0gcmVhZGVyLnJlYWRMaW5lKCk7CgkJCWlm
IChsaW5lID09IG51bGwpCgkJCQlicmVhazsKICAgICAgICAgICAgaWYgKGxpbmUubGVuZ3RoKCkg
PT0gMCB8fCBsaW5lLnN0YXJ0c1dpdGgoIiMiKSkKICAgICAgICAgICAgCWNvbnRpbnVlOwoJCQlp
bnQgcG9zID0gbGluZS5pbmRleE9mKCc9Jyk7CgkJCVN0cmluZyBrZXkgPSAocG9zID49IDAgPyBs
aW5lLnN1YnN0cmluZygwLCBwb3MpIDogIiIpOwoJCQlTdHJpbmcgZWxlbWVudCA9IGxpbmUuc3Vi
c3RyaW5nKCsrcG9zKTsKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKGtleSArICIsIiAr
IGVsZW1lbnQpOwogICAgICAgIH0KICAgIH0KCglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJp
bmdbXSBhcmdzKSB7CgkJdHJ5IHsKCQkJUHJvcGVydGllc1Rlc3QgcHJvcHMgPSBuZXcgUHJvcGVy
dGllc1Rlc3QoKTsKCQkJcHJvcHMubG9hZChuZXcgU3RyaW5nUmVhZGVyKCIjIHRlc3QgcHJvcGVy
dGllc1xuIiArCgkJCQkiZm9vPWJhclxuIiArCgkJCQkiYmFyPWJhelxuIikpOwoJCX0gY2F0Y2gg
KFRocm93YWJsZSB0KSB7CgkJCXQucHJpbnRTdGFja1RyYWNlKCk7CgkJfQoJfQp9Cg==

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