Disabled DBrowser

This forum is to report technical problems with Rel.
Post Reply
Chris Walton
Posts: 76
Joined: Sat Aug 18, 2012 2:13 pm

Disabled DBrowser

Post by Chris Walton »

After the crash (a report of which was sent automatically to you some hours ago (ID 50/80 ?)), it is now impossible to run DBrowser. I continually get the message:
java.io.IOException: Cannot run program "C:\Program": CreateProcess error=2, The system cannot find the file specified
I have set the path variable; reinstalled Rel; deleted and recreated the database; and checked Java by running a Java based program against the jdk; Nothing seems to have any effect.
Dave
Site Admin
Posts: 372
Joined: Sun Nov 27, 2005 7:19 pm

Re: Disabled DBrowser

Post by Dave »

Hi Chris,

When DBrowser runs, it normally brings up two windows. One is labeled "Rel - DBrowser" and one is labeled "Rel - DBrowser Monitor". Has the latter appeared and not the former?

If the latter appears, please look at the "Java VM" blank at the top of the "Rel - DBrowser Monitor" window. It should (normally) just contain:
java

If there's anything else there, please change it to java and try again.

If neither window appears, or if there's some other behaviour, please let me know.
Chris Walton
Posts: 76
Joined: Sat Aug 18, 2012 2:13 pm

Re: Disabled DBrowser

Post by Chris Walton »

Thanks - that was the problem. Of course by the time I got your email I had re-downloaded Java and Rel; uninstalled jdk/jre/rel; done a complete backup of my system; cleaned the registry extensively; donea clean install of jdk/jre/rel; and tried again with Rel. Oh well - it's all character building - and I'll have no adverse comments on my character, thanks very much.
Chris Walton
Posts: 76
Joined: Sat Aug 18, 2012 2:13 pm

Re: Disabled DBrowser

Post by Chris Walton »

I spoke too soon. Rel now opens and runs, but trying to define one of the operators from your scripts provides the following error:

ERROR: ca.mb.armchair.rel3.exceptions.ExceptionSemantic: java.io.IOException: Cannot run program "javac": CreateProcess error=2, The system cannot find the file specified

I have the following system environment variables defined:
JAVA C:\Program Files\Java\jre7
JAVA_HOME C\Program Files\Java\jre7
JDK_HOME C:\Program Files\Java\jkd1.7.0_25

which correspond to the way Java is set up on my machine.

I have a long PATH system environment variable defined, extended by a (short) PATH user environment variable. None of the Java paths are included in the PATH variables, nor are they brought into the path by reference to the above system environment variables.
Dave
Site Admin
Posts: 372
Joined: Sun Nov 27, 2005 7:19 pm

Re: Disabled DBrowser

Post by Dave »

If you start up a Windows command line, can you run JAVAC from it?

If not, that's the problem. You'll need to configure your PATH so JAVAC is runnable from it.
Chris Walton
Posts: 76
Joined: Sat Aug 18, 2012 2:13 pm

Re: Disabled DBrowser

Post by Chris Walton »

Thank you - sorted - I needed to add \bin to my JDK_HOME.
Chris Walton
Posts: 76
Joined: Sat Aug 18, 2012 2:13 pm

Re: Disabled DBrowser

Post by Chris Walton »

It may be worth mentioning that what set me off on these wild goose chases are automatic bug reports generated by Rel. These are IDs 18-20. Whatever is causing these crashes is still an ongoing problem. Cheers Chris
Chris Walton
Posts: 76
Joined: Sat Aug 18, 2012 2:13 pm

REL Crashing

Post by Chris Walton »

I have identified the minimum elements needed to reproduce this problem:
Define the following items in this order:
OPERATOR LENGTH(s CHAR) RETURNS INTEGER Java FOREIGN
return ValueInteger.select(context.getGenerator(), s.stringValue().length());
END OPERATOR;
TYPE BDT_symbolic POSSREP { VALUE CHAR } ;
TYPE identifier IS { BDT_symbolic CONSTRAINT LENGTH ( THE_VALUE ( BDT_symbolic ) ) <= 64
POSSREP { VALUE = THE_VALUE ( BDT_symbolic) } } ;
VAR Base_data_type BASE RELATION { name identifier } KEY { name } ;

Rel goes into an infinite loop on the final definition. By contrast if the definition is:
VAR Base_data_type BASE RELATION { name CHAR } KEY { name } ;
then every thing seems hunky dory.
Chris
Dave
Site Admin
Posts: 372
Joined: Sun Nov 27, 2005 7:19 pm

Re: Disabled DBrowser

Post by Dave »

Thanks for the report - I'll work on sorting this out for the next update.
Dave
Site Admin
Posts: 372
Joined: Sun Nov 27, 2005 7:19 pm

Re: Disabled DBrowser

Post by Dave »

An update on this...

First, an even simpler illustration of the problem:

Code: Select all

OPERATOR LENGTH(s CHAR) RETURNS INTEGER Java FOREIGN
    return ValueInteger.select(context.getGenerator(), s.stringValue().length());
END OPERATOR;

TYPE BDT_symbolic POSSREP { VALUE CHAR } ;

TYPE identifier IS { BDT_symbolic CONSTRAINT LENGTH ( THE_VALUE ( BDT_symbolic ) ) <= 64 
      POSSREP { VALUE = THE_VALUE ( BDT_symbolic) } } ;

VAR x identifier;
It turns out the problem is due to POSSREP { VALUE = THE_VALUE(BDT_symbolic) }. In particular, the reference to VALUE -- which is already defined in BDT_symbolic -- causes the infinite loop. I have yet to consider whether the problem is the infinite loop or the VALUE reference. :)

A simple workaround is something like:

Code: Select all

TYPE identifier IS { BDT_symbolic CONSTRAINT LENGTH ( THE_VALUE ( BDT_symbolic ) ) <= 64 
      POSSREP { X = THE_VALUE ( BDT_symbolic) } } ;
Chris Walton
Posts: 76
Joined: Sat Aug 18, 2012 2:13 pm

Infinite looting

Post by Chris Walton »

I am not sure if this is the same as the infinite loop bug you are already investigating, but it causes an infinite loop; and the approach of substituting X for VALUE in the type definition is neither relevant nor a solution.

Define
TYPE non_negative_integer
POSSREP { X CHAR CONSTRAINT 
( CAST_AS_INTEGER ( X ) >= 0 ) OR X = "unbounded" } ;
then if you define
OPERATOR OP_EQUALS ( P non_negative_integer, Q non_negative_integer ) RETURNS BOOLEAN;
return P = Q;
END OPERATOR ;
it starts an infinite loop.

By contrast, the following definitions work OK.
VAR Duration_unit_lookup BASE RELATION
{ name identifier,
collation integer }
KEY { collation } ;
TYPE duration_unit IS
{ identifier
CONSTRAINT TUPLE { name identifier } IN Duration_unit_lookup { name }
POSSREP { X = THE_VALUE ( identifier ) } } ;
OPERATOR OP_EQUALS ( P duration_unit, Q duration_unit ) RETURNS BOOLEAN;
return 
( name FROM TUPLE FROM Duration_unit_lookup WHERE name = P ) =
( name FROM TUPLE FROM Duration_unit_lookup WHERE name = Q ) ;
END OPERATOR ;
Dave
Site Admin
Posts: 372
Joined: Sun Nov 27, 2005 7:19 pm

Re: Disabled DBrowser

Post by Dave »

Have you tried the following definition of OP_EQUALS?

Code: Select all

OPERATOR OP_EQUALS ( P non_negative_integer, Q non_negative_integer ) RETURNS BOOLEAN;
   return THE_X(P) = THE_X(Q);
END OPERATOR ;
I suspect the loop might be because the "=" operator in "return P = Q", resolves to precisely the OP_EQUALS you're defining.
Post Reply