COCKPIT_FILE command in console not working

Bug #830280 reported by dlh on 2011-08-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Armagetron Advanced
Undecided
Unassigned

Bug Description

ubuntu_dpg@forums (_ubuntu_ on irc) reports that they are unable to change their cockpit file in-game using the console. The game outputs the $config_error_read message. Running version 0.3_alpha20110820 on archlinux.

Other errors reported on startup of the game:

"""
Input error reading TEAM_MENU_COLOR_TEAM_FULL: invalid format.
Input error reading TEAM_MENU_COLOR_TEAM_OK: invalid format.
"""

Attached is a debug recording made by ubuntu_dpg, but I do not see the bug reproduced in it when I play it back on Mac OS X.

dlh (dlh) wrote :
description: updated
dlh (dlh) on 2011-08-20
description: updated
Manuel Moos (z-man) wrote :

Sounds like something weird is going on that is system/library/compiler dependent. Arch Linux is one of those distributions without releases and just constant updates; I'll try to install the current system ASAP, but just to be sure, could you try to get the gcc version?

I'm also mystified about the date tag appearing in the version. That shouldn't happen when building from svn, bzr or our source tarballs, they should be revision tagged. How was this built, exactly?

dlh (dlh) wrote :

Compiler is gcc (GCC) 4.6.1. I think it's related to a change in gcc 4.6/streams.

Possibly related:
"""
<_ubuntu_> There was a problem with the 0.2.8-sty+ct login code. I changed a line in nNetwork.cpp in some function (can't remember it): changed the while loop from while(!stream.eof()) to while(stream.good())
<_ubuntu_> then it worked :p
"""

I tryed (GCC) 4.5.3. Still same problem. Maybe I should try GCC 4.5.2?
It outputs a bit more messages of this type on start:

Input error reading COCKPIT_FILE: invalid format.
Input error reading TEAM_MENU_COLOR_TEAM_FULL: invalid format.
Input error reading TEAM_MENU_COLOR_TEAM_OK: invalid format.

I also found the following: http://www.spinics.net/lists/gcchelp/msg32365.html

Forgot :How I built it: bzr co lp:armagetronad && ./bootstrap && ./configure && make && make install
I'm the _ubuntu_ on irc

Manuel Moos (z-man) wrote :

Got it reproduced, it's a problem with gcc 4.x. The behavior of the putback functions for streams has changed. Now, if you read past eof and use putback, the eof flag is reset to false, but the good flag stays false, in other words, the stream is put into a non-eof error state. So we need to go over the putback calls and avoid putting back in eof state,

Can you run 'bzr diff' on the modified sty code if you still have it? I can't find any such while loop in that file.

(in irc i corrected me, dlh left that part out) it's the file nKrawall.cpp:line 252.

Got it working. Just replaced s.putback(x) with if(!s.eof()) s.putpack(x) in tString.cpp, tConfiguration.cpp, gStatistics.cpp

Manuel Moos (z-man) wrote :

Committed basically that to all branches. It also fixes the nKrawall.cpp endless loop error.

Changed in armagetronad:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers