Bug - Not A Bug hermit() throws debug log, gcli 'hermit' simply hangs

ziz

Member
Debug log attached contains two (different) hermit-related problems (EDIT) in r9557:

Code:
> ash hermit(3, $item[ten-leaf clover]);

fails, and

Code:
> hermit 3 clover

simply hangs without doing anything, preventing other commands from working properly.

(I imagine these are related to the uberrefactor of the hermit+coinmaster stuff. First problem I've seen with it, at least!)
 

Attachments

  • DEBUG_20110702.txt
    32.4 KB · Views: 44
Last edited:

Veracity

Developer
Staff member
Your debug log seems to indicate you are using version 14.6 - which is very old.
I just tried with the latest daily build and it worked perfectly.

Download a new build and try again.
 

ziz

Member
Sorry, I forgot to include the version (and corrected the post, but only after you responded). I'm building from source; this was from r9557. Now I've upgraded to r9558; I managed to squeak one more try in before rollover, and I no longer experience the problem.

Thanks, whatever you did. :)
 

lostcalpolydude

Developer
Staff member
9558 only changed chat, so it couldn't have fixed this issue. Since you aren't having a problem now, I changed this to Not A Bug.
 

Veracity

Developer
Staff member
I build from the source. Here is what my debug says:

Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
          KoLmafia v14.6 r9557, Mac OS X, Java 1.6.0_26
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Here is your debug log:

Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
             KoLmafia v14.6, Mac OS X, Java 1.6.0_24
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Notice how mine shows that I am 14.6 + a revision number whereas yours says simply 14.6.

I am curious how you are building from the source without the revision number appearing in the version string.
 

ziz

Member
Here's what I do. (If I'm doing something horribly silly, I will gladly change my habits.)

Compilation:

Code:
$ svn up
At revision 9558.

$ ant clean; ant jar
Buildfile: /Users/ziz/Source/kol/src/kolmafia/build.xml

clean:
  [symlink] Removing symlink: dist/KoLmafia-14.6/Applications

BUILD SUCCESSFUL
Total time: 1 second
Buildfile: /Users/ziz/Source/kol/src/kolmafia/build.xml

init:

setversion:

version:
     [echo] Current revision: 9558

jar:

init:

jikeshome:

javahome:
     [exec] java version "1.6.0_24"
     [exec] Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326)
     [exec] Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode)

compile:
     [echo] Using modern compiler
    [javac] Compiling 736 source files to /Users/ziz/Source/kol/src/kolmafia/build
     [copy] Copying 152 files to /Users/ziz/Source/kol/src/kolmafia/build
     [copy] Copying 2 files to /Users/ziz/Source/kol/src/kolmafia/build
      [jar] Building jar: /Users/ziz/Source/kol/src/kolmafia/dist/KoLmafia-14.6.jar

BUILD SUCCESSFUL
Total time: 16 seconds

Debug log, after that compilation:

Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
             KoLmafia v14.6, Mac OS X, Java 1.6.0_24
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Please note: do not post this log in the KoLmafia thread. If you
 would like the dev team to look at it, please write a bug report
 at kolmafia.us. Include specific information about what you were 
 doing when you made this and include the log as an attachment.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Timestamp: Sat Jul 02 22:38:21 MDT 2011
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 

ziz

Member
9558 only changed chat, so it couldn't have fixed this issue. Since you aren't having a problem now, I changed this to Not A Bug.

For what it's worth, there does appear to be a change that touches something related to coinmasters in 9558 (possibly not intended to have been shipped with this revision?) although I have no idea if it would affect the issue I was seeing (EDIT: doesn't look like it; 9557 isn't hanging for me doing the hermit looting on a spare character, although admittedly that character has never ascended):

Code:
Index: src/net/sourceforge/kolmafia/textui/RuntimeLibrary.java
===================================================================
--- src/net/sourceforge/kolmafia/textui/RuntimeLibrary.java	(revision 9557)
+++ src/net/sourceforge/kolmafia/textui/RuntimeLibrary.java	(revision 9558)
@@ -2234,15 +2234,16 @@
 
 	private static Value coinmaster_buy( final Value master, final Value countValue, final Value itemValue )
 	{
-		CoinmasterData data = (CoinmasterData) master.rawValue();
 		int count = countValue.intValue();
 		if ( count <= 0 )
 		{
 			return RuntimeLibrary.continueValue();
 		}
+		CoinmasterData data = (CoinmasterData) master.rawValue();
 		AdventureResult item = new AdventureResult( itemValue.intValue(), count );
+		int initialAmount = item.getCount( KoLConstants.inventory );
 		CoinMasterRequest.buy( data, item );
-		return RuntimeLibrary.continueValue();
+		return DataTypes.makeBooleanValue( initialAmount + count == item.getCount( KoLConstants.inventory ) );
 	}
 
 	public static Value sell( final Value master, final Value countValue, final Value itemValue )
 
