public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* Re: java/8955: switch case statement causes gcj to throw segmentation fault
@ 2002-12-19 11:35 tromey
0 siblings, 0 replies; 3+ messages in thread
From: tromey @ 2002-12-19 11:35 UTC (permalink / raw)
To: bhun, gcc-bugs, gcc-prs, java-prs, nobody, tromey
Synopsis: switch case statement causes gcj to throw segmentation fault
Responsible-Changed-From-To: unassigned->tromey
Responsible-Changed-By: tromey
Responsible-Changed-When: Thu Dec 19 11:35:07 2002
Responsible-Changed-Why:
I'm handling this.
This is on the fix list for 3.3.
State-Changed-From-To: open->analyzed
State-Changed-By: tromey
State-Changed-When: Thu Dec 19 11:35:07 2002
State-Changed-Why:
I've submitted a patch.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8955
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: java/8955: switch case statement causes gcj to throw segmentation fault
@ 2002-12-20 11:29 tromey
0 siblings, 0 replies; 3+ messages in thread
From: tromey @ 2002-12-20 11:29 UTC (permalink / raw)
To: bhun, gcc-bugs, gcc-prs, java-prs, tromey
Synopsis: switch case statement causes gcj to throw segmentation fault
State-Changed-From-To: analyzed->closed
State-Changed-By: tromey
State-Changed-When: Fri Dec 20 11:29:15 2002
State-Changed-Why:
I've checked in the fix.
It will appear in gcj 3.3.
If you can try it, please do; if there is still a problem
I'll reopen the PR.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8955
^ permalink raw reply [flat|nested] 3+ messages in thread
* java/8955: switch case statement causes gcj to throw segmentation fault
@ 2002-12-15 22:06 bhun
0 siblings, 0 replies; 3+ messages in thread
From: bhun @ 2002-12-15 22:06 UTC (permalink / raw)
To: gcc-gnats
>Number: 8955
>Category: java
>Synopsis: switch case statement causes gcj to throw segmentation fault
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Sun Dec 15 22:06:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Dhek Bhun Kho
>Release: gcc 3.2.1
>Organization:
>Environment:
>Description:
gcc version 3.2 (Mandrake Linux 9.0 3.2-1mdk)
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.2/jc1 /tmp/ccEJu2L1jx -quiet -dumpbase ccEJu2L1jx -g1 -version -foutput-class-dir=cls -fclasspath=/home/java/jar/javax.xml.parsers.jar:src/ -ffilelist-file -fsyntax-only -femit-class-files -o /dev/null
GNU Java version 3.2 (Mandrake Linux 9.0 3.2-1mdk) (i586-mandrake-linux-gnu)
compiled by GNU C version 3.2 (Mandrake Linux 9.0 3.2-1mdk).
Class path starts here:
/home/java/jar/javax.xml.parsers.jar/ (zip)
src/
/usr/share/java/libgcj-3.2.jar/ (system) (zip)
src/org/apache/log4j/Level.java: In class `org.apache.log4j.Level':
src/org/apache/log4j/Level.java: In method `org.apache.log4j.Level.toLevel(int,org.apache.log4j.Level)':
src/org/apache/log4j/Level.java:104: internal error: Segmentation fault
-- is this related to the symbol table problem with c compiler? or is related to opcodes of the jvm? I read that bytecodes differ for ranges without gaps and with gaps, this is one with gaps series: 10000-20000-30000-40000 (int)
>How-To-Repeat:
compile Log4J
offending code: Level toLevel(int val, Level defaultLevel) {
switch(val) {
case ALL_INT: return ALL;
case DEBUG_INT: return Level.DEBUG;
case INFO_INT: return Level.INFO;
case WARN_INT: return Level.WARN;
case ERROR_INT: return Level.ERROR;
case FATAL_INT: return Level.FATAL;
case OFF_INT: return OFF;
default: return defaultLevel;
}
>Fix:
replace switch-case with if-ifelse-ifelse-ifelse-ifelse-else:
e.g:
if (val==ALL_INT) return ALL;
else if (val==DEBUG_INT) return Level.DEBUG;
else if (val==INFO_INT) return Level.INFO;
else if (val==WARN_INT) return Level.WARN;
else if (val==ERROR_INT) return Level.ERROR;
else if (val==FATAL_INT) return Level.FATAL;
else if (val==OFF_INT) return OFF;
else return defaultLevel;
}
causes no segmentation fault.
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-12-20 19:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-19 11:35 java/8955: switch case statement causes gcj to throw segmentation fault tromey
-- strict thread matches above, loose matches on Subject: below --
2002-12-20 11:29 tromey
2002-12-15 22:06 bhun
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).