Difference between revisions of "SecurityException Bug"

From Robowiki
Jump to navigation Jump to search
(New page: This page was created in order to organize the info about this bug, since it's all spread around this site. You can find people talking about it in:<br> RoboRumble/ReportedProblems<br>...)
 
m (Using <syntaxhighlight>.)
 
(One intermediate revision by one other user not shown)
Line 21: Line 21:
 
There is a possible solution posted at [[MSWindows]] page:
 
There is a possible solution posted at [[MSWindows]] page:
  
There is a work around that has been posted for the file saving issue that applies to at least JDK 1.4.2_02. Install and chage the batch scripts that start any Robocode instance by adding <code>"-Dsun.io.useCanonCaches=false" (ie: java -Dsun.io.useCanonCaches=false -Xmx256M -jar robocode.jar)</code>. I have tested file savings with Roboleague, Robocode, and RR@H and they all seem to work (no Exceptions reported so far). -- [[Sparafucil3]] (i think...)
+
There is a work around that has been posted for the file saving issue that applies to at least JDK 1.4.2_02. Install and chage the batch scripts that start any Robocode instance by adding <code>"-Dsun.io.useCanonCaches=false" (ie: java -Dsun.io.useCanonCaches=false -Xmx256M -jar robocode.jar)</code>. I have tested file savings with Roboleague, Robocode, and RR@H and they all seem to work (no Exceptions reported so far). -- [[User:Sparafucil3|Sparafucil3]] (i think...)
  
Now if we could figure out that old Serialization problem Paul had on the RR, we'd be set (think this would do it?) -- [[Kawigi]]
+
Now if we could figure out that old Serialization problem Paul had on the RR, we'd be set (think this would do it?) -- [[User:Kawigi|Kawigi]]
  
 
Robocode was reporting it as a "Security Exception" because as far as it was concerned you were trying to write a file outside of it's sand box. If you follow the link on the [[RobocodeRepository]] regarding this you will find that whats happening is that the JVM is having a hard time providing the correct file name (I specifically think it is having a hard time with mixed case words). Your bot then tries to write to a file that Robocode does not know about so it raises a security exception. If Paul was serializing to disk then I would be that this is the same issue he was having too. -- [[Sparafucil3|jim]]
 
Robocode was reporting it as a "Security Exception" because as far as it was concerned you were trying to write a file outside of it's sand box. If you follow the link on the [[RobocodeRepository]] regarding this you will find that whats happening is that the JVM is having a hard time providing the correct file name (I specifically think it is having a hard time with mixed case words). Your bot then tries to write to a file that Robocode does not know about so it raises a security exception. If Paul was serializing to disk then I would be that this is the same issue he was having too. -- [[Sparafucil3|jim]]
  
No - the serialization problem I had/have was communicating between bots in a team - I could serialize to file ok.  but in order to send messages between bots reliably I had to covert a byte array to a string to send the message (and reverse the operation when recieving).  I think it was a hi/low byte probelm but there is a workaround.  --  [[Paul Evans]]
+
No - the serialization problem I had/have was communicating between bots in a team - I could serialize to file ok.  but in order to send messages between bots reliably I had to covert a byte array to a string to send the message (and reverse the operation when recieving).  I think it was a hi/low byte probelm but there is a workaround.  --  [[User:Paul Evans|Paul Evans]]
  
Yeah, so if it's purely a matter of file I/O, it probably doesn't help, because I think team messages just get serialized and deserialized through piped I/O streams. -- [[Kawigi]]
+
Yeah, so if it's purely a matter of file I/O, it probably doesn't help, because I think team messages just get serialized and deserialized through piped I/O streams. -- [[User:Kawigi|Kawigi]]
  
 
I forgot to mention that with [[RoboLeague]] I needed to modify the <code>launcher.properties</code> file. I changed the line <code>user.cmdline=</code> to <code>user.cmdline=-Dsun.io.useCanonCaches=false</code>. I think this file specifies properties to the launch of the robocode engine that it uses. Sorry about that. Also, RR@H still managed to freeze last night but it was after 50 iterations, which is 4 times more than I have ever managed to run before. -- [[Sparafucil3|jim]]
 
I forgot to mention that with [[RoboLeague]] I needed to modify the <code>launcher.properties</code> file. I changed the line <code>user.cmdline=</code> to <code>user.cmdline=-Dsun.io.useCanonCaches=false</code>. I think this file specifies properties to the launch of the robocode engine that it uses. Sorry about that. Also, RR@H still managed to freeze last night but it was after 50 iterations, which is 4 times more than I have ever managed to run before. -- [[Sparafucil3|jim]]
Line 35: Line 35:
 
----
 
----
  
I modified my batch file as explained above, I'm using java 1.4.1,  and I *still* get this bug. Help! Is there anything else I can do as a person who runs the RR@H client to stop this? Is there anything I can do as a bot author to prevent this bug from affecting their ratings? --[[David Alves]]
+
I modified my batch file as explained above, I'm using java 1.4.1,  and I *still* get this bug. Help! Is there anything else I can do as a person who runs the RR@H client to stop this? Is there anything I can do as a bot author to prevent this bug from affecting their ratings? --[[User:David Alves|David Alves]]
  
Did you modify the batch script that starts RR@H too? I have not had this problem except with bots that get downloaded by the RR@H client after it has been running. I think I have read elsewhere that this is an issue that Albert is aware of but can not fix. The only solution at this time is to restart. If the batch script were modified to restart if java stops a System.exit() could be added if anything is downloaded and then you should not see this anymore. -- [[jim]]
+
Did you modify the batch script that starts RR@H too? I have not had this problem except with bots that get downloaded by the RR@H client after it has been running. I think I have read elsewhere that this is an issue that Albert is aware of but can not fix. The only solution at this time is to restart. If the batch script were modified to restart if java stops a System.exit() could be added if anything is downloaded and then you should not see this anymore. -- [[User:Sparafucil3|jim]]
  
As a recent data saving bot author I took the extra effort to minimise the effect of this bug by only loading/saving files in the first and last round. For a very long time I ran the RR@H client without the bug workaround because I used java 1.3 in my main testing computer and wasn't aware of the implications of this bug. Anyway, the playing field is even, until there is a defenitive solution you'll have to weight the pros and cons of data saving. -- [[ABC]]
+
As a recent data saving bot author I took the extra effort to minimise the effect of this bug by only loading/saving files in the first and last round. For a very long time I ran the RR@H client without the bug workaround because I used java 1.3 in my main testing computer and wasn't aware of the implications of this bug. Anyway, the playing field is even, until there is a defenitive solution you'll have to weight the pros and cons of data saving. -- [[User:ABC|ABC]]
  
 
ABC, if I load data at the end of round one after I've already won or lost, will that affect my score? --[[David Alves]
 
ABC, if I load data at the end of round one after I've already won or lost, will that affect my score? --[[David Alves]
  
No, it won't. You will get disabled but your score will not be affected. One of Shadow's latest versions did save at the end of every round. It may affect your opponent's score tough, because any bullet still in the air is a potential kill for him. -- [[ABC]]
+
No, it won't. You will get disabled but your score will not be affected. One of Shadow's latest versions did save at the end of every round. It may affect your opponent's score tough, because any bullet still in the air is a potential kill for him. -- [[User:ABC|ABC]]
  
 
----
 
----
  
if you are silly (like me) and copy/paste the above fix, then don't forget to get rid of the ? generated by the Wiki engine :D ...... --[[Vic]]
+
if you are silly (like me) and copy/paste the above fix, then don't forget to get rid of the ? generated by the Wiki engine :D ...... --[[User:Vic Stewart|Vic]]
  
Anyone who finds [[Vic]]'s remark peculiar should know that I have removed the questionmark he's talking about. =) -- [[PEZ]]
+
Anyone who finds [[User:Vic Stewart|Vic]]'s remark peculiar should know that I have removed the questionmark he's talking about. =) -- [[User:PEZ|PEZ]]
  
