Anyterm Forum

Anyterm: A Terminal Anywhere

You are not logged in.

#1 2009-01-21 14:13:30

Meteo
Guest

anyterm 1.1.28 and Server returned status code 500

it's behind apache_proxy
1.1.27 works fine
I start with:
anytermd -p 8023 -c "sudo /usr/local/sbin/an
ygetty" -u nobody -n --diff -a null -s ISO-8859-2 --local-only

when I try to open running 1.1.28, first window is showing, and immediately i get this error in my firefox:
Server
Server returned status code 500
Server error: Function not implemented while futex(FUTEX_WAIT)

Chrome show me:
Server returned status code 500

#2 2009-01-21 14:32:38

Meteo
Guest

Re: anyterm 1.1.28 and Server returned status code 500

Code 500 is from Apache:

xxxxx - xxxxx [21/Jan/2009:15:26:41 +0100] "POST /anyterm-module HTTP/1.1" 200 8606 "http://xxxxx/anyterm.html" "Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5"
xxxxx - xxxxx [21/Jan/2009:15:26:41 +0100] "POST /anyterm-module HTTP/1.1" 500 127 "http://xxxxx/anyterm.html" "Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5"

Layter I'll try it without apache, direct to anyterm

#3 2009-01-21 18:00:49

Meteo
Guest

Re: anyterm 1.1.28 and Server returned status code 500

the same in direct connection

running: ./anytermd -p 8023 -c "sudo /usr/local/sbin/anygetty" -u nobody -n --diff -a null -s ISO-8859-2 -f

connecting with opera or firefox

tcpdump looks like:
GET /anyterm.html HTTP/1.1
HTTP/1.1 200 OK
GET /anyterm-module?a=open&rows=25&cols=80
HTTP/1.1 200 OK
GET /anyterm-module?a=rcv&s=f4641e92277c7e
HTTP/1.1 200 OK
GET /anyterm-module?a=rcv&s=f4641e92277c7e
HTTP/1.1 500 Server error: Function not im

often anyterm exit with error:
terminate called after throwing an instance of 'pbe::ErrnoException'

or I can press ctrl+c
and I often get:
Segmentation fault detected; Backtrace:
./anytermd[0x8093d76]
/lib/libpthread.so.0[0x40143806]
/lib/libc.so.6[0x401b28f8]
/lib/libc.so.6(exit+0x69)[0x401b4ff9]
./anytermd(_Z13handle_signali+0x84)[0x8078b3c]
/lib/libpthread.so.0[0x40143806]
/lib/libc.so.6[0x401b28f8]
./anytermd[0x8076cd7]
/lib/libc.so.6(__libc_start_main+0x9e)[0x4019f3be]
./anytermd(_ZNSt13basic_filebufIcSt11char_traitsIcEE8overflowEi+0x99)[0x8051041]
Segmentation fault

any ideas ?

#4 2009-01-21 18:40:52

phil
Administrator

Re: anyterm 1.1.28 and Server returned status code 500

I changed the thread implementation between 1.1.27 and 1.1.28; previously I was using Boost.Thread but so many people had trouble with Boost that I decided to get rid of it.  Now you have my own thread primitives, with their own problems....

So it seems that when I call futex(FUTEX_WAIT) from libpbe/include/Futex.hh line 53 it returns ENOSYS ("Function not implemented").  This is not listed as one of the possible errors in the man page for futex on my system.  Perhaps you're using an unusual platform of some sort?  What OS / distribution / kernel / C library is this?  Does "man futex" list ENOSYS as a possible error for you?

Hmm, maybe it's an old system with LinuxThreads rather than NPTL.  What does "getconf GNU_LIBPTHREAD_VERSION" report?

Sorry for the inconvenience...

Phil.

Offline

#5 2009-01-21 19:44:28

Meteo
Guest

Re: anyterm 1.1.28 and Server returned status code 500

Debian GNU/Linux 4.0
getconf GNU_LIBPTHREAD_VERSION
linuxthreads-0.10

uname -a
Linux xxxx 2.4.27-2-386 #1 Wed Aug 17 09:33:35 UTC 2005 i686 GNU/Linux

There's no ENOSYS in man futex :\


I fighted with Boost too ;] but I win, now it's time for futex ;)


... I scp anytermd to other machine:
Ubuntu 8.04.1
2.6.24-22-generic
NPTL 2.7
and it works fine, even without compile anything :)

#6 2009-01-21 20:02:58

phil
Administrator

Re: anyterm 1.1.28 and Server returned status code 500

