Errors compiling 0.4 on OpenBSD

For all the help you need with Armagetron!
Monkey
Match Winner
Posts: 759
Joined: Thu May 22, 2008 12:36 am
Location: England, UK

Errors compiling 0.4 on OpenBSD

Post by Monkey »

Well, I thought it's about time I got 0.4 working on OpenBSD. Note that I'm currently attempting to get it working without using the OpenBSD ports/packages system (I'll worry about that later).

So, Configure runs fine but when I run make it gives the following output:

Code: Select all

make  all-recursive
Making all in src
Making all in first
Making all in protobuf
make: don't know how to make tColor.pb.cc (prerequisite of: libprotobuf_a-tColor.pb.o)
Stop in src/protobuf
*** Error 1 in src (Makefile:4132 'all-recursive')
*** Error 1 in . (Makefile:676 'all-recursive')
*** Error 1 in /root/armagetronad-experimental-0.4_alpha_z2219_20150311 (Makefile:450 'all')
Playing since December 2006
User avatar
/dev/null
Shutout Match Winner
Posts: 819
Joined: Sat Sep 04, 2004 6:28 pm
Location: Chicago-ish

Re: Errors compiling 0.4 on OpenBSD

Post by /dev/null »

looks like you are missing a lib. protobuff to be exactly vague.
Monkey
Match Winner
Posts: 759
Joined: Thu May 22, 2008 12:36 am
Location: England, UK

Re: Errors compiling 0.4 on OpenBSD

Post by Monkey »

I don't think that's it, I've got protobuf 2.4.1 installed.
Playing since December 2006
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Re: Errors compiling 0.4 on OpenBSD

Post by Lucifer »

In linux, libprotobuf and protoc are in different packages. Look for a protoc package.
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
Monkey
Match Winner
Posts: 759
Joined: Thu May 22, 2008 12:36 am
Location: England, UK

Re: Errors compiling 0.4 on OpenBSD

Post by Monkey »

I've checked the ports/packages on OpenBSD and there are only two that could correspond to what we're looking for. They are:

protobuf (version 2.4.1)
protobuf-c (version 1.0.1)

I've got both installed and still no joy. Note that I can type "protoc --version" at a command prompt, which gives the output "libprotoc 2.4.1".

Any more ideas?
Playing since December 2006
User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Re: Errors compiling 0.4 on OpenBSD

Post by dlh »

Can you upload your config.log? Also, ensure you're using GNU make (gmake).
Monkey
Match Winner
Posts: 759
Joined: Thu May 22, 2008 12:36 am
Location: England, UK

Re: Errors compiling 0.4 on OpenBSD

Post by Monkey »

Okie dokie so...yes...I was using "make" instead of "gmake"... :oops: good spot dlh!

Anyway, now I've got it to compile, build and install. However, it crashes on startup every time. I've run a backtrace through gdb, here is the result:

Code: Select all

(gdb) run
Starting program: /usr/local/bin/armagetronad-experimental 

Program received signal SIGSEGV, Segmentation fault.
0x0c8250ed in pthread_mutexattr_settype (attrp=0xcfbe0764, type=2) at /usr/src/lib/librthread/rthread_mutexattr.c:61
61      /usr/src/lib/librthread/rthread_mutexattr.c: No such file or directory.
        in /usr/src/lib/librthread/rthread_mutexattr.c
(gdb) bt
#0  0x0c8250ed in pthread_mutexattr_settype (attrp=0xcfbe0764, type=2) at /usr/src/lib/librthread/rthread_mutexattr.c:61
#1  0x16257f5b in boost::recursive_mutex::recursive_mutex () from /usr/local/bin/armagetronad-experimental
#2  0x1622fb0a in __static_initialization_and_destruction_0 () from /usr/local/bin/armagetronad-experimental
#3  0x15f4ce9a in __register_frame_info () from /usr/local/bin/armagetronad-experimental
#4  0x15f4cfcb in atexit () from /usr/local/bin/armagetronad-experimental
#5  0x15f4ad6b in __init () from /usr/local/bin/armagetronad-experimental
#6  0x15f4cd8f in _start () from /usr/local/bin/armagetronad-experimental
#7  0x05732350 in _dl_boot () at /usr/src/libexec/ld.so/loader.c:532
#8  0x15f4cd1a in _start () from /usr/local/bin/armagetronad-experimental
(gdb) 

I've attached "config.log" anyway because it may come in useful at some point here (had to call it "config.log.txt" for the forums to allow it).
Attachments
config.log.txt
(94.06 KiB) Downloaded 239 times
Playing since December 2006
User avatar
Z-Man
God & Project Admin
Posts: 11585
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Errors compiling 0.4 on OpenBSD

Post by Z-Man »

Hmm, that's the initialization of a static boost::thread mutex. Maybe on BSD, you can't have static mutexes? I pushed something that changes it to a on-demand created mutex.
Monkey
Match Winner
Posts: 759
Joined: Thu May 22, 2008 12:36 am
Location: England, UK

Re: Errors compiling 0.4 on OpenBSD

Post by Monkey »

So this time I used BZR (as opposed to last time where I got the most recent snapshot) to get the latest 0.4. It now compiles most of the way but stops with the following error:

Code: Select all

g++ -DHAVE_CONFIG_H -I. -I..   -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/X11R6/include -DXTHREADS -I/usr/local/include/libpng16 -I/usr/local/include -I/usr/local/include/FTGL -I/usr/X11R6/include/freetype2 -I/usr/X11R6/include/freetype2   -I./tools -I./resource -I./thirdparty/mathexpr -I./thirdparty/utf8 -I./protobuf -Iprotobuf -O2 -I/usr/X11R6/include -pthread -MT tools/values/libtools_a-vCore.o -MD -MP -MF tools/values/.deps/libtools_a-vCore.Tpo -c -o tools/values/libtools_a-vCore.o `test -f 'tools/values/vCore.cpp' || echo './'`tools/values/vCore.cpp
mv -f tools/values/.deps/libtools_a-vCore.Tpo tools/values/.deps/libtools_a-vCore.Po
/bin/sh ../ylwrap tools/values/vParser.ypp y.tab.c tools/values/vParser.cpp y.tab.h `echo tools/values/vParser.cpp | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/` y.output tools/values/vParser.output -- yacc  
/root/armagetronad-experimental/0.4/src/tools/values/vParser.ypp:39: syntax error
%destructor {
^
Makefile:4154: recipe for target 'tools/values/vParser.cpp' failed
gmake[5]: *** [tools/values/vParser.cpp] Error 1
gmake[5]: Leaving directory '/root/armagetronad-experimental/0.4/src'
test -r commands.txt || echo "Sorry, command help generation failed." > commands.txt
test -r commands.txt || mv commands.txt commands.txt
gmake[4]: Leaving directory '/root/armagetronad-experimental/0.4/src/doc'
gmake[3]: Leaving directory '/root/armagetronad-experimental/0.4/src/doc'
gmake[3]: Entering directory '/root/armagetronad-experimental/0.4/src'
/bin/sh ../ylwrap tools/values/vParser.ypp y.tab.c tools/values/vParser.cpp y.tab.h `echo tools/values/vParser.cpp | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/` y.output tools/values/vParser.output -- yacc  
/root/armagetronad-experimental/0.4/src/tools/values/vParser.ypp:39: syntax error
%destructor {
^
Makefile:4154: recipe for target 'tools/values/vParser.cpp' failed
gmake[3]: *** [tools/values/vParser.cpp] Error 1
gmake[3]: Leaving directory '/root/armagetronad-experimental/0.4/src'
Makefile:4163: recipe for target 'all-recursive' failed
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory '/root/armagetronad-experimental/0.4/src'
Makefile:767: recipe for target 'all-recursive' failed
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory '/root/armagetronad-experimental/0.4'
Makefile:559: recipe for target 'all' failed
gmake: *** [all] Error 2
A syntax error?
Note that I had to alter some environment variables for bootstrap.sh to work, however I'd be surprised if that has caused anything:

Code: Select all

export AUTOCONF_VERSION="2.69"
export ACLOCAL="/usr/local/bin/aclocal-1.15"
export AUTOHEADER="/usr/local/bin/autoheader-2.69"
export AUTOCONF="/usr/local/bin/autoconf-2.69"
export AUTOMAKE="/usr/local/bin/automake-1.15"
Playing since December 2006
User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Re: Errors compiling 0.4 on OpenBSD

Post by dlh »

I think you need to install bison.

…We should change configure.ac to check that.
User avatar
Z-Man
God & Project Admin
Posts: 11585
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Errors compiling 0.4 on OpenBSD

Post by Z-Man »

We should. Done.
Monkey
Match Winner
Posts: 759
Joined: Thu May 22, 2008 12:36 am
Location: England, UK

Re: Errors compiling 0.4 on OpenBSD

Post by Monkey »

We're almost there! :)

Yes, I needed bison...I also needed to create a symbolic link (/usr/local/bin/python) to one of my python binaries (you may want to add a check for python in your configure.ac too).

Anyway, it now compiles, installs and runs although it crashes most times I've used it. I've run it about fifty times and I got to play in local mode three times (where strangely it didn't crash). It crashes every single time that I try to connect to the master servers, always as soon as I select "online multiplayer". Also, unfortunately, when it crashes, it usually hangs my system rather than exiting gracefully (of course I can kill the process but still...).

This is very exciting, because it seems to play much smoother than 0.2.8 for me. It is also very frustrating :x

I'll try to get some bug information now...
Playing since December 2006
Monkey
Match Winner
Posts: 759
Joined: Thu May 22, 2008 12:36 am
Location: England, UK

Re: Errors compiling 0.4 on OpenBSD

Post by Monkey »

Well, this is quite difficult.

When I run arma in gdb and arma crashes, it hangs gdb so I have to kill the gdb process. Is there any way around this?
I've had to keep attempting to run arma (without gdb) until I get a graceful crash so that it gives me a .core file. Note that this crash happened after I selected "online multiplayer". I've run gdb on the .core file but a backtrace doesn't give much useful information:

Code: Select all

(gdb) core-file armagetronad.core 
Core was generated by `armagetronad'.
Program terminated with signal 6, Aborted.
#0  0x03e694a1 in ?? ()
(gdb) bt 
#0  0x03e694a1 in ?? ()
#1  0x03ea7896 in ?? ()
#2  0x000f5c3b in ?? ()
#3  0x00000006 in ?? ()
#4  0x856c6be8 in ?? ()
#5  0x856c6bf8 in ?? ()
#6  0x23e06574 in ?? ()
#7  0x2355f500 in ?? ()
#8  0x00000000 in ?? ()
(gdb)
Is there something I should be doing that could give more information?

By the way, I very much appreciate the help you guys are giving me with this :)
Playing since December 2006
Monkey
Match Winner
Posts: 759
Joined: Thu May 22, 2008 12:36 am
Location: England, UK

Re: Errors compiling 0.4 on OpenBSD

Post by Monkey »

Third post's the charm :P

So, when it doesn't crash at startup, I can use custom connect to connect to a server to play. I use pickup's server browser instead of arma's master list, which also tells me the arma address of the servers. While this is a bit inconvenient it still means I get to use 0.4. When I do this the client doesn't crash at all; I played on several different servers for a long time with no problems.

This is ok for now but if we can find out why my 0.4 client won't ever connect to the master list then that would be great. It also seems to crash every time I go to the subcultures menu, yet bookmarks and custom connect are fine...so strange.

I've managed to get some useful debugging information from gdb. I selected "online multiplayer" and it crashed. Here is a backtrace:

Code: Select all

(gdb) run
Starting program: /usr/local/bin/armagetronad 
Command CAMERA_GLANCE_BACK unknown.

Command CAMERA_GLANCE_BACK_FROMSPEED unknown.

Command CAMERA_GLANCE_PITCH unknown.

Command CAMERA_GLANCE_RISE unknown.

Command CAMERA_GLANCE_RISE_FROMSPEED unknown.

^[[B^[[B^[[A
Program received signal SIGSEGV, Segmentation fault.
[Switching to thread 1012671]
0x043bc419 in omalloc (sz=23, zero_fill=0, f=0x0) at /usr/src/lib/libc/stdlib/malloc.c:975
975     /usr/src/lib/libc/stdlib/malloc.c: No such file or directory.
        in /usr/src/lib/libc/stdlib/malloc.c
(gdb) bt 
#0  0x043bc419 in omalloc (sz=23, zero_fill=0, f=0x0) at /usr/src/lib/libc/stdlib/malloc.c:975
#1  0x043bd37a in malloc (size=23) at /usr/src/lib/libc/stdlib/malloc.c:1173
#2  0x043a63f2 in strdup (str=0x81807c87 "cable.virginmedia.net.") at /usr/src/lib/libc/string/strdup.c:45
#3  0x043a376c in asr_ctx_add_searchdomain (ac=0x7c556e80, domain=Variable "domain" is not available.
) at /usr/src/lib/libc/asr/asr.c:549
#4  0x043a41ab in asr_ctx_from_string (ac=0x7c556e80, str=Variable "str" is not available.
) at /usr/src/lib/libc/asr/asr.c:680
#5  0x043a4421 in asr_check_reload (asr=0x88fd5ee0) at /usr/src/lib/libc/asr/asr.c:713
#6  0x043a452b in asr_resolver (conf=0x24317f14 "/etc/resolv.conf") at /usr/src/lib/libc/asr/asr.c:128
#7  0x043a465c in asr_use_resolver (arg=0x0) at /usr/src/lib/libc/asr/asr.c:355
#8  0x043a1d20 in res_init () at /usr/src/lib/libc/asr/res_init.c:44
#9  0x04381342 in getaddrinfo (hostname=0x88fd598c "lightron.org", servname=0x0, hints=0x81809600, res=0x8180964c) at /usr/src/lib/libc/asr/getaddrinfo.c:35
#10 0x194a6b10 in nDNSResolver::Resolve () from /usr/local/bin/armagetronad
#11 0x194a4784 in boost::thread::run<tMemberFunctionRunnerTemplate<nDNSResolver> > () from /usr/local/bin/armagetronad
#12 0x05e6280e in _rthread_start (v=0x7de34400) at /usr/src/lib/librthread/rthread.c:145
#13 0x04337c46 in __tfork_thread () at /usr/src/lib/libc/arch/i386/sys/tfork_thread.S:95
(gdb) 
Playing since December 2006
User avatar
Z-Man
God & Project Admin
Posts: 11585
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Errors compiling 0.4 on OpenBSD

Post by Z-Man »

Well, that can mean two things: either boost::thread is borked on OpenBSD or you can't do what we do in threads on OpenBSD. On the client, we use threading just to make the 100 DNS lookups we do concurrent. If need be, that can be disabled.

This is going to take a bit longer, I'll have to set up a test VM myself.
Post Reply