There goes my joke ;-) --[[Vic]]
+
There goes my joke ;-) --[[User:Vic Stewart|Vic]]
  
 
----
 
----
  
Where do I add this fix for the RR client? In roborumble.bat? --[[Vic]]
+
Where do I add this fix for the RR client? In roborumble.bat? --[[User:Vic Stewart|Vic]]
  
 
Yep. Just add <nowiki>"-Dsun.io.useCanonCaches=false"</nowiki> in any of yours .bat... Here is my roborumble.bat:
 
Yep. Just add <nowiki>"-Dsun.io.useCanonCaches=false"</nowiki> in any of yours .bat... Here is my roborumble.bat:
Line 64: Line 64:
 
goto run
 
goto run
 
</pre>
 
</pre>
It would be a good idea if the clients already had this... -- [[Axe]]
+
It would be a good idea if the clients already had this... -- [[User:Axe|Axe]]
  
Ok, thanx. --[[Vic]]
+
Ok, thanx. --[[User:Vic Stewart|Vic]]
  
Does this happen in 1.5? --[[David Alves]]
+
Does this happen in 1.5? --[[User:David Alves|David Alves]]
  
Good question. don´t know... -- [[Axe]]
+
Good question. don´t know... -- [[User:Axe|Axe]]
  
 
Downloaded and tested JRE 1.5 here. The result is even worst with it. It seems to happen 100% (10/10). So, the bots accessing files are getting disabled at least one round in JRE 1.5...<br>
 