Last edited:

Veracity

Developer
Staff member
Since you are able to pick out that code as "touching something related to coinmasters", I am SURE you were able to understand that it changes the return value of the ASH "buy( coinmaster ...)" command to check whether your inventory increased by the right amount, just like the non-coinmasters "buy" command does.

I mean, there had to be a reason why you felt compelled to post it.

Even though if you REALLY understood what the hell it was doing, it would be obvious that it had nothing to do with the "hermit" command.
 
For what it's worth, I also compile from the code, and my debug log header looks like this:
Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
             KoLmafia v14.6, Windows 7, Java 1.6.0_26
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Also, the revision number doesn't appear in the mafia window, but get_revision() does report it properly.

I just use "ant jsmooth", though I have modified build.xml slightly, though I'm not sure what change I made that would cause this to occur.
Code:
Index: build.xml
===================================================================
--- build.xml	(revision 9557)
+++ build.xml	(working copy)
@@ -219,16 +219,18 @@
 	<!--  generate the standard EXE  -->
 	<!-- =========================== -->
 
-	<target name="jsmooth" depends="init,update,jar">
+	<target name="jsmooth" depends="clean,init,update,jar">
 
 		<move file="${win.jsmoothfile}" tofile="${win.tmp.jsmoothfile}" />
 		<replace file="${win.tmp.jsmoothfile}" token="dist/KoLmafia.exe" value="${exefile}" />
 		<replace file="${win.tmp.jsmoothfile}" token="dist/KoLmafia.jar" value="${jarfile}" />
 
 		<taskdef name="jsmooth" classname="net.charabia.jsmoothgen.ant.JSmoothGen" classpath="${util}/windows/jsmoothgen-ant.jar" />
+		<jsmooth project="${win.tmp.jsmoothfile}" skeletonroot="${util}/windows/skeletons"/>
 
-		<jsmooth project="${win.tmp.jsmoothfile}" skeletonroot="${util}/windows/skeletons" />
-        <delete file="${win.tmp.jsmoothfile}" />
+		<replace file="${win.tmp.jsmoothfile}" token='${exefile}' value="dist/KoLmafia.exe"/>
+		<replace file="${win.tmp.jsmoothfile}" token='${jarfile}' value="dist/KoLmafia.jar"/>
+		<move file="${win.tmp.jsmoothfile}" tofile="${win.jsmoothfile}"/>
 
 	</target>
Note that even though I put in "dist/KoLmafia.exe" it still ends up as "dist/KoLmafia-14.6.exe" (and likewise for the resulting jar)
(to be totally honest, I only have very introductory experience with makefiles and ant build files are totally foreign to me.)
EDIT: totally realize this is completely off-topic from the thread at hand, sorry.
 

Veracity

Developer
Staff member
If you use simply "ant", you get "ant debug", which includes the revision number in the version string.
If you type "ant jar", you are telling it to make a "released" version, which does not include the revision number.

We should probably always include the revision number in the debug log, even if we leave it out of the title bar.
 

ziz

Member
I apologize, I didn't mean that to come across in a negative way.

You're right; I don't understand what the hell it's doing, and I also apologize for coming across like I thought I did. I appreciate Mafia and doubly so the time you folks all put into maintaining it. I hope to help with that a little bit by providing bug reports, but I suppose I don't precisely have a good track record at that.

If you're curious, I read the commit messages but not the source most of the time, and I recalled seeing

Code:
r9527 | veracity0 | 2011-06-28 20:29:55 -0600 (Tue, 28 Jun 2011) | 2 lines

The Hermit is a Coin Master

which, absent actually taking the time to figure out what the code (particularly, the code in a heavy state of flux) does, suggested to me that there might be a correlation. I looked at the diff for r9558 and noticed the out-of-place (compared to obviously chat-related code) coinmaster-related stuff in RuntimeLibrary.java and thought I'd mention it, since we had three (!) people commit changes they didn't intend to at work today.
 

ziz

Member
Aha, thank you. Just "ant" in fact produces the expected revision number in debug logs; I'll go with that from now on.
 
Top