Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

depend doesn't terminate on linux/ppc #2971

Closed
DorpsGek opened this issue Jun 9, 2009 · 3 comments
Closed

depend doesn't terminate on linux/ppc #2971

DorpsGek opened this issue Jun 9, 2009 · 3 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Jun 9, 2009

fonsinchen opened the ticket and wrote:

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)

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/2971
@DorpsGek
Copy link
Member Author

DorpsGek commented Jun 9, 2009

SmatZ wrote:

Does the attached diff fix the problem for you?

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2971#comment6188

@DorpsGek
Copy link
Member Author

DorpsGek commented Jun 9, 2009

fonsinchen wrote:

With the patch depend terminates and the build system seems to behave as normal.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2971#comment6189

@DorpsGek
Copy link
Member Author

DorpsGek commented Jun 9, 2009

SmatZ closed the ticket.

Reason for closing: Fixed

r16542


This comment was imported from FlySpray: https://bugs.openttd.org/task/2971

@DorpsGek DorpsGek closed this as completed Jun 9, 2009
@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) Build system labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant