This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
gcj bug
- To: green@cygnus.com, java-discuss@sourceware.cygnus.com
- Subject: gcj bug
- From: Amancio Hasty Jr <hasty@netcom.com>
- Date: Sat, 12 Jun 1999 21:28:19 -0700 (PDT)
Package mozilla's ldap java sdk http://www.mozilla.org/directory/
File netscape/LDAPConnection.java
Fails to compile method `search(java.lang.String,int,java.lang.String,java.lang.String[],boolean,netscape.ldap.LDAPSearchConstraints)'
public LDAPSearchResults search( String base, int scope, String filter,
String[] attrs, boolean attrsOnly, LDAPSearchConstraints cons )
throws LDAPException {
if (cons == null)
cons = defaultConstraints;
LDAPSearchResults returnValue = new LDAPSearchResults(this,
cons, base, scope, filter, attrs, attrsOnly);
Vector cacheValue = null;
Long key = null;
boolean isKeyValid = true;
try {
// get entry from cache which is a vector of JDAPMessages
if (m_cache != null)
{
// create key for cache entry using search arguments
key = m_cache.createKey(host, port, base, filter, scope, attrs, boundDN, cons);
cacheValue = (Vector)m_cache.getEntry(key);
if (cacheValue != null)
return (new LDAPSearchResults(cacheValue, this, cons, base, scope,
filter, attrs, attrsOnly));
}
} catch (LDAPException e) {
isKeyValid = false;
printDebug("Exception: "+e);
}
bind(cons);
LDAPSearchListener myListener = getSearchListener ( cons );
int deref = cons.getDereference();
JDAPSearchRequest request = new JDAPSearchRequest (base,
scope, deref, cons.getMaxResults(), cons.getTimeLimit(),
attrsOnly, filter, attrs);
synchronized(myListener) {
boolean success = false;
try {
sendRequest (request, myListener, cons);
success = true;
} finally {
if (!success)
releaseSearchListener (myListener);
}
// if using cache, then need to add the key to the search listener.
// The search listener retrieves the key and then add the key and
// a vector of results to the hashtable.
if ((m_cache != null) && (isKeyValid))
myListener.setKey(key);
}
/* Synchronous search if all requested at once */
if ( cons.getBatchSize() == 0 ) {
try {
/* Block until all results are in */
JDAPMessage response = myListener.getResponse ();
Enumeration results = myListener.getSearchResults ();
try {
checkSearchMsg(returnValue, response, cons, base, scope,
filter, attrs, attrsOnly);
} catch ( LDAPException ex ) {
/* Was the exception caused by a bad referral? */
JDAPProtocolOp op = response.getProtocolOp();
if ( (op instanceof JDAPSearchResultReference) ||
(op instanceof JDAPSearchResult) ){
System.err.println( "LDAPConnection.checkSearchMsg: " +
"ignoring bad referral" );
} else {
throw ex;
}
}
while (results.hasMoreElements ()) {
JDAPMessage msg = (JDAPMessage)results.nextElement();
checkSearchMsg(returnValue, msg, cons, base, scope, filter, attrs,
attrsOnly);
}
} catch (LDAPException ee) {
throw ee;
} finally {
releaseSearchListener (myListener);
}
} else {
/*
* Asynchronous to retrieve one at a time, check to make sure
* the search didn't fail
*/
JDAPMessage firstResult = myListener.nextResult ();
if (firstResult == null) {
firstResult = myListener.getResponse ();
try {
checkSearchMsg(returnValue, firstResult, cons, base, scope,
filter, attrs, attrsOnly);
} finally {
releaseSearchListener (myListener);
}
} else {
/* First result could be a bad referral, ultimately causing
a NO_SUCH_OBJECT exception. Don't want to miss all
following results, so skip it. */
try {
checkSearchMsg(returnValue, firstResult, cons, base,
scope, filter, attrs, attrsOnly);
} catch ( LDAPException ex ) {
/* Was the exception caused by a bad referral? */
if (firstResult.getProtocolOp() instanceof
JDAPSearchResultReference) {
System.err.println( "LDAPConnection.checkSearchMsg: " +
"ignoring bad referral" );
} else {
throw ex;
}
}
LDAPControl[] controls = (LDAPControl[])getOption(LDAPv3.SERVERCONTROLS, cons);
for (int i=0; (controls != null) && (i<controls.length); i++) {
if ((controls[i].getClass().getName()).equals(PersistSearchPackageName))
{
returnValue.associatePersistentSearch (myListener);
return returnValue;
}
}
/* we let this listener get garbage collected.. */
returnValue.associate (myListener);
}
}
return returnValue;
}
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/gcc-2.96/jc1 netscape/ldap/LDAPConnection.class -quiet -g1 -version -o /tmp/ccb3haaa.s
GNU Java version gcc-2.96 19990609 (experimental) (i686-pc-linux-gnu) compiled by GNU C version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release).
netscape/ldap/LDAPConnection.java: In class `netscape.ldap.LDAPConnection':
netscape/ldap/LDAPConnection.java: In method `search(java.lang.String,int,java.lang.String,java.lang.String[],boolean,netscape.ldap.LDAPSearchConstraints)':
netscape/ldap/LDAPConnection.java:0: stack underflow
gdb /usr/local/lib/gcc-lib/i686-pc-linux-gnu/gcc-2.96/jc1
(gdb) bt
#0 fatal (msgid=0x81a003b "stack underflow") at ../../egcs/gcc/toplev.c:1947
#1 0x8060968 in pop_type_0 (type=0x8200b60)
at ../../../egcs/gcc/java/expr.c:290
#2 0x8060a6d in pop_type (type=0x8200b60) at ../../../egcs/gcc/java/expr.c:328
#3 0x806351b in process_jvm_instruction (PC=113,
byte_ops=0x8222c0f "\031\006Ç", length=619)
at ../../../egcs/gcc/java/expr.c:2265
#4 0x8063444 in expand_byte_code (jcf=0x81e5d80, method=0x8231ba0)
at ../../../egcs/gcc/java/expr.c:2217
#5 0x806c43a in parse_class_file () at ../../../egcs/gcc/java/jcf-parse.c:726
#6 0x806c860 in yyparse () at ../../../egcs/gcc/java/jcf-parse.c:886
#7 0x8075362 in compile_file (
name=0xbffffd81 "netscape/ldap/LDAPConnection.class")
at ../../egcs/gcc/toplev.c:3265
#8 0x80781c7 in main (argc=8, argv=0xbffffc44) at ../../egcs/gcc/toplev.c:5441
#9 0x40030cb3 in __libc_start_main (main=0x8077308 <main>, argc=8,
argv=0xbffffc44, init=0x8049004 <_init>, fini=0x819101c <_fini>,
rtld_fini=0x4000a350 <_dl_fini>, stack_end=0xbffffc3c)
at ../sysdeps/generic/libc-start.c:78
Method name:"search" public Signature: 690=(java.lang.String,int,java.lang.String,java.lang.String[],boolean,netscape.ldap.LDAPSearchConstraints)netscape.ldap.LDAPSearchResults
Attribute "Code", length:695, max_stack:10, max_locals:20, code_length:619
0: aload 6
2: ifnonnull 11
5: aload_0
6: getfield #209=<Field netscape.ldap.LDAPConnection.defaultConstraints netscape.ldap.LDAPSearchConstraints>
9: astore 6
11: new #105=<Class netscape.ldap.LDAPSearchResults>
14: dup
15: aload_0
16: aload 6
18: aload_1
19: iload_2
20: aload_3
21: aload 4
23: iload 5
25: invokespecial #162=<Method netscape.ldap.LDAPSearchResults.<init> (netscape.ldap.LDAPConnection,netscape.ldap.LDAPSearchConstraints,java.lang.String,int,java.lang.String,java.lang.String[],boolean)void>
28: astore 7
30: aconst_null
31: astore 8
33: aconst_null
34: astore 9
36: iconst_1
37: istore 10
39: aload_0
40: getfield #299=<Field netscape.ldap.LDAPConnection.m_cache netscape.ldap.LDAPCache>
43: ifnull 137
46: aload_0
47: getfield #299=<Field netscape.ldap.LDAPConnection.m_cache netscape.ldap.LDAPCache>
50: aload_0
51: getfield #288=<Field netscape.ldap.LDAPConnection.host java.lang.String>
54: aload_0
55: getfield #324=<Field netscape.ldap.LDAPConnection.port int>
58: aload_1
59: aload_3
60: iload_2
61: aload 4
63: aload_0
64: getfield #190=<Field netscape.ldap.LDAPConnection.boundDN java.lang.String>
67: aload 6
69: invokevirtual #207=<Method netscape.ldap.LDAPCache.createKey (java.lang.String,int,java.lang.String,java.lang.String,int,java.lang.String[],java.lang.String,netscape.ldap.LDAPSearchConstraints)java.lang.Long>
72: astore 9
74: aload_0
75: getfield #299=<Field netscape.ldap.LDAPConnection.m_cache netscape.ldap.LDAPCache>
78: aload 9
80: invokevirtual #241=<Method netscape.ldap.LDAPCache.getEntry (java.lang.Long)java.lang.Object>
83: checkcast #86=<Class java.util.Vector>
86: astore 8
88: aload 8
90: ifnull 137
93: new #105=<Class netscape.ldap.LDAPSearchResults>
96: dup
97: aload 8
99: aload_0
100: aload 6
102: aload_1
103: iload_2
104: aload_3
105: aload 4
107: iload 5
109: invokespecial #159=<Method netscape.ldap.LDAPSearchResults.<init> (java.util.Vector,netscape.ldap.LDAPConnection,netscape.ldap.LDAPSearchConstraints,java.lang.String,int,java.lang.String,java.lang.String[],boolean)void>
112: areturn
113: astore 11
115: iconst_0
116: istore 10
118: new #78=<Class java.lang.StringBuffer>
121: dup
122: ldc #16=<String "Exception: ">
...
Tnks,
Amancio