Downloaded and tested JRE 1.5 here. The result is even worst with it. It seems to happen 100% (10/10). So, the bots accessing files are getting disabled at least one round in JRE 1.5...<br>
The <nowiki>"-Dsun.io.useCanonCaches=false"</nowiki> works fine and correct that issue also for 1.5. <B>@ALL: PLEASE UPDATE YOUR ROBORUMBLE.BAT FILES TO INCLUDE THE <nowiki>"-Dsun.io.useCanonCaches=false"</nowiki>.</b> -- [[Axe]]
+
The <nowiki>"-Dsun.io.useCanonCaches=false"</nowiki> works fine and correct that issue also for 1.5. <B>@ALL: PLEASE UPDATE YOUR ROBORUMBLE.BAT FILES TO INCLUDE THE <nowiki>"-Dsun.io.useCanonCaches=false"</nowiki>.</b> -- [[User:Axe|Axe]]
  
 
Tested a lil better here, and it isn't 100%, but only eventually that it happens with JRE 1.5.<br>
 
Tested a lil better here, and it isn't 100%, but only eventually that it happens with JRE 1.5.<br>
 
But happens.<br>
 
But happens.<br>
 
Since i have no control in foreign´s .bat configuration, I have implemented a radical solution: a pull-the-pin-and-swallow-the-grenade strategy, idea inspired by [[Jonathan]] (credits to him). If [[SS]] is disabled trying to read data in the first round, it will activate a self-destruction mechanism, and self-disable in all other rounds also. I'm counting on the server rejecting those 100% scoring that the enemies will get in this match.<br>
 
Since i have no control in foreign´s .bat configuration, I have implemented a radical solution: a pull-the-pin-and-swallow-the-grenade strategy, idea inspired by [[Jonathan]] (credits to him). If [[SS]] is disabled trying to read data in the first round, it will activate a self-destruction mechanism, and self-disable in all other rounds also. I'm counting on the server rejecting those 100% scoring that the enemies will get in this match.<br>
So, if [[SS]] is getting disabled in your client, please update your roborumble.bat file as above. -- [[Axe]]   
+
So, if [[SS]] is getting disabled in your client, please update your roborumble.bat file as above. -- [[User:Axe|Axe]]   
  
Why don't you just stop reading and writing data? It must be less error prone than the above strategy. A strategy which reminds me of those Worms I used to play so much on my Dreamcast. =) -- [[PEZ]]
+
Why don't you just stop reading and writing data? It must be less error prone than the above strategy. A strategy which reminds me of those Worms I used to play so much on my Dreamcast. =) -- [[User:PEZ|PEZ]]
  