Linux xxxx 2.4.27-2-386

Right.  I guess I need to detect that it's a 2.4 kernel and fall back.

While I think about how to do that, I suggest that you hack the #ifs in libpbe/include/Futex.hh so that it doesn't do anything at all; then the dependent code will see that PBE_HAVE_FUTEX is not defined and fall back to something using pthreads.

Thanks for reporting this.

Phil.

Offline

#7 2009-01-21 20:31:07

phil
Administrator

Re: anyterm 1.1.28 and Server returned status code 500

I have committed what should be a fix in svn rev 4934.  This affects libpbe/common.mk and libpbe/include/Futex.hh.  Please try it out if you can.  You'll need to make clean in libpbe.  You should then see -DSUPPORT_LINUX_2_4 being passed as gcc is invoked.

Of course this assumes that you're building on the machine that you want to run the code on, which is true for most but perhaps not all users.

Offline

#8 2009-01-21 21:51:01

Meteo
Guest

Re: anyterm 1.1.28 and Server returned status code 500

svn co http://svn.anyterm.org/anyterm/tags/releases/1.1/1.1.28/ anyterm-1.1.28

Checked out revision 4934.

beerland:~/tunnel/anyterm_svn/anyterm-1.1.28/libpbe# make
cd build; make libpbe.a
make[1]: Entering directory `/root/tunnel/anyterm_svn/anyterm-1.1.28/libpbe/build'
g++  -pthread -MM -MT utils.d -MT utils.o  -I../include -o utils.d ../src/utils.cc
g++  -pthread -MM -MT to_ascii_letters.d -MT to_ascii_letters.o  -I../include -o to_ascii_letters.d ../src/to_ascii_letters.cc
g++  -pthread -MM -MT select.d -MT select.o  -I../include -o select.d ../src/select.cc

I don't see -DSUPPORT_LINUX_2_4 :\

#9 2009-01-21 22:05:08

phil
Administrator

Re: anyterm 1.1.28 and Server returned status code 500

svn co http://svn.anyterm.org/anyterm/tags/releases/1.1/1.1.28/ anyterm-1.1.28
Checked out revision 4934.

No, you need to do something like

svn co -r 4934 http://svn.anyterm.org/anyterm/trunk

or just do that without the "-r 4934" since that's currently the latest.  What you did got "version 1.1.28 at revision 4934", but "version 1.1.28" hasn't changed (and won't).

grep for 2_4 in libpbe and you should be able to see the new bits.

Offline

#10 2009-01-21 22:05:48

phil
Administrator

Re: anyterm 1.1.28 and Server returned status code 500

# make

Please don't make as root.

Offline

#11 2009-01-21 22:39:18

Meteo
Guest

Re: anyterm 1.1.28 and Server returned status code 500

xx@beerland:~/a/trunk/libpbe$ fgrep 2_4 *
common.mk:      SUPPORT_LINUX_2_4=1
common.mk:ifdef SUPPORT_LINUX_2_4
common.mk:  COMPILE_FLAGS+=-DSUPPORT_LINUX_2_4

but it's not working stable
./anytermd -p 8022 -c "sudo /usr/local/sbin/anygetty" -u nobody -n --diff -a null -s ISO-8859-2 -f

and after connect i got:
Segmentation fault detected; Backtrace:
./anytermd[0x8093c26]
/lib/libpthread.so.0[0x40143806]
/lib/libc.so.6[0x401b28f8]
./anytermd[0x807e180]
./anytermd[0x805dd8d]
./anytermd[0x807f615]
./anytermd[0x807c22c]
./anytermd(_ZN5boost6detail8function26void_function_obj_invoker0INS_3_bi6bind_tIvPFvP6DaemoniENS3_5list2INS3_5valueIS6_EENSA_IiEEEEEEvE6invokeENS1_11any_pointerE+0x18)[0x807d22c]
./anytermd[0x8054e36]
./anytermd[0x8078df0]
/lib/libpthread.so.0[0x4013dc51]
/lib/libc.so.6(__clone+0x5a)[0x402447fa]
Segmentation fault

#12 2009-01-21 23:11:02

phil
Administrator

Re: anyterm 1.1.28 and Server returned status code 500

Hmmm.

I think you'll need to run that under gdb and see exactly where it crashes.
Unfortunately gdb is a bit tedious when there are multiple threads.
strace -f might also give some clue what is going on.

Sorry.

Offline

#13 2009-01-21 23:25:53

phil
Administrator

Re: anyterm 1.1.28 and Server returned status code 500

OK, I've just thought of one reason why it's broken; it really needs to have that SUPPORT_LINUX_2_4 macro defined when it compiles anytermd itself, as well as libpbe.  I'm not sure if that explains the segfault though.  Anyway I'll try and fix that tomorrow (it's late now).

Phil.

Offline

#14 2009-01-21 23:31:10

Meteo
Guest

Re: anyterm 1.1.28 and Server returned status code 500

strace

./anytermd -p 8022 -u nobody -a null -f
Segmentation fault detected; Backtrace:
./anytermd[0x8093c26]
/lib/libpthread.so.0[0x40143806]
/lib/libc.so.6[0x401b28f8]
/lib/libpthread.so.0[0x401422cd]
/lib/libpthread.so.0(pthread_cond_broadcast+0x32)[0x4013d2d2]
./anytermd[0x8079102]
./anytermd[0x807c245]
./anytermd(_ZN5boost6detail8function26void_function_obj_invoker0INS_3_bi6bind_tIvPFvP6DaemoniENS3_5list2INS3_5valueIS6_EENSA_IiEEEEEEvE6invokeENS1_11any_pointerE+0x18)[0x807d22c]
./anytermd[0x8054e36]
./anytermd[0x8078df0]
/lib/libpthread.so.0[0x4013dc51]
/lib/libc.so.6(__clone+0x5a)[0x402447fa]
Segmentation fault

[00:28]<root(pts/13)@beerland>:~# strace -p 21875
Process 21875 attached - interrupt to quit
accept(4, {sa_family=AF_INET, sin_port=htons(1265), sin_addr=inet_addr("192.168.111.250")}, [16]) = 8
fcntl64(8, F_SETFD, FD_CLOEXEC)         = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
pipe([9, 10])                           = 0
clone(child_stack=0x80b4ef4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND) = 21899
write(10, "\1\0\0\0\5\0\0\0008\r\v\10\1\0\0\0\0\0\0\0\1\0\0\0\\*\0"..., 148) = 148
rt_sigprocmask(SIG_SETMASK, NULL, [RTMIN], 8) = 0
write(10, "\300X*@\0\0\0\0\24\367\377\277F\215\7\0108\37\v\10\0\0"..., 148) = 148
rt_sigprocmask(SIG_SETMASK, NULL, [RTMIN], 8) = 0
rt_sigsuspend([] <unfinished ...>
--- SIGRTMIN (Unknown signal 32) @ 0 (0) ---
<... rt_sigsuspend resumed> )           = -1 EINTR (Interrupted system call)
sigreturn()                             = ? (mask now [RTMIN])
accept(4, 0xbffff828, [16])             = ? ERESTARTSYS (To be restarted)
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
Process 21875 detached

#15 2009-01-21 23:38:58

phil
Administrator

Re: anyterm 1.1.28 and Server returned status code 500

You really need to use strace -f else you don't see all the threads, like the one that the clone() call in the middle of that trace created.

Interestingly the SIGRTMIN in there is something that LinuxThreads uses, so that is related.

If you want you could try to hack the libpbe common.mk to add -DSUPPORT_LINUX_2_4 and recompile (make clean first) and see if that improves things.

Offline

#16 2009-01-21 23:39:59

phil
Administrator

Re: anyterm 1.1.28 and Server returned status code 500

> hack the libpbe common.mk

I meant hack the top-level anyterm common.mk

Offline

#17 2009-01-22 18:13:39

phil
Administrator

Re: anyterm 1.1.28 and Server returned status code 500

svn rev 4936 fixes the problem I mentioned in comment #13.
You should "make clean" after updating.
If this doesn't work, gdb output is probably needed.

Offline

#18 2009-01-22 22:00:14

Meteo
Guest

Re: anyterm 1.1.28 and Server returned status code 500

Great :)
rev 4936  works fine on my kernel 2.4, no errors etc.
Thx You Very Much ;]

#19 2011-08-04 06:42:53

Nicopilami
Member

Re: anyterm 1.1.28 and Server returned status code 500

phil wrote:

# make

Please don't make as root.

jst for my information, why not?

Offline

#20 2011-08-04 09:52:32

phil
Administrator

Re: anyterm 1.1.28 and Server returned status code 500

> why not?

Because you don't need to.

Offline

#21 2011-08-04 10:04:42

Nicopilami
Member

Re: anyterm 1.1.28 and Server returned status code 500

phil wrote:

> why not?

Because you don't need to.

OK... :D

Offline

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson