[hampi-devel] Hampi_server.sh, where does the results go?

22 views
Skip to first unread message

pedro.salgueiro

unread,
May 4, 2010, 12:21:49 PM5/4/10
to hampi-devel
Hi!

I have just started to use Hamp, and was able to use HAMPI in
standalone mode and obtain the desired solutions. However, when using
HAMPI in server mode, the server shows the follwing message, but it
produces no answers, neither the client recives the message with the
solutions:

On the server side:
Tue May 04 17:13:15 WEST 2010 started Hampi server on port 4446
Tue May 04 17:13:28 WEST 2010 accepted connection
solving: teste
Tue May 04 17:13:28 WEST 2010 closing connection
Tue May 04 17:13:32 WEST 2010 accepted connection
Tue May 04 17:13:32 WEST 2010 Hampi server shutting down on port 4446

On the client side, this is what I do:
pds@hotice:hampi-read-only$ ./hampi_client.sh 4446 teste

What could be the problem?

Best regards,
Pedro Salgueiro

Adam Kiezun

unread,
May 4, 2010, 1:20:44 PM5/4/10
to hampi...@googlegroups.com
Hi,
works for me here:

Input file bar.hmp:
var v : 4;
reg R := star("ab");
assert v in R ;

Server console:
$./hampi_server.sh 4446&
[1] 16987
$ Tue May 04 13:14:13 EDT 2010 started Hampi server on port 4446
Tue May 04 13:16:19 EDT 2010 accepted connection
solving: bar.hmp
Tue May 04 13:16:19 EDT 2010 closing connection

Client console:
$./hampi_client.sh 4446 bar.hmp
{VAR(v)=abab}

Can you try with the exact sequence above? Let's see if that works.
./adam

Pedro Salgueiro

unread,
May 5, 2010, 6:26:13 AM5/5/10
to hampi...@googlegroups.com
Hi,

I have re-downloaded everything from svn, rebuilt it, and still got
the same problem,using your exact example and following the same
steps.

I am running Ubuntu 10.04 and Sun Java 6.

Best regards,
Pedro Salgueiro

Adam Kiezun

unread,
May 5, 2010, 10:49:11 AM5/5/10
to hampi...@googlegroups.com
Strange, looking at the server code in src/hampi/HampiServer.java, the
server shuts down only when it receives the message "SHUTDOWN".
Somehow the server received two connections and the second one
contained "SHUTDOWN".

Can you try sending:
nc 127.0.0.1 4446 <<< "fred"

this should produce a 1-line response on the client side:
ERROR file fred does not exist

And on the server side, you should see something like this:
Wed May 05 10:46:00 EDT 2010 started Hampi server on port 4446
Wed May 05 10:46:20 EDT 2010 accepted connection
solving: fred
ERROR file fred does not exist
Wed May 05 10:46:20 EDT 2010 closing connection

./adam

Pedro Salgueiro

unread,
May 5, 2010, 11:03:52 AM5/5/10
to hampi...@googlegroups.com
On the client side there is no output:

pds@hotice:hampi$ nc 127.0.0.1 4451 <<< "fred"
pds@hotice:hampi$


On the server side:

pds@hotice:hampi-read-only$ ./hampi_server.sh 4451&
[1] 22275
pds@hotice:hampi-read-only$ Wed May 05 15:56:17 WEST 2010 started
Hampi server on port 4451
Wed May 05 15:57:27 WEST 2010 accepted connection
solving: fred
ERROR file fred does not exist
Wed May 05 15:57:27 WEST 2010 closing connection



About that message of the server shuting down, I guess I might have
sent the SHUTDOWN message from the client. I guess the problem is
sending the message back to the client.

I have now downloaded the "hampi_20091215.zip", but I am unable to
build it, here is the error part of the building process:

...
...
...
build-project:
[echo] StringSolver: /home/pds/univ/phd/software/hampi/build.xml

build-libs:
[exec] make[1]: Entering directory
`/home/pds/univ/phd/software/hampi/lib/cfganalyzer-2007-12-03'
[exec] /usr/bin/make -C zchaff-src all
[exec] make[2]: Entering directory
`/home/pds/univ/phd/software/hampi/lib/cfganalyzer-2007-12-03/zchaff-src'
[exec] ar cr libsat.a zchaff_utils.o zchaff_solver.o
zchaff_base.o zchaff_dbase.o zchaff_c_wrapper.o zchaff_cpp_wrapper.o
[exec] ranlib libsat.a
[exec] g++ -Wall -O3 -w sat_solver.o libsat.a -o zchaff
[exec] g++ -Wall -O3 -w zminimal.cpp libsat.a -o zminimal
[exec] make[2]: Leaving directory
`/home/pds/univ/phd/software/hampi/lib/cfganalyzer-2007-12-03/zchaff-src'
[exec] mv zchaff-src/libsat.a ..
[exec] ocamlopt -o bin/cfganalyzer -cc g++
obj/zchaff_ocaml_wrapper.o ../libsat.a obj/zchaff.cmx obj/basics.cmx
obj/cfg.cmx obj/parser.cmx obj/lexer.cmx obj/varencoding.cmx
obj/coding.cmx obj/dotty.cmx obj/problems.cmx obj/engine.cmx
obj/main.cmx
[exec] File "_none_", line 1, characters 0-1:
[exec] Error: Files obj/zchaff.cmx and /usr/lib/ocaml/stdlib.cmxa
[exec] make inconsistent assumptions over interface Pervasives
[exec] make[1]: Leaving directory
`/home/pds/univ/phd/software/hampi/lib/cfganalyzer-2007-12-03'
[exec] make[1]: *** [exec] Error 2

BUILD FAILED
/home/pds/univ/phd/software/hampi/build.xml:33: exec returned: 2

Total time: 6 seconds
make: *** [all] Error 1


Pedro Salgueiro

Pedro Salgueiro

unread,
May 5, 2010, 11:12:04 AM5/5/10
to hampi...@googlegroups.com
Well, I have just found the problem, and the culprit is ... Ubuntu ...

It happens that Ubuntu uses nc.openbsd instead of the traditional
nc.... As soon as I updated the alternatives so that ubuntu was using
the right nc, HAMPI just started to work :D

My good old Debian, I never had problems like this before on it, I
guess I will go back to Debian sooner than I expected :D

Thank you all guys,
Pedro Salgueiro
Reply all
Reply to author
Forward
0 new messages