Because i think that data saving and mining can be also a valuable and valid strategy, and (mostly important:) I'm not prepared to throw away all my beautiful data compression :). (I never played Worm, so i cant say about it...) -- [[Axe]]  
+
Because i think that data saving and mining can be also a valuable and valid strategy, and (mostly important:) I'm not prepared to throw away all my beautiful data compression :). (I never played Worm, so i cant say about it...) -- [[User:Axe|Axe]]  
  
But i can say that remembers me the Orson Scott Card book "Ender´s game"... If u havent read, u should ([[Vic]] agree, right?)... -- [[Axe]]
+
But i can say that remembers me the Orson Scott Card book "Ender´s game"... If u havent read, u should ([[User:Vic Stewart|Vic]] agree, right?)... -- [[User:Axe|Axe]]
  
 
[[Paul]] agrees also. -- [[Paul]]
 
[[Paul]] agrees also. -- [[Paul]]
  
That's enough for me. :) -- [[Axe]]
+
That's enough for me. :) -- [[User:Axe|Axe]]
  
@Axe: Have you tried wrapping the save in a try catch and simply catching the error rather than self destructing? Seems like this would at least allow you to continue. I feel the same as you do about saved data but I think your approach is a little too radical and runs the risk that you get a really poor score. -- [[jim]]
+
@Axe: Have you tried wrapping the save in a try catch and simply catching the error rather than self destructing? Seems like this would at least allow you to continue. I feel the same as you do about saved data but I think your approach is a little too radical and runs the risk that you get a really poor score. -- [[User:Sparafucil3|jim]]
  
Self destruction seems risky. Particularly when I constantly question why the ... the server is disregarding shut out battles anyway. -- [[PEZ]]
+
Self destruction seems risky. Particularly when I constantly question why the ... the server is disregarding shut out battles anyway. -- [[User:PEZ|PEZ]]
  
@[[Jim]]: that SecurityException even if it is caught disables your bot. (But if you know how to catch it without disabling the bot, pls tell me). @[[PEZ]] I think that one of the reasons for the server disregarding these results is to protect ranking against clients malfunction. At least that's my assumption... -- [[Axe]]
+
@[[User:Sparafucil3|Jim]]: that SecurityException even if it is caught disables your bot. (But if you know how to catch it without disabling the bot, pls tell me). @[[User:PEZ|PEZ]] I think that one of the reasons for the server disregarding these results is to protect ranking against clients malfunction. At least that's my assumption... -- [[User:Axe|Axe]]
  
In what way could a client malfunction that would cause a shut-out result? And couldn't the RR client itself set that environment option in run time instead of relying on the .bat file to do it? If someone looks at that I could tweak the server to accept results only from clients updated in this way. -- [[PEZ]]
+
In what way could a client malfunction that would cause a shut-out result? And couldn't the RR client itself set that environment option in run time instead of relying on the .bat file to do it? If someone looks at that I could tweak the server to accept results only from clients updated in this way. -- [[User:PEZ|PEZ]]
  
Btw: I never said that this self-destruction is the best solution. The best solution is to have properly configured clients. But that is obviously out of my control... This is the <b>only</b> solution that i found. If someone come with other solution, ill be very grateful. -- [[Axe]]  
+
Btw: I never said that this self-destruction is the best solution. The best solution is to have properly configured clients. But that is obviously out of my control... This is the <b>only</b> solution that i found. If someone come with other solution, ill be very grateful. -- [[User:Axe|Axe]]  
  
Hmmm, I think I just proposed a solution? -- [[PEZ]]
+
Hmmm, I think I just proposed a solution? -- [[User:PEZ|PEZ]]
  
I posted it in a edit conflict... That solution of yours is great. But how to assure that everybody is running the "good" client? -- [[Axe]]
+
I posted it in a edit conflict... That solution of yours is great. But how to assure that everybody is running the "good" client? -- [[User:Axe|Axe]]
  
