swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to debug java? (was Re: SimpleObserverSwarm in Java again... :-{


From: pauljohn
Subject: How to debug java? (was Re: SimpleObserverSwarm in Java again... :-{
Date: Sat, 26 May 2001 10:21:50 -0500

I imagine I will have students in your situation soon and so I had
better see if I know what to do to help.  I've made enough notes below
so that one of the experts might be able to tell us what we are supposed
to do when these things go wrong.  Since I've been trying to understand
gdb and jdb in java swarm projects, it is a useful project for me.  And
I hope whoever reads it will chime in with debugging help and insights
about gdb/jdb.

Rick Riolo at U. Mich. said something useful to me about two years ago. 
He said the best way to avoid these problems is to make a program run,
then change one thing at a time so that you always know what might be
causing a problem. My experience with your case shows that the debuggers
don't help me all that much, but I think the stepping in the jdb is
interesting.  

At the very end of this note, I tell you one way how I made your program
run, so if you don't give a hoot about gdb and jdb, hit page down a few
times.

Babjak Jozef wrote:
> 
> I did everything I know - but unfortunately, my application still not
> run. I studied programs jheatbugs and jmousetrap... I fixed mistakes as U
> wrote...
> 
> I sending U my actual sources. I hope someone help me to finish this
> project.
> 
>          Jozef Babjak

Alright, I'm looking at your code with Swarm 2.1.56, and i don't know
what differences there might be between our systems. 

First, this

$ javacswarm *.java
ModelSwarm.java:206: cannot resolve symbol
symbol  : constructor FArgumentsImpl 
(ModelSwarm,swarm.Selector,boolean)
location: class swarm.defobj.FArgumentsImpl
                        actionForEach =
modelActions.createFActionForEachHomogeneous$call(bugList, new
FCallImpl(this, proto, sel, new FArgumentsImpl(this, sel, true)));

Cut out the ",true" from the last part, then it compiles. 

Then when I run it it crashes big time.
$ javaswarm Sysel
ModelSwarm.java: createObject(): food OK
ModelSwarm.java: food.seedFoodWithProb()
ModelSwarm.java: createObject(): creating world
ModelSwarm.java: createObject(): world OK
*** event raised for warning: WarningMessage
*** function: swarm_directory_java_ensure_selector(), file:
/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.64.20010417/src/defobj/java.m,
line: 1892
Method `step' type (@address@hidden:0) differs from Swarm method's type 
(address@hidden:4)
*** execution continuing...
ModelSwarm: buildActions(): creating modelSchedule
ModelSwarm: buildActions(): finished
ModelSwarm: activateIn(): started
ModelSwarm: activatIn(): finishing

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0x656a624f
Function name=(N/A)
Library=(N/A)

NOTE: We are unable to locate the function name symbol for the error
      just occurred. Please refer to release documentation for possible
      reason and solutions.



Current Java thread:
        at swarm.simtoolsgui.GUISwarmImpl.go(Native Method)
        at Sysel.main(Sysel.java:32)

[snip]


I have no way of knowing where the crash is, or what causes it.  There
is the warning about the step method, I know that is about the return
value of your step method not being void, as the new swarm libraries
want. I'll fix that later...  


Rather than digging into your code right away, I decided to try the
debuggers to see if I get info.

First, gdb.

$ export JAVASWARMGDB=gdb
$ javaswarm Sysel
(gdb) bt
#0  0x080616c1 in ?? () at eval.c:41
#1  0x4041c9fe in StubRoutines::_code1 () at eval.c:41
#2  0x4016cd02 in JavaCalls::call_helper () at eval.c:41
#3  0x401f0add in os::os_exception_wrapper () at eval.c:41
#4  0x4016d050 in JavaCalls::call () at eval.c:41
#5  0x40173b9b in jni_invoke () at eval.c:41
#6  0x401775f8 in jni_CallObjectMethod () at eval.c:41
#7  0x405fe93e in JNU_GetStringPlatformChars ()
   from /usr/local/jdk1.3.1/jre/lib/i386/libjava.so
#8  0x40601bcf in Java_java_io_UnixFileSystem_getBooleanAttributes0 ()
   from /usr/local/jdk1.3.1/jre/lib/i386/libjava.so
#9  0x08062125 in ?? () at eval.c:41
#10 0x0805f701 in ?? () at eval.c:41
#11 0x0805f701 in ?? () at eval.c:41
#12 0x0805f701 in ?? () at eval.c:41
#13 0x0805f701 in ?? () at eval.c:41
#14 0x0805f701 in ?? () at eval.c:41
#15 0x4041c9fe in StubRoutines::_code1 () at eval.c:41
#16 0x4016cd02 in JavaCalls::call_helper () at eval.c:41
#17 0x401f0add in os::os_exception_wrapper () at eval.c:41
#18 0x4016d050 in JavaCalls::call () at eval.c:41
#19 0x4019a428 in JVM_DoPrivileged () at eval.c:41
#20 0x405f71be in
Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2
()
   from /usr/local/jdk1.3.1/jre/lib/i386/libjava.so
#21 0x08062125 in ?? () at eval.c:41
#22 0x0805f701 in ?? () at eval.c:41
#23 0x0805f701 in ?? () at eval.c:41
#24 0x0805f701 in ?? () at eval.c:41
#25 0x0805f701 in ?? () at eval.c:41
#26 0x0805f701 in ?? () at eval.c:41
#27 0x4041c9fe in StubRoutines::_code1 () at eval.c:41
#28 0x4016cd02 in JavaCalls::call_helper () at eval.c:41
#29 0x401f0add in os::os_exception_wrapper () at eval.c:41
#30 0x4016d050 in JavaCalls::call () at eval.c:41
#31 0x4016c913 in JavaCalls::call_special () at eval.c:41
#32 0x4020d9e9 in SystemDictionary::load_instance_class () at eval.c:41
#33 0x4020cf3f in SystemDictionary::resolve_instance_class_or_null ()
    at eval.c:41
#34 0x40210b92 in SystemDictionary::resolve_or_null () at eval.c:41
#35 0x4020c63c in SystemDictionary::resolve_or_fail () at eval.c:41
#36 0x401380a0 in ClassFileParser::parse_interfaces () at eval.c:41
#37 0x40139d94 in ClassFileParser::parseClassFile () at eval.c:41
#38 0x4020d72a in SystemDictionary::resolve_from_stream () at eval.c:41
#39 0x40197ad8 in JVM_DefineClass () at eval.c:41
#40 0x405f7a84 in Java_java_lang_ClassLoader_defineClass0 ()
   from /usr/local/jdk1.3.1/jre/lib/i386/libjava.so
#41 0x08062125 in ?? () at eval.c:41
#42 0x0805f701 in ?? () at eval.c:41
#43 0x0805f701 in ?? () at eval.c:41
#44 0x0805f701 in ?? () at eval.c:41
#45 0x0805f701 in ?? () at eval.c:41
#46 0x0805f701 in ?? () at eval.c:41
#47 0x4041c9fe in StubRoutines::_code1 () at eval.c:41
#48 0x4016cd02 in JavaCalls::call_helper () at eval.c:41
#49 0x401f0add in os::os_exception_wrapper () at eval.c:41
#50 0x4016d050 in JavaCalls::call () at eval.c:41
#51 0x4019a428 in JVM_DoPrivileged () at eval.c:41
#52 0x405f71be in
Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2
()
   from /usr/local/jdk1.3.1/jre/lib/i386/libjava.so
#53 0x08062125 in ?? () at eval.c:41
#54 0x0805f701 in ?? () at eval.c:41
#55 0x0805f701 in ?? () at eval.c:41
#56 0x0805f701 in ?? () at eval.c:41
#57 0x0805f701 in ?? () at eval.c:41
#58 0x0805f701 in ?? () at eval.c:41
#59 0x4041c9fe in StubRoutines::_code1 () at eval.c:41
#60 0x4016cd02 in JavaCalls::call_helper () at eval.c:41
#61 0x401f0add in os::os_exception_wrapper () at eval.c:41
#62 0x4016d050 in JavaCalls::call () at eval.c:41
#63 0x4016c913 in JavaCalls::call_special () at eval.c:41
#64 0x4020d9e9 in SystemDictionary::load_instance_class () at eval.c:41
#65 0x4020cf3f in SystemDictionary::resolve_instance_class_or_null ()
    at eval.c:41
#66 0x40210b92 in SystemDictionary::resolve_or_null () at eval.c:41
#67 0x4020c63c in SystemDictionary::resolve_or_fail () at eval.c:41
#68 0x401380a0 in ClassFileParser::parse_interfaces () at eval.c:41
#69 0x40139d94 in ClassFileParser::parseClassFile () at eval.c:41
#70 0x4020d72a in SystemDictionary::resolve_from_stream () at eval.c:41
#71 0x40197ad8 in JVM_DefineClass () at eval.c:41
#72 0x405f7a84 in Java_java_lang_ClassLoader_defineClass0 ()
   from /usr/local/jdk1.3.1/jre/lib/i386/libjava.so
#73 0x08062125 in ?? () at eval.c:41
#74 0x0805f701 in ?? () at eval.c:41
#75 0x0805f701 in ?? () at eval.c:41
#76 0x0805f701 in ?? () at eval.c:41
#77 0x0805f701 in ?? () at eval.c:41
#78 0x0805f701 in ?? () at eval.c:41
#79 0x4041c9fe in StubRoutines::_code1 () at eval.c:41
#80 0x4016cd02 in JavaCalls::call_helper () at eval.c:41
#81 0x401f0add in os::os_exception_wrapper () at eval.c:41
#82 0x4016d050 in JavaCalls::call () at eval.c:41
#83 0x4019a428 in JVM_DoPrivileged () at eval.c:41
#84 0x405f71be in
Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2
()
   from /usr/local/jdk1.3.1/jre/lib/i386/libjava.so
#85 0x08062125 in ?? () at eval.c:41
#86 0x0805f701 in ?? () at eval.c:41
#87 0x0805f701 in ?? () at eval.c:41
#88 0x0805f701 in ?? () at eval.c:41
#89 0x0805f701 in ?? () at eval.c:41
#90 0x0805f701 in ?? () at eval.c:41
#91 0x4041c9fe in StubRoutines::_code1 () at eval.c:41
#92 0x4016cd02 in JavaCalls::call_helper () at eval.c:41
#93 0x401f0add in os::os_exception_wrapper () at eval.c:41
#94 0x4016d050 in JavaCalls::call () at eval.c:41
#95 0x4016c913 in JavaCalls::call_special () at eval.c:41
#96 0x4020d9e9 in SystemDictionary::load_instance_class () at eval.c:41
#97 0x4020cf3f in SystemDictionary::resolve_instance_class_or_null ()
    at eval.c:41
#98 0x40210b92 in SystemDictionary::resolve_or_null () at eval.c:41
#99 0x4020c63c in SystemDictionary::resolve_or_fail () at eval.c:41
#100 0x401380a0 in ClassFileParser::parse_interfaces () at eval.c:41
#101 0x40139d94 in ClassFileParser::parseClassFile () at eval.c:41
#102 0x4020d72a in SystemDictionary::resolve_from_stream () at eval.c:41
#103 0x40197ad8 in JVM_DefineClass () at eval.c:41
#104 0x405f7a84 in Java_java_lang_ClassLoader_defineClass0 ()
   from /usr/local/jdk1.3.1/jre/lib/i386/libjava.so
#105 0x08062125 in ?? () at eval.c:41
#106 0x0805f701 in ?? () at eval.c:41
#107 0x0805f701 in ?? () at eval.c:41
#108 0x0805f701 in ?? () at eval.c:41
#109 0x0805f701 in ?? () at eval.c:41
#110 0x0805f701 in ?? () at eval.c:41
#111 0x4041c9fe in StubRoutines::_code1 () at eval.c:41
#112 0x4016cd02 in JavaCalls::call_helper () at eval.c:41
#113 0x401f0add in os::os_exception_wrapper () at eval.c:41
#114 0x4016d050 in JavaCalls::call () at eval.c:41
#115 0x4019a428 in JVM_DoPrivileged () at eval.c:41
#116 0x405f71be in
Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2
()
   from /usr/local/jdk1.3.1/jre/lib/i386/libjava.so
#117 0x08062125 in ?? () at eval.c:41
#118 0x0805f701 in ?? () at eval.c:41
#119 0x0805f701 in ?? () at eval.c:41
#120 0x0805f701 in ?? () at eval.c:41
#121 0x0805f701 in ?? () at eval.c:41
#122 0x0805f701 in ?? () at eval.c:41
#123 0x4041c9fe in StubRoutines::_code1 () at eval.c:41
#124 0x4016cd02 in JavaCalls::call_helper () at eval.c:41
#125 0x401f0add in os::os_exception_wrapper () at eval.c:41
#126 0x4016d050 in JavaCalls::call () at eval.c:41
#127 0x4016c913 in JavaCalls::call_special () at eval.c:41
#128 0x4020d9e9 in SystemDictionary::load_instance_class () at eval.c:41
#129 0x4020cf3f in SystemDictionary::resolve_instance_class_or_null ()
    at eval.c:41
#130 0x40210b92 in SystemDictionary::resolve_or_null () at eval.c:41
#131 0x4020c63c in SystemDictionary::resolve_or_fail () at eval.c:41
#132 0x401380a0 in ClassFileParser::parse_interfaces () at eval.c:41
#133 0x40139d94 in ClassFileParser::parseClassFile () at eval.c:41
#134 0x4020d72a in SystemDictionary::resolve_from_stream () at eval.c:41
#135 0x40197ad8 in JVM_DefineClass () at eval.c:41
#136 0x405f7a84 in Java_java_lang_ClassLoader_defineClass0 ()
   from /usr/local/jdk1.3.1/jre/lib/i386/libjava.so
#137 0x08062125 in ?? () at eval.c:41
#138 0x0805f701 in ?? () at eval.c:41
#139 0x0805f701 in ?? () at eval.c:41
#140 0x0805f701 in ?? () at eval.c:41
#141 0x0805f701 in ?? () at eval.c:41
#142 0x0805f701 in ?? () at eval.c:41
#143 0x4041c9fe in StubRoutines::_code1 () at eval.c:41
#144 0x4016cd02 in JavaCalls::call_helper () at eval.c:41
#145 0x401f0add in os::os_exception_wrapper () at eval.c:41
#146 0x4016d050 in JavaCalls::call () at eval.c:41
#147 0x4019a428 in JVM_DoPrivileged () at eval.c:41
#148 0x405f71be in
Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2
()
   from /usr/local/jdk1.3.1/jre/lib/i386/libjava.so
#149 0x08062125 in ?? () at eval.c:41
#150 0x0805f701 in ?? () at eval.c:41
#151 0x0805f701 in ?? () at eval.c:41
#152 0x0805f701 in ?? () at eval.c:41
#153 0x0805f701 in ?? () at eval.c:41
#154 0x0805f701 in ?? () at eval.c:41
#155 0x4041c9fe in StubRoutines::_code1 () at eval.c:41
#156 0x4016cd02 in JavaCalls::call_helper () at eval.c:41
#157 0x401f0add in os::os_exception_wrapper () at eval.c:41
#158 0x4016d050 in JavaCalls::call () at eval.c:41
#159 0x4016c913 in JavaCalls::call_special () at eval.c:41
#160 0x4020d9e9 in SystemDictionary::load_instance_class () at eval.c:41
#161 0x4020cf3f in SystemDictionary::resolve_instance_class_or_null ()
    at eval.c:41
#162 0x40210b92 in SystemDictionary::resolve_or_null () at eval.c:41
#163 0x4020c63c in SystemDictionary::resolve_or_fail () at eval.c:41
#164 0x401380a0 in ClassFileParser::parse_interfaces () at eval.c:41
#165 0x40139d94 in ClassFileParser::parseClassFile () at eval.c:41
#166 0x4020d72a in SystemDictionary::resolve_from_stream () at eval.c:41
#167 0x40197ad8 in JVM_DefineClass () at eval.c:41
#168 0x405f7a84 in Java_java_lang_ClassLoader_defineClass0 ()
   from /usr/local/jdk1.3.1/jre/lib/i386/libjava.so
#169 0x08062125 in ?? () at eval.c:41
#170 0x0805f701 in ?? () at eval.c:41
#171 0x0805f701 in ?? () at eval.c:41
#172 0x0805f701 in ?? () at eval.c:41
#173 0x0805f701 in ?? () at eval.c:41
#174 0x0805f701 in ?? () at eval.c:41
#175 0x4041c9fe in StubRoutines::_code1 () at eval.c:41
#176 0x4016cd02 in JavaCalls::call_helper () at eval.c:41
#177 0x401f0add in os::os_exception_wrapper () at eval.c:41
#178 0x4016d050 in JavaCalls::call () at eval.c:41
#179 0x4019a428 in JVM_DoPrivileged () at eval.c:41
#180 0x405f71be in
Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2
()
   from /usr/local/jdk1.3.1/jre/lib/i386/libjava.so
#181 0x08062125 in ?? () at eval.c:41
#182 0x0805f701 in ?? () at eval.c:41
#183 0x0805f701 in ?? () at eval.c:41
#184 0x0805f701 in ?? () at eval.c:41
#185 0x0805f701 in ?? () at eval.c:41
#186 0x0805f701 in ?? () at eval.c:41
#187 0x4041c9fe in StubRoutines::_code1 () at eval.c:41
#188 0x4016cd02 in JavaCalls::call_helper () at eval.c:41
#189 0x401f0add in os::os_exception_wrapper () at eval.c:41
#190 0x4016d050 in JavaCalls::call () at eval.c:41
#191 0x4016c913 in JavaCalls::call_special () at eval.c:41
#192 0x4020d9e9 in SystemDictionary::load_instance_class () at eval.c:41
#193 0x4020cf3f in SystemDictionary::resolve_instance_class_or_null ()
    at eval.c:41
#194 0x40210b92 in SystemDictionary::resolve_or_null () at eval.c:41
#195 0x4020c63c in SystemDictionary::resolve_or_fail () at eval.c:41
#196 0x401380a0 in ClassFileParser::parse_interfaces () at eval.c:41
#197 0x40139d94 in ClassFileParser::parseClassFile () at eval.c:41
#198 0x4020d72a in SystemDictionary::resolve_from_stream () at eval.c:41
#199 0x40197ad8 in JVM_DefineClass () at eval.c:41
#200 0x405f7a84 in Java_java_lang_ClassLoader_defineClass0 ()
   from /usr/local/jdk1.3.1/jre/lib/i386/libjava.so
#201 0x08062125 in ?? () at eval.c:41
#202 0x0805f701 in ?? () at eval.c:41
#203 0x0805f701 in ?? () at eval.c:41
#204 0x0805f701 in ?? () at eval.c:41
#205 0x0805f701 in ?? () at eval.c:41
#206 0x0805f701 in ?? () at eval.c:41
#207 0x4041c9fe in StubRoutines::_code1 () at eval.c:41
#208 0x4016cd02 in JavaCalls::call_helper () at eval.c:41
#209 0x401f0add in os::os_exception_wrapper () at eval.c:41
#210 0x4016d050 in JavaCalls::call () at eval.c:41
#211 0x4019a428 in JVM_DoPrivileged () at eval.c:41
#212 0x405f71be in
Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2Ljava_security_AccessControlContext_2
()
   from /usr/local/jdk1.3.1/jre/lib/i386/libjava.so
#213 0x08062125 in ?? () at eval.c:41
#214 0x0805f701 in ?? () at eval.c:41
#215 0x0805f701 in ?? () at eval.c:41
#216 0x0805f701 in ?? () at eval.c:41
#217 0x0805f701 in ?? () at eval.c:41
#218 0x0805f701 in ?? () at eval.c:41
#219 0x4041c9fe in StubRoutines::_code1 () at eval.c:41
#220 0x4016cd02 in JavaCalls::call_helper () at eval.c:41
#221 0x401f0add in os::os_exception_wrapper () at eval.c:41
#222 0x4016d050 in JavaCalls::call () at eval.c:41
#223 0x4016c913 in JavaCalls::call_special () at eval.c:41
#224 0x4020d9e9 in SystemDictionary::load_instance_class () at eval.c:41
#225 0x4020cf3f in SystemDictionary::resolve_instance_class_or_null ()
    at eval.c:41
#226 0x40210b92 in SystemDictionary::resolve_or_null () at eval.c:41
#227 0x4020c63c in SystemDictionary::resolve_or_fail () at eval.c:41
#228 0x401accaf in find_class_from_class_loader () at eval.c:41
#229 0x4019773b in JVM_FindClassFromClass () at eval.c:41
#230 0x405e28b0 in object_fullinfo_to_classclass ()
   from /usr/local/jdk1.3.1/jre/lib/i386/libverify.so
#231 0x405e234d in merge_fullinfo_types ()
   from /usr/local/jdk1.3.1/jre/lib/i386/libverify.so
#232 0x405e205a in isAssignableTo ()
   from /usr/local/jdk1.3.1/jre/lib/i386/libverify.so
#233 0x405df341 in pop_stack ()
   from /usr/local/jdk1.3.1/jre/lib/i386/libverify.so
#234 0x405de396 in run_dataflow ()
   from /usr/local/jdk1.3.1/jre/lib/i386/libverify.so
#235 0x405dcc26 in verify_method ()
   from /usr/local/jdk1.3.1/jre/lib/i386/libverify.so
#236 0x405dc72f in VerifyClass ()
   from /usr/local/jdk1.3.1/jre/lib/i386/libverify.so
#237 0x405fc91c in VerifyClassCodes ()
   from /usr/local/jdk1.3.1/jre/lib/i386/libjava.so
#238 0x4022cf19 in Verifier::verify_byte_codes () at eval.c:41
#239 0x40154015 in instanceKlass::link_class_impl () at eval.c:41
#240 0x401543bc in instanceKlass::initialize_impl () at eval.c:41
#241 0x401577e1 in instanceKlass::initialize () at eval.c:41
#242 0x401accfe in find_class_from_class_loader () at eval.c:41
#243 0x4017103c in jni_FindClass () at eval.c:41
#244 0x08049ed4 in LoadClass () at eval.c:41
#245 0x08049244 in main () at eval.c:41
#246 0x40446177 in __libc_start_main (main=0x8048c90 <main>, argc=2, 
    ubp_av=0xbffff61c, init=0x8048974 <_init>, fini=0x804aaec <_fini>, 
    rtld_fini=0x4000e184 <_dl_fini>, stack_end=0xbffff614)
    at ../sysdeps/generic/libc-start.c:129



I cannot see any help in this to figure which of your commands is
mistaken, and in gdb it is not possible to set break points so I can't
see how to step through the program.

So I stared for a long time at /usr/bin/javaswarm to try to figure what
I need to do to my environment to make a java swarm program work without
this script, since I want to run jdb, not javaswarm, and after a few
guesses this one seems to get it:

$ export
CLASSPATH=/usr/share/swarm/swarm.jar:/usr/share/swarm/kawa.jar:$CLASSPATH
$ export LD_LIBRARY_PATH=/usr/lib/swarm:$LD_LIBRARY_PATH
address@hidden problem]$ jdb Sysel

After that, I am in jdb!

> stop in Sysel.main
Deferring breakpoint Sysel.main.
It will be set after the class is loaded.
> run
run Sysel
> 
VM Started: Set deferred breakpoint Sysel.main

Breakpoint hit: thread="main", Sysel.main(), line=10, bci=0
  10            Globals.env.initSwarm("bugs", "2.2.1", "address@hidden",
args);

main[1] next


So I hit next a few times, and don't see anything. I notice in the jdb
manual you have to make it tell you where it is, so I type "where" and
it starts telling me where I am after each next:
main[1] where
  [1] ObserverSwarm.buildObjects (ObserverSwarm.java:107)
  [2] Sysel.main (Sysel.java:20)
main[1] next
main[1] 
Step completed: thread="main", Sysel.main(), line=22, bci=64
  22                    if(debug)

main[1] next
main[1] 
Step completed: thread="main", Sysel.main(), line=24, bci=78
  24       topLevelSwarm.buildActions();

main[1] next
main[1] *** event raised for warning: WarningMessage
*** function: swarm_directory_java_ensure_selector(), file:
/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.64.20010417/src/defobj/java.m,
line: 1892
Method `step' type (@address@hidden:0) differs from Swarm method's type 
(address@hidden:4)
*** execution continuing...
ModelSwarm: buildActions(): creating modelSchedule
ModelSwarm: buildActions(): finished

Step completed: thread="main", Sysel.main(), line=26, bci=83
  26                    if(debug)


There's that "method type" warning about "step" again. I'll have to
check that out.

main[1] next
ModelSwarm: activateIn(): started
ModelSwarm: activatIn(): finishing

Step completed: main[1] thread="main", Sysel.main(), line=30, bci=103
  30                    if(debug)

main[1] next

Step completed: main[1] thread="main", Sysel.main(), line=32, bci=117
  32       topLevelSwarm.go();

main[1] next

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0x656a624f
Function name=(N/A)
Library=(N/A)

NOTE: We are unable to locate the function name symbol for the error
      just occurred. Please refer to release documentation for possible
      reason and solutions.



Current Java thread:
        at swarm.simtoolsgui.GUISwarmImpl.go(Native Method)
        at Sysel.main(Sysel.java:32)

Dynamic libraries:
08048000-0804c000 r-xp 00000000 03:05 65182     
/usr/local/jdk1.3.1/bin/i386/native_threads/java
0804c000-0804d000 rw-p 00003000 03:05 65182     
/usr/local/jdk1.3.1/bin/i386/native_threads/java
40000000-40016000 r-xp 00000000 03:05 176478     /lib/ld-2.2.2.so
40016000-40017000 rw-p 00015000 03:05 176478     /lib/ld-2.2.2.so
40018000-40019000 r--p 00000000 03:05 384789    
/usr/lib/locale/en_US/LC_IDENTIFICATION
40019000-4001a000 r--p 00000000 03:05 384790    
/usr/lib/locale/en_US/LC_MEASUREMENT
4001a000-4001b000 r--p 00000000 03:05 384793    
/usr/lib/locale/en_US/LC_TELEPHONE
4001b000-4001c000 r--p 00000000 03:05 384788    
/usr/lib/locale/en_US/LC_ADDRESS
4001c000-4001d000 r--p 00000000 03:05 384791    
/usr/lib/locale/en_US/LC_NAME
4001d000-4001e000 r--p 00000000 03:05 384792    
/usr/lib/locale/en_US/LC_PAPER
4001e000-4001f000 r--p 00000000 03:05 16088     
/usr/lib/locale/en_US/LC_MESSAGES/SYS_LC_MESSAGES
4001f000-40020000 r--p 00000000 03:05 384803    
/usr/lib/locale/en_US/LC_MONETARY
40020000-40021000 r--p 00000000 03:05 384794    
/usr/lib/locale/en_US/LC_TIME
40021000-40022000 r--p 00000000 03:05 208462    
/usr/lib/locale/en_US/LC_NUMERIC
40023000-40030000 r-xp 00000000 03:05 432995    
/lib/i686/libpthread-0.9.so
40030000-40038000 rw-p 0000c000 03:05 432995    
/lib/i686/libpthread-0.9.so
40038000-40041000 r-xp 00000000 03:05 34223     
/usr/local/jdk1.3.1/jre/lib/i386/native_threads/libhpi.so
40041000-40042000 rw-p 00008000 03:05 34223     
/usr/local/jdk1.3.1/jre/lib/i386/native_threads/libhpi.so
40042000-402a9000 r-xp 00000000 03:05 82388     
/usr/local/jdk1.3.1/jre/lib/i386/client/libjvm.so
402a9000-4040f000 rw-p 00266000 03:05 82388     
/usr/local/jdk1.3.1/jre/lib/i386/client/libjvm.so
40426000-40429000 r-xp 00000000 03:05 176491     /lib/libdl-2.2.2.so
40429000-4042a000 rw-p 00002000 03:05 176491     /lib/libdl-2.2.2.so
4042a000-40550000 r-xp 00000000 03:05 432991     /lib/i686/libc-2.2.2.so
40550000-40556000 rw-p 00125000 03:05 432991     /lib/i686/libc-2.2.2.so
4055a000-4056d000 r-xp 00000000 03:05 176496     /lib/libnsl-2.2.2.so
4056d000-4056f000 rw-p 00012000 03:05 176496     /lib/libnsl-2.2.2.so
40572000-40595000 r-xp 00000000 03:05 432993     /lib/i686/libm-2.2.2.so
40595000-40596000 rw-p 00022000 03:05 432993     /lib/i686/libm-2.2.2.so
40596000-405ca000 r-xp 00000000 03:05 272699    
/usr/lib/libstdc++-2-libc6.1-1-2.9.0.so
405ca000-405d6000 rw-p 00033000 03:05 272699    
/usr/lib/libstdc++-2-libc6.1-1-2.9.0.so
405d8000-405e9000 r-xp 00000000 03:05 34228     
/usr/local/jdk1.3.1/jre/lib/i386/libverify.so
405e9000-405eb000 rw-p 00010000 03:05 34228     
/usr/local/jdk1.3.1/jre/lib/i386/libverify.so
405eb000-4060c000 r-xp 00000000 03:05 34229     
/usr/local/jdk1.3.1/jre/lib/i386/libjava.so
4060c000-4060e000 rw-p 00020000 03:05 34229     
/usr/local/jdk1.3.1/jre/lib/i386/libjava.so
4060f000-40623000 r-xp 00000000 03:05 34230     
/usr/local/jdk1.3.1/jre/lib/i386/libzip.so
40623000-40626000 rw-p 00013000 03:05 34230     
/usr/local/jdk1.3.1/jre/lib/i386/libzip.so
40626000-4133f000 r--s 00000000 03:05 34259     
/usr/local/jdk1.3.1/jre/lib/rt.jar
4136c000-41611000 r--s 00000000 03:05 34260     
/usr/local/jdk1.3.1/jre/lib/i18n.jar
41611000-41627000 r--s 00000000 03:05 34247     
/usr/local/jdk1.3.1/jre/lib/sunrsasign.jar
49d2f000-49d4a000 r--p 00000000 03:05 112278    
/usr/lib/locale/en_US/LC_CTYPE
49d4a000-49d50000 r--p 00000000 03:05 48147     
/usr/lib/locale/en_US/LC_COLLATE
49d50000-49d53000 r-xp 00000000 03:05 65154     
/usr/local/jdk1.3.1/lib/i386/libdt_socket.so
49d53000-49d54000 rw-p 00002000 03:05 65154     
/usr/local/jdk1.3.1/lib/i386/libdt_socket.so
49d54000-49d57000 r-xp 00000000 03:05 176509    
/lib/libnss_dns-2.2.2.so
49d57000-49d59000 rw-p 00002000 03:05 176509    
/lib/libnss_dns-2.2.2.so
49d5b000-49d65000 r-xp 00000000 03:05 176512    
/lib/libnss_files-2.2.2.so
49d65000-49d66000 rw-p 00009000 03:05 176512    
/lib/libnss_files-2.2.2.so
49d66000-49d8f000 r-xp 00000000 03:05 65155     
/usr/local/jdk1.3.1/lib/i386/libjdwp.so
49d8f000-49d90000 ---p 00029000 03:05 65155     
/usr/local/jdk1.3.1/lib/i386/libjdwp.so
49d90000-49d91000 rw-p 00029000 03:05 65155     
/usr/local/jdk1.3.1/lib/i386/libjdwp.so
49d94000-49d98000 r-xp 00000000 03:05 451990    
/usr/lib/swarm/libjavaswarm.so.1.0.0
49d98000-49d9a000 rw-p 00003000 03:05 451990    
/usr/lib/swarm/libjavaswarm.so.1.0.0
49d9a000-49d9c000 r-xp 00000000 03:05 16277     
/usr/lib/gconv/ISO8859-1.so
49d9c000-49d9d000 rw-p 00001000 03:05 16277     
/usr/lib/gconv/ISO8859-1.so
49d9f000-49da9000 r-xp 00000000 03:05 176520    
/lib/libnss_nisplus-2.2.2.so
49da9000-49dab000 rw-p 00009000 03:05 176520    
/lib/libnss_nisplus-2.2.2.so
49dab000-49dba000 r-xp 00000000 03:05 176525     /lib/libresolv-2.2.2.so
49dba000-49dbb000 rw-p 0000e000 03:05 176525     /lib/libresolv-2.2.2.so
4abbe000-4ac1a000 r--s 00000000 03:05 227533    
/usr/share/swarm/swarm.jar
4ac1a000-4acdd000 r--s 00000000 03:05 227531    
/usr/share/swarm/kawa.jar
4ad49000-4ae41000 r-xp 00000000 03:05 452006    
/usr/lib/swarm/libjavaswarmstubs.so.0.0.0
4ae41000-4ae42000 rw-p 000f7000 03:05 452006    
/usr/lib/swarm/libjavaswarmstubs.so.0.0.0
4ae42000-4ae46000 r-xp 00000000 03:05 452025    
/usr/lib/swarm/libswarm.so.0.0.0
4ae46000-4ae48000 rw-p 00003000 03:05 452025    
/usr/lib/swarm/libswarm.so.0.0.0
4ae48000-4ae5d000 r-xp 00000000 03:05 452001    
/usr/lib/swarm/libobjc.so.0.0.0
4ae5d000-4ae5f000 rw-p 00014000 03:05 452001    
/usr/lib/swarm/libobjc.so.0.0.0
4ae5f000-4ae6e000 r-xp 00000000 03:05 452021    
/usr/lib/swarm/libspace.so.2.0.1
4ae6e000-4ae73000 rw-p 0000e000 03:05 452021    
/usr/lib/swarm/libspace.so.2.0.1
4ae73000-4ae84000 r-xp 00000000 03:05 451985    
/usr/lib/swarm/libanalysis.so.4.0.0
4ae84000-4ae89000 rw-p 00010000 03:05 451985    
/usr/lib/swarm/libanalysis.so.4.0.0
4ae89000-4aea4000 r-xp 00000000 03:05 452017    
/usr/lib/swarm/libsimtoolsgui.so.5.0.0
4aea4000-4aeaa000 rw-p 0001a000 03:05 452017    
/usr/lib/swarm/libsimtoolsgui.so.5.0.0
4aeaa000-4aeb5000 r-xp 00000000 03:05 452013    
/usr/lib/swarm/libsimtools.so.4.0.0
4aeb5000-4aeb9000 rw-p 0000a000 03:05 452013    
/usr/lib/swarm/libsimtools.so.4.0.0
4aeb9000-4af16000 r-xp 00000000 03:05 452009    
/usr/lib/swarm/librandom.so.1.0.0
4af16000-4af2a000 rw-p 0005c000 03:05 452009    
/usr/lib/swarm/librandom.so.1.0.0
4af2a000-4af69000 r-xp 00000000 03:05 452033    
/usr/lib/swarm/libtkobjc.so.5.0.1
4af69000-4af79000 rw-p 0003e000 03:05 452033    
/usr/lib/swarm/libtkobjc.so.5.0.1
4af79000-4af84000 r-xp 00000000 03:05 452029    
/usr/lib/swarm/libtclobjc.so.0.1.3
4af84000-4af86000 rw-p 0000a000 03:05 452029    
/usr/lib/swarm/libtclobjc.so.0.1.3
4af86000-4afa4000 r-xp 00000000 03:05 452005    
/usr/lib/swarm/libobjectbase.so.4.0.0
4afa4000-4afab000 rw-p 0001d000 03:05 452005    
/usr/lib/swarm/libobjectbase.so.4.0.0
4afab000-4afcd000 r-xp 00000000 03:05 451981    
/usr/lib/swarm/libactivity.so.5.0.0
4afcd000-4afd6000 rw-p 00021000 03:05 451981    
/usr/lib/swarm/libactivity.so.5.0.0
4afd6000-4b03a000 r-xp 00000000 03:05 451993    
/usr/lib/swarm/libdefobj.so.4.0.0
4b03a000-4b059000 rw-p 00063000 03:05 451993    
/usr/lib/swarm/libdefobj.so.4.0.0
4b05a000-4b08d000 r-xp 00000000 03:05 451989    
/usr/lib/swarm/libcollections.so.3.0.1
4b08d000-4b09a000 rw-p 00032000 03:05 451989    
/usr/lib/swarm/libcollections.so.3.0.1
4b09a000-4b09f000 r-xp 00000000 03:05 451997    
/usr/lib/swarm/libmisc.so.1.1.3
4b09f000-4b0a0000 rw-p 00004000 03:05 451997    
/usr/lib/swarm/libmisc.so.1.1.3
4b0ab000-4b15d000 r-xp 00000000 03:05 273509     /usr/lib/libBLT24.so
4b15d000-4b16c000 rw-p 000b1000 03:05 273509     /usr/lib/libBLT24.so
4b16d000-4b21b000 r-xp 00000000 03:05 272940     /usr/lib/libtk8.3.so
main[1] 4b21b000-4b225000 rw-p 000ad000 03:05 272940    
/usr/lib/libtk8.3.so
4b226000-4b2a4000 r-xp 00000000 03:05 272877     /usr/lib/libtcl8.3.so
4b2a4000-4b2ac000 rw-p 0007d000 03:05 272877     /usr/lib/libtcl8.3.so
4b2ad000-4b2bb000 r-xp 00000000 03:05 259103    
/usr/X11R6/lib/libXpm.so.4.11
4b2bb000-4b2bc000 rw-p 0000d000 03:05 259103    
/usr/X11R6/lib/libXpm.so.4.11
4b2bc000-4b2db000 r-xp 00000000 03:05 272959    
/usr/lib/libpng.so.2.1.0.9
4b2db000-4b2dd000 rw-p 0001e000 03:05 272959    
/usr/lib/libpng.so.2.1.0.9
4b2dd000-4b372000 r-xp 00000000 03:05 273518    
/usr/lib/libhdf5.so.0.0.0
4b372000-4b374000 rw-p 00094000 03:05 273518    
/usr/lib/libhdf5.so.0.0.0
4b375000-4b381000 r-xp 00000000 03:05 272956     /usr/lib/libz.so.1.1.3
4b381000-4b383000 rw-p 0000b000 03:05 272956     /usr/lib/libz.so.1.1.3
4b383000-4b45e000 r-xp 00000000 03:05 259083    
/usr/X11R6/lib/libX11.so.6.2
4b45e000-4b462000 rw-p 000da000 03:05 259083    
/usr/X11R6/lib/libX11.so.6.2

Local Time = Sat May 26 09:19:08 2001
Elapsed Time = 775
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.3.1-rc2-b23 interpreted mode)
#
# An error report file has been saved as hs_err_pid6860.log.
# Please refer to the file for further information.
#

The application has been disconnected


Hmm. That's interesting.

SO, I go back to that thing about the step method being wrong, and now
swarm does not want returns from methods with that name, so either I
rename yours or I give it void return value, so I change it to:

public void step()

and remove the return this at the end.

After recompiling, the program still crashes in the same way.  I've
stepped through it several times, and the disaster always happens when
you say "go" to the topLevelSwarm.

So I go digging in your code and I am distracted by many many
System.out.println statements.  I don't know if these things are helping
in java, but I think Marcus Daniels told me that in C they are not
helpful because some printf statements get swallowed or lost when
programs crash, so prints like this don't necessarily tell you where a
job crashes. Although it seems like they ought to. 

In your ModelSwarm, I am focused on the code that you mention,
particularly:
 
actionForEach =
modelActions.createFActionForEachHomogeneous$call(bugList, new
FCallImpl(this, proto, sel, new FArgumentsImpl(this, sel)));

and I find that, if I comment that out, the model does not crash.

I've experienced problems like this before, and I confess I've given up
on trying to figure what is wrong. Instead, I've done the easy route
like this. Create a method in ModelSwarm that does the stepping through
the list:

    public void stepAgents (){
        Iterator iterator = bugList.listIterator(0);
        Agent abug = null ;

        while (iterator.hasNext()){
            abug = (Bug) iterator.next();
            abug.step();
        }
    }

        Then replace the try{}catch{} thing you now have with this:
    try {
            modelActions.createActionTo$message
                (this, new Selector (this.getClass (), "stepAgents",
false));
        } catch (Exception e) {
            e.printStackTrace (System.err);
            System.exit (1);
        }

After adding the import:
import java.util.Iterator;

That makes the program run and it does not crash.

That tells me even more precisely where the problem is in your original
code, but I do not see a mistake in your code (I cut out some println
statements):

        try
                {
                        Bug proto = (Bug) bugList.get(0);
                        Selector sel = new Selector(proto.getClass(), "step", 
false);
                        actionForEach =
modelActions.createFActionForEachHomogeneous$call(bugList, new
FCallImpl(this, proto, sel, new FArgumentsImpl(this, sel)));
                } 
                catch(Exception e)
                {
                        System.out.println("ModelSwarm: buildActions(): New 
Selector
Exception");
                }
                

I don't see anything wrong here, comparing against the jheatbugs code. 
I realize I've been here before and gave up, taking the easy road I give
above.

Good luck

p.s. If you are not a member of Swarm Development Group, you should join
now, because people who are not members can only expect a limited amount
of help...

-- 
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ukans.edu/~pauljohn
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66045                FAX: (785) 864-5700

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]