Discussion:
[bug #18254] Server ignores input when run in screen
Marko Lindqvist
2011-06-21 09:38:44 UTC
Permalink
URL:
<http://gna.org/bugs/?18254>

Summary: Server ignores input when run in screen
Project: Freeciv
Submitted by: cazfi
Submitted on: Tue 21 Jun 2011 12:38:43 PM EEST
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
Status: None
Assigned to: None
Originator Email:
Open/Closed: Open
Release:
Discussion Lock: Any
Operating System: None
Planned Release:

_______________________________________________________

Details:

I wanted to run server in 'screen'.

As soon as I try to enter anything to server command line it says:
"Server cannot read standard input. Ignoring input."
and nothing can be done from command line.

Simply commenting out contents of handle_stdin_close() fixed this for my
particular use-case.




_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?18254>

_______________________________________________
Message sent via/by Gna!
http://gna.org/
Jacob Nevins
2011-06-28 21:52:06 UTC
Permalink
Follow-up Comment #1, bug #18254 (project freeciv):

I can't reproduce (with screen 4.0.3-14ubuntu1.2 on Ubuntu Lucid). From
inside a screen session, I do "screen server/freeciv-server" to start the
server inside a new terminal, and it all seems to work fine for me. Trunk and
S2_3, built with HAVE_LIBREADLINE.

_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?18254>

_______________________________________________
Message sent via/by Gna!
http://gna.org/
anonymous
2011-07-15 16:10:39 UTC
Permalink
Follow-up Comment #2, bug #18254 (project freeciv):

Me too, I run freeciv 2.2.5 servers on Debian 5 inside screen, and everything
works fine. I get that message "Server cannot read standard input. Ignoring
input." only after I enter a blank line in stdin. BTW, I don't like that
message too. KeyserSoze

_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?18254>

_______________________________________________
Message sent via/by Gna!
http://gna.org/
Marko Lindqvist
2011-07-15 16:17:47 UTC
Permalink
Follow-up Comment #3, bug #18254 (project freeciv):

Yes, I probably get the extra empty line from somewhere (IIRC I used "-r
cazfi.serv", btw) and server interprets it so that stdin cannot be read at
all. Don't know if there is any easy way to improve the way the check works.

_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?18254>

_______________________________________________
Message sent via/by Gna!
http://gna.org/
Jacob Nevins
2012-06-24 21:29:36 UTC
Permalink
Follow-up Comment #4, bug #18254 (project freeciv):

I've only been able to provoke this message by typing Ctrl-D at the server
prompt. I couldn't provoke it by just hitting Return, or by putting blank
lines in .serv files.

_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?18254>

_______________________________________________
Message sent via/by Gna!
http://gna.org/
Jacob Nevins
2014-03-02 23:45:17 UTC
Permalink
Post by Jacob Nevins
I've only been able to provoke this message by typing Ctrl-D at
the server prompt.
...on reflection, we should fix that. Bug #21743. Maybe a fix will also fix
some of the stuff reported here.

_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?18254>

_______________________________________________
Message sent via/by Gna!
http://gna.org/
Davide Baldini
2014-03-03 01:06:30 UTC
Permalink
Follow-up Comment #6, bug #18254 (project freeciv):

This message always appears to me anytime I enter a blank line in console. I
first noticed this with 2.3.0, progressively up to the current 2.4.2. I don't
know for releases before 2.3.0.

I never got in touch with a build not affected by this bug.

Debian 5 and 6; no Screen, only bg Bash process or nohup.

_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?18254>

_______________________________________________
Message sent via/by Gna!
http://gna.org/
pepeto
2014-10-22 16:40:30 UTC
Permalink
Update of bug #18254 (project freeciv):

Category: None => general
Status: None => Ready For Test
Assigned to: None => pepeto
Planned Release: => 2.4.4, 2.5.0, 2.6.0

_______________________________________________________

Follow-up Comment #7:

Bug added at revision 14646 for PR#40225 (getline()).

The problem is that it is overwriting the value returned by read() [0 means
EOF, -1 error]. Fix attached. You must turn off HAVE_LIBREADLINE to
reproduce.


(file #22711, file #22712)
_______________________________________________________

Additional Item Attachment:

File name: trunk_blank_line_dont_close_stdin.patch Size:0 KB
File name: S2_4_S2_5_blank_line_dont_close_stdin.patch Size:0 KB


_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?18254>

_______________________________________________
Message posté via/par Gna!
http://gna.org/
pepeto
2014-10-23 17:10:56 UTC
Permalink
Post by pepeto
The problem is that it is overwriting the value returned by
read() [0 means EOF, -1 error].
Actually, this is wrong. The problem is that when getline() gets empty string,
'didget' is set to 0. 0 is considered as EOF (because the code is also used
for read()) and then the input is ignored.

The patch remains good and still fixes the issue.


_______________________________________________________

Reply to this item at:

<http://gna.org/bugs/?18254>

_______________________________________________
Message posté via/par Gna!
http://gna.org/

Continue reading on narkive:
Loading...