I mean: this is the same solution of including it in the .bat. If everybody include it... -- [[Axe]]
+
I mean: this is the same solution of including it in the .bat. If everybody include it... -- [[User:Axe|Axe]]
  
 
Well, when the results are uploaded the client gives a version number. I could just make the server require the client to use a different version identifier than it uses today. That's the easy part. The tricky one might be to find out and implement the setting of that environment option at runtime.  
 
Well, when the results are uploaded the client gives a version number. I could just make the server require the client to use a different version identifier than it uses today. That's the easy part. The tricky one might be to find out and implement the setting of that environment option at runtime.  
Line 110: Line 110:
 
If you trusted everyone included the .bat change then you wouldn't make your bot swallow a granade with the pin pulled out, would you?
 
If you trusted everyone included the .bat change then you wouldn't make your bot swallow a granade with the pin pulled out, would you?
  
-- [[PEZ]]
+
-- [[User:PEZ|PEZ]]
  
Bull´s eye! -- [[Axe]]
+
Bull´s eye! -- [[User:Axe|Axe]]
  
But it would be enough for me if everybody says that their environment are ok, an if we include this in the downloadable clients... -- [[Axe]]
+
But it would be enough for me if everybody says that their environment are ok, an if we include this in the downloadable clients... -- [[User:Axe|Axe]]
  
OK. But I know that I, for one, was bloody sure I was using that command line option in my clients. Until I checked yesterday. And I wasn't in the most often used one. Of course I do now, but anyway. -- [[PEZ]]
+
OK. But I know that I, for one, was bloody sure I was using that command line option in my clients. Until I checked yesterday. And I wasn't in the most often used one. Of course I do now, but anyway. -- [[User:PEZ|PEZ]]
* Thanks... -- [[Axe]]
+
* Thanks... -- [[User:Axe|Axe]]
  
 
----
 
----
Line 123: Line 123:
 
If you want to check if your robot is going to be disabled when reading/writing to the file system use the following code...
 
If you want to check if your robot is going to be disabled when reading/writing to the file system use the following code...
  
<pre>
+
<syntaxhighlight>
 
boolean willMyBotBeAbleToSaveFileInformation = false;
 
boolean willMyBotBeAbleToSaveFileInformation = false;
 
