Back to the Vavoom Forum Archives


Forum

[1.33] Segfault when compiling engine.dat

Fri, 06 May 2011 21:41:17

BondEar

So I'm trying to compile the 1.33 source on Debian amd64 with GCC 4.5. It compiles fine all the way up to vavoom-dedicated.bin. And then once it gets to "Generating ../../basev/common/progs/engine.dat", then it has problems. Here's the output af
Thu, 18 Aug 2011 04:42:52

BondEar

OK so I think I found out where the problem is. It's somewhere inside vcc. Valgrind shows this trace at the first error message:
==17454== Command: ../../utils/vcc/../bin/vcc -P/home/jb/games/vavoom-1.33/bas
Thu, 12 Jan 2012 04:40:05

BondEar

So I tried building r4431 with make -d. Here's what I got for engine.dat:
       Finished prerequisites of target file `basev/common/progs/engine.dat'.
      Must remake target `basev/common/progs/engine.dat'.
make[2]: Entering directory `/home/jb/games/vavoom-svn'
[ 94%] Putting child 0x00654970 (basev/common/progs/engine.dat) PID 12113 on the
 chain.
Live child 0x00654970 (basev/common/progs/engine.dat) PID 12113 
Reaping winning child 0x00654970 PID 12113 
Live child 0x00654970 (basev/common/progs/engine.dat) PID 12114 
Generating ../../basev/common/progs/engine.dat
Reaping winning child 0x00654970 PID 12114 
Live child 0x00654970 (basev/common/progs/engine.dat) PID 12116 
Reaping winning child 0x00654970 PID 12116 
Live child 0x00654970 (basev/common/progs/engine.dat) PID 12118 
(external):0 Segmentation Violation
Segmentation fault
Reaping losing child 0x00654970 PID 12118 
make[2]: *** [basev/common/progs/engine.dat] Error 139
Removing child 0x00654970 PID 12118 from chain.
make[2]: Leaving directory `/home/jb/games/vavoom-svn'
Reaping losing child 0x01f0e9d0 PID 12112 
make[1]: *** [progs/common/CMakeFiles/engine.dir/all] Error 2
Removing child 0x01f0e9d0 PID 12112 from chain.
make[1]: Leaving directory `/home/jb/games/vavoom-svn'
Reaping losing child 0x021e5950 PID 12010 
make: *** [all] Error 2
Removing child 0x021e5950 PID 12010 from chain.
make: Leaving directory `/home/jb/games/vavoom-svn'
Sure would be nice to know what program these PIDs correspond to...
Sat, 14 Jan 2012 04:27:08

BondEar

The error is in this line in build.make:
cd /home/BondEar/games/vavoom-svn/progs/common && ../../utils/vcc/../bin/vcc -P/home/BondEar/games/vavoom-svn/basev/common/progs /home/BondEar/games/vavoom-svn/progs/common/engine/classes.vc /home/BondEar/games/vavoom-svn/basev/common/progs/engine.dat
The cd works. The problem is with vcc. Also why does vcc have this line in its main method?
int main(int argc, char **argv)
{
	try
	{
		GLog.AddListener(&VccLog);

		int starttime;
		int endtime;

		M_InitByteOrder();

		signal(SIGSEGV, SignalHandler); //why?
I did try commenting it out, but it still segfaults. Alright, so I built vcc, and used it to run the command given in build.make (where vcc compiles engine.dat). Valgrind gives this:
==22967== Invalid read of size 8
==22967==    at 0x452B04: VParser::ParseStatement() (vc_parser.cpp:1126)
==22967==    by 0x453031: VParser::ParseCompoundStatement() (vc_parser.cpp:1170)
==22967==    by 0x453EA1: VParser::ParseMethodDef(VExpression*, VName, TLocation, VClass*, int, bool) (vc_parser.cpp:1375)
==22967==    by 0x457F59: VParser::ParseClass() (vc_parser.cpp:2441)
==22967==    by 0x458773: VParser::Parse() (vc_parser.cpp:2553)
==22967==    by 0x46191E: main (vcc.cpp:105)
==22967==  Address 0x8 is not stack'd, malloc'd or (recently) free'd
==22967== 
/home/jb/games/vavoom-svn/progs/common/engine/LevelInfo.vc:342 Segmentation Violation
EDIT: Success, sort of. Commenting out vc_parser.cpp:1126 allowed make to finish. However when I run Vavoom it gives me "Sys_Error: Bad class size".

Back to the Vavoom Forum Archives