OpenTTD

Tasklist

FS#2971 - depend doesn't terminate on linux/ppc

Attached to Project: OpenTTD
Opened by fonsinchen (fonsinchen) - Tuesday, 09 June 2009, 12:43 GMT
Last edited by Zdeněk Sojka (SmatZ) - Tuesday, 09 June 2009, 13:35 GMT
Type Bug
Category Build system
Status Closed
Assigned To No-one
Operating System All
Severity High
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

When compiling on a Powerpc with Debian GNU/Linux 5.0 make hangs on:

[SRC] DEP CHECK (all files)

Further examination with gdb shows that it never returns from Lexer::Lex() when parsing include/squirrel.h:

(gdb) bt
#0 0x0fca6f20 in getc () from /lib/libc.so.6
#1 0x1000b4e0 in File::GetChar (this=0xbf9c0938) at /home/alve/openttd/src/depend/depend.cpp:95
#2 0x1000b534 in Lexer::Next (this=0xbf9c0960) at /home/alve/openttd/src/depend/depend.cpp:185
#3 0x1000c8b8 in Lexer::Lex (this=0xbf9c0960) at /home/alve/openttd/src/depend/depend.cpp:323
#4 0x1000368c in ScanFile (
filename=0x10022c10 "/home/alve/openttd/src/3rdparty/squirrel/include/squirrel.h", ext=0x1001f040 ".o",
header=true, verbose=true) at /home/alve/openttd/src/depend/depend.cpp:790
#5 0x10002294 in ScanFile (
filename=0xbf9c54d4 "/home/alve/openttd/src/3rdparty/squirrel/sqstdlib/sqstdaux.cpp",
ext=0x1001f040 ".o", header=false, verbose=true) at /home/alve/openttd/src/depend/depend.cpp:639
#6 0x10003be8 in main (argc=486, argv=0xbf9c3fe4) at /home/alve/openttd/src/depend/depend.cpp:859
(gdb) finish
Run till exit from #0 0x0fca6f20 in getc () from /lib/libc.so.6
0x1000b4e0 in File::GetChar (this=0xbf9c0938) at /home/alve/openttd/src/depend/depend.cpp:95
95 char c = fgetc(this->fp);
(gdb) finish
Run till exit from #0 0x1000b4e0 in File::GetChar (this=0xbf9c0938)
at /home/alve/openttd/src/depend/depend.cpp:95
0x1000b534 in Lexer::Next (this=0xbf9c0960) at /home/alve/openttd/src/depend/depend.cpp:185
185 this->current_char = this->file->GetChar();
Value returned is $1 = 255 '�'
(gdb) finish
Run till exit from #0 0x1000b534 in Lexer::Next (this=0xbf9c0960)
at /home/alve/openttd/src/depend/depend.cpp:185
0x1000c8b8 in Lexer::Lex (this=0xbf9c0960) at /home/alve/openttd/src/depend/depend.cpp:323
323 this->Next();
(gdb) p file
$2 = (const File *) 0xbf9c0938
(gdb) p *file
$3 = {fp = 0x10022cd0, dirname = 0x10022e40 "/home/alve/openttd/src/3rdparty/squirrel/include",
filename = 0x10022c10 "/home/alve/openttd/src/3rdparty/squirrel/include/squirrel.h"}
(gdb) finish
Run till exit from #0 0x1000c8b8 in Lexer::Lex (this=0xbf9c0960)
at /home/alve/openttd/src/depend/depend.cpp:323

GetChar seems to always return 255, which is suspicious. The fp variable contains things like this:

(gdb) p *fp
$6 = {_flags = -72538984,
_IO_read_ptr = 0x48021000 "e sq_isarray(o) ((o)._type==OT_ARRAY)\n#define sq_isfunction(o) ((o)._type==OT_FUNCPROTO)\n#define sq_isclosure(o) ((o)._type==OT_CLOSURE)\n#define sq_isgenerator(o) ((o)._type==OT_GENERATOR)\n#define sq_"...,
_IO_read_end = 0x48021000 "e sq_isarray(o) ((o)._type==OT_ARRAY)\n#define sq_isfunction(o) ((o)._type==OT_FUNCPROTO)\n#define sq_isclosure(o) ((o)._type==OT_CLOSURE)\n#define sq_isgenerator(o) ((o)._type==OT_GENERATOR)\n#define sq_"...,
_IO_read_base = 0x48021000 "e sq_isarray(o) ((o)._type==OT_ARRAY)\n#define sq_isfunction(o) ((o)._type==OT_FUNCPROTO)\n#define sq_isclosure(o) ((o)._type==OT_CLOSURE)\n#define sq_isgenerator(o) ((o)._type==OT_GENERATOR)\n#define sq_"...,
_IO_write_base = 0x48021000 "e sq_isarray(o) ((o)._type==OT_ARRAY)\n#define sq_isfunction(o) ((o)._type==OT_FUNCPROTO)\n#define sq_isclosure(o) ((o)._type==OT_CLOSURE)\n#define sq_isgenerator(o) ((o)._type==OT_GENERATOR)\n#define sq_"...,
_IO_write_ptr = 0x48021000 "e sq_isarray(o) ((o)._type==OT_ARRAY)\n#define sq_isfunction(o) ((o)._type==OT_FUNCPROTO)\n#define sq_isclosure(o) ((o)._type==OT_CLOSURE)\n#define sq_isgenerator(o) ((o)._type==OT_GENERATOR)\n#define sq_"...,
_IO_write_end = 0x48021000 "e sq_isarray(o) ((o)._type==OT_ARRAY)\n#define sq_isfunction(o) ((o)._type==OT_FUNCPROTO)\n#define sq_isclosure(o) ((o)._type==OT_CLOSURE)\n#define sq_isgenerator(o) ((o)._type==OT_GENERATOR)\n#define sq_"...,
_IO_buf_base = 0x48021000 "e sq_isarray(o) ((o)._type==OT_ARRAY)\n#define sq_isfunction(o) ((o)._type==OT_FUNCPROTO)\n#define sq_isclosure(o) ((o)._type==OT_CLOSURE)\n#define sq_isgenerator(o) ((o)._type==OT_GENERATOR)\n#define sq_"..., _IO_buf_end = 0x48022000 <Address 0x48022000 out of bounds>, _IO_save_base = 0x0,
_IO_backup_base = 0x0, _IO_save_end = 0x0, _markers = 0x0, _chain = 0x100228e0, _fileno = 4, _flags2 = 0,
_old_offset = 0, _cur_column = 0, _vtable_offset = 0 '\0', _shortbuf = "", _lock = 0x10022d70,
_offset = -1, __pad1 = 0x0, __pad2 = 0x10022d7c, __pad3 = 0x0, __pad4 = 0x0, __pad5 = 0, _mode = -1,
_unused2 = '\0' <repeats 39 times>}
(gdb)
This task depends upon

Closed by  Zdeněk Sojka (SmatZ)
Tuesday, 09 June 2009, 13:35 GMT
Reason for closing:  Fixed
Additional comments about closing:  r16542
Comment by Zdeněk Sojka (SmatZ) - Tuesday, 09 June 2009, 13:08 GMT
Does the attached diff fix the problem for you?
Comment by fonsinchen (fonsinchen) - Tuesday, 09 June 2009, 13:17 GMT
With the patch depend terminates and the build system seems to behave as normal.

Loading...