try {
 
try {
Line 130: Line 130:
 
catch (Exception ex) { }
 
catch (Exception ex) { }
  
</pre>
+
</syntaxhighlight>
  
 
It works fine on Java VM 1.6.0 and should work with earlier versions.
 
It works fine on Java VM 1.6.0 and should work with earlier versions.
Line 136: Line 136:
 
A slightly different version that ought to fix the problem (if executed before any reads or writes) is the following...
 
A slightly different version that ought to fix the problem (if executed before any reads or writes) is the following...
  
<pre>
+
<syntaxhighlight>
 
boolean willMyBotBeAbleToSaveFileInformation = false;
 
boolean willMyBotBeAbleToSaveFileInformation = false;
 
try {
 
try {
Line 142: Line 142:
 
}
 
}
 
catch (Exception ex) { }
 
catch (Exception ex) { }
</pre>
+
</syntaxhighlight>
  
 
This sets the default value if it finds none set and can be executed multiple times without disabling any robot.
 
This sets the default value if it finds none set and can be executed multiple times without disabling any robot.

Latest revision as of 09:31, 1 July 2010

This page was created in order to organize the info about this bug, since it's all spread around this site. You can find people talking about it in:
RoboRumble/ReportedProblems
Talk:Compressed Serialization
MSWindows


The Bug:
Under JRE 1.4.2.x, Any bot trying to access data from the disk "gains" eventually a SecurityException that disables the bot even if it's (the Exception) caugth.


It's a Bug?
Since it was working and now ain't no more...


So what do we do?

There is a possible solution posted at MSWindows page:

There is a work around that has been posted for the file saving issue that applies to at least JDK 1.4.2_02. Install and chage the batch scripts that start any Robocode instance by adding "-Dsun.io.useCanonCaches=false" (ie: java -Dsun.io.useCanonCaches=false -Xmx256M -jar robocode.jar). I have tested file savings with Roboleague, Robocode, and RR@H and they all seem to work (no Exceptions reported so far). -- Sparafucil3 (i think...)

Now if we could figure out that old Serialization problem Paul had on the RR, we'd be set (think this would do it?) -- Kawigi

Robocode was reporting it as a "Security Exception" because as far as it was concerned you were trying to write a file outside of it's sand box. If you follow the link on the RobocodeRepository regarding this you will find that whats happening is that the JVM is having a hard time providing the correct file name (I specifically think it is having a hard time with mixed case words). Your bot then tries to write to a file that Robocode does not know about so it raises a security exception. If Paul was serializing to disk then I would be that this is the same issue he was having too. -- jim

No - the serialization problem I had/have was communicating between bots in a team - I could serialize to file ok. but in order to send messages between bots reliably I had to covert a byte array to a string to send the message (and reverse the operation when recieving). I think it was a hi/low byte probelm but there is a workaround. -- Paul Evans

Yeah, so if it's purely a matter of file I/O, it probably doesn't help, because I think team messages just get serialized and deserialized through piped I/O streams. -- Kawigi

I forgot to mention that with RoboLeague I needed to modify the launcher.properties file. I changed the line user.cmdline= to user.cmdline=-Dsun.io.useCanonCaches=false. I think this file specifies properties to the launch of the robocode engine that it uses. Sorry about that. Also, RR@H still managed to freeze last night but it was after 50 iterations, which is 4 times more than I have ever managed to run before. -- jim


I modified my batch file as explained above, I'm using java 1.4.1, and I *still* get this bug. Help! Is there anything else I can do as a person who runs the RR@H client to stop this? Is there anything I can do as a bot author to prevent this bug from affecting their ratings? --David Alves

Did you modify the batch script that starts RR@H too? I have not had this problem except with bots that get downloaded by the RR@H client after it has been running. I think I have read elsewhere that this is an issue that Albert is aware of but can not fix. The only solution at this time is to restart. If the batch script were modified to restart if java stops a System.exit() could be added if anything is downloaded and then you should not see this anymore. -- jim

As a recent data saving bot author I took the extra effort to minimise the effect of this bug by only loading/saving files in the first and last round. For a very long time I ran the RR@H client without the bug workaround because I used java 1.3 in my main testing computer and wasn't aware of the implications of this bug. Anyway, the playing field is even, until there is a defenitive solution you'll have to weight the pros and cons of data saving. -- ABC

ABC, if I load data at the end of round one after I've already won or lost, will that affect my score? --[[David Alves]

No, it won't. You will get disabled but your score will not be affected. One of Shadow's latest versions did save at the end of every round. It may affect your opponent's score tough, because any bullet still in the air is a potential kill for him. -- ABC


if you are silly (like me) and copy/paste the above fix, then don't forget to get rid of the ? generated by the Wiki engine :D ...... --Vic

Anyone who finds Vic's remark peculiar should know that I have removed the questionmark he's talking about. =) -- PEZ

There goes my joke ;-) --Vic


Where do I add this fix for the RR client? In roborumble.bat? --Vic

Yep. Just add "-Dsun.io.useCanonCaches=false" in any of yours .bat... Here is my roborumble.bat:

cd robots
:run
java -Dsun.io.useCanonCaches=false -Xmx256M -cp .;../robocode.jar;../codesize.jar; roborumble.RoboRumbleAtHome ./roborumble/roborumble.txt
goto run

It would be a good idea if the clients already had this... -- Axe

Ok, thanx. --Vic

Does this happen in 1.5? --David Alves

Good question. don´t know... -- Axe

Downloaded and tested JRE 1.5 here. The result is even worst with it. It seems to happen 100% (10/10). So, the bots accessing files are getting disabled at least one round in JRE 1.5...
The "-Dsun.io.useCanonCaches=false" works fine and correct that issue also for 1.5. @ALL: PLEASE UPDATE YOUR ROBORUMBLE.BAT FILES TO INCLUDE THE "-Dsun.io.useCanonCaches=false". -- Axe

Tested a lil better here, and it isn't 100%, but only eventually that it happens with JRE 1.5.
But happens.
Since i have no control in foreign´s .bat configuration, I have implemented a radical solution: a pull-the-pin-and-swallow-the-grenade strategy, idea inspired by Jonathan (credits to him). If SS is disabled trying to read data in the first round, it will activate a self-destruction mechanism, and self-disable in all other rounds also. I'm counting on the server rejecting those 100% scoring that the enemies will get in this match.
So, if SS is getting disabled in your client, please update your roborumble.bat file as above. -- Axe

Why don't you just stop reading and writing data? It must be less error prone than the above strategy. A strategy which reminds me of those Worms I used to play so much on my Dreamcast. =) -- PEZ

Because i think that data saving and mining can be also a valuable and valid strategy, and (mostly important:) I'm not prepared to throw away all my beautiful data compression :). (I never played Worm, so i cant say about it...) -- Axe

But i can say that remembers me the Orson Scott Card book "Ender´s game"... If u havent read, u should (Vic agree, right?)... -- Axe

Paul agrees also. -- Paul

That's enough for me. :) -- Axe

@Axe: Have you tried wrapping the save in a try catch and simply catching the error rather than self destructing? Seems like this would at least allow you to continue. I feel the same as you do about saved data but I think your approach is a little too radical and runs the risk that you get a really poor score. -- jim

Self destruction seems risky. Particularly when I constantly question why the ... the server is disregarding shut out battles anyway. -- PEZ

@Jim: that SecurityException even if it is caught disables your bot. (But if you know how to catch it without disabling the bot, pls tell me). @PEZ I think that one of the reasons for the server disregarding these results is to protect ranking against clients malfunction. At least that's my assumption... -- Axe

In what way could a client malfunction that would cause a shut-out result? And couldn't the RR client itself set that environment option in run time instead of relying on the .bat file to do it? If someone looks at that I could tweak the server to accept results only from clients updated in this way. -- PEZ

Btw: I never said that this self-destruction is the best solution. The best solution is to have properly configured clients. But that is obviously out of my control... This is the only solution that i found. If someone come with other solution, ill be very grateful. -- Axe

Hmmm, I think I just proposed a solution? -- PEZ

I posted it in a edit conflict... That solution of yours is great. But how to assure that everybody is running the "good" client? -- Axe

I mean: this is the same solution of including it in the .bat. If everybody include it... -- Axe

Well, when the results are uploaded the client gives a version number. I could just make the server require the client to use a different version identifier than it uses today. That's the easy part. The tricky one might be to find out and implement the setting of that environment option at runtime.

If you trusted everyone included the .bat change then you wouldn't make your bot swallow a granade with the pin pulled out, would you?

-- PEZ

Bull´s eye! -- Axe

But it would be enough for me if everybody says that their environment are ok, an if we include this in the downloadable clients... -- Axe

OK. But I know that I, for one, was bloody sure I was using that command line option in my clients. Until I checked yesterday. And I wasn't in the most often used one. Of course I do now, but anyway. -- PEZ

  • Thanks... -- Axe

If you want to check if your robot is going to be disabled when reading/writing to the file system use the following code...

boolean willMyBotBeAbleToSaveFileInformation = false;
try {
	willMyBotBeAbleToSaveFileInformation = (System.getProperty("sun.io.useCanonCaches")).equals("false");
}
catch (Exception ex) { }

It works fine on Java VM 1.6.0 and should work with earlier versions.

A slightly different version that ought to fix the problem (if executed before any reads or writes) is the following...

boolean willMyBotBeAbleToSaveFileInformation = false;
try {
	willMyBotBeAbleToSaveFileInformation = (System.getProperty("sun.io.useCanonCaches","false")).equals("false");
}
catch (Exception ex) { }

This sets the default value if it finds none set and can be executed multiple times without disabling any robot. The only problem could be if the flag were set to true when starting the VM - in which case the boolean value would be set to false.

--EventHorizon