LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-02-2015, 09:05 AM   #1
newhorizon101
LQ Newbie
 
Registered: Apr 2014
Posts: 16

Rep: Reputation: Disabled
Linux Server crashes when the Client crashes


Greetings All,

Can you some one throw some light on the problem, I am experiencing.

I have a server that periodically(120 Hz) sends a packet to client.

If I manually kill (SIGKILL) the client application, the server applications exits. Any way I can prevent the server from exiting ?

Client is connected to server on a TCP socket. If I do same experiment with UDP socket, the server does not exit when the client is killed.
 
Old 04-02-2015, 10:34 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 10,989

Rep: Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250
Interesting problem. I think you will have to be much more specific before anyone attempts an answer

which server/client/versions/distros/etc? How is the server started? Xinetd/inetd/something else?
Is it dark net/encrypted/firewalled/redirected in any way that might affect behaviour?

How come you can send tcp and udp packets to the same server?
 
Old 04-02-2015, 12:35 PM   #3
thegwer
Member
 
Registered: Jan 2012
Location: San Antonio. TX
Distribution: CentOS. Ubuntu
Posts: 48

Rep: Reputation: Disabled
Well business_kid is definitely correct we need a lot more info on this. However I would suggest it might have something to do with TCP actually making a connection and UDP being connectionless. When what ever service you are running notices the connection ending, it stops listening. UDP is probably not sending a close signal on exit to the service so it stays open.


What is the name of the service you are running?

Travis
 
Old 04-02-2015, 01:43 PM   #4
newhorizon101
LQ Newbie
 
Registered: Apr 2014
Posts: 16

Original Poster
Rep: Reputation: Disabled
Hello Business_Kid,

Well the server program is my program, I setup the socket as a stream socket, do a bind and pend on accept. Client then connects to the server socket, server program then starts doing send() at 120 hz. (120/second). Client receives the data, processes it fine. But as soon as I kill the client program, It kills the server program too.

My linux version is 3.9.0 for git tree.

My HW is a embedded target, so I start 2 seperate programs doing tcp and udp, and same thing on the client side.
 
Old 04-03-2015, 04:23 AM   #5
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 10,989

Rep: Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250
Quote:
Originally Posted by newhorizon101 View Post
My linux version is 3.9.0 for git tree.

My HW is a embedded target, so I start 2 seperate programs doing tcp and udp, and same thing on the client side.
All proprietary stuff, eh? Embedded, eh? There is no valid reason why a 'broken pipe' type error should result in a server crash. It might result in a server instance crash. I would check what signals are being received/sent.

How does your server react to a packet that starts but never finishes? If, otoh, you set the client to send 20 packets and then stop, it will complete the 20 packets. and then close the connection.

It's in the source.
 
1 members found this post helpful.
Old 04-03-2015, 04:19 PM   #6
newhorizon101
LQ Newbie
 
Registered: Apr 2014
Posts: 16

Original Poster
Rep: Reputation: Disabled
Thanks business kid for the insight. What I also experience is, lets say I open up a ssh connection from target which is server to a target which is client, and if I do cat on a very large file (client file), I get broken pipe too. Can this be a driver type issue ? Client server targets talk to each other on a Marvell switch.
 
Old 04-04-2015, 08:18 AM   #7
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 10,989

Rep: Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250
I am a hardware guy myself.

At this distance, it could be anything. Take nothing for granted; don't go swapping stuff randomly. Let facts and debug info lead you. To solve this, someone is going to have to be there with the equipment. At the moment, it's you.
 
Old 04-04-2015, 09:32 AM   #8
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
Quote:
lient is connected to server on a TCP socket. If I do same experiment with UDP socket, the server does not exit when the client is killed.
UDP effectively connectionless (though perhaps "sessionless" would be a better adjective).
There is no facility to ask for a re-transmit (ARQ) or even packet accounting, which is why it's normally used for streams where the next packet is always more important than the last (stock market tickers, live feeds, etc).
TCP carries the extra accounting overhead, but at the adapter level that accounting is causing things like ACK, SYN and ARQ passing back and forth. The ARQ has a timeout value, either I get this by <time> or the session closes. UDP does not.
It's a WAG, but I'd start there.
 
Old 04-04-2015, 10:11 AM   #9
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,277

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
i think it mite have something to do with (for e.g.) the ssh daemon forks a new process for each new connection whereas a daemon-less service mite establish one connection and then exit when the client hangs up (e.g.):
Code:
/usr/sbin/sshd -d -d -d

Last edited by schneidz; 04-04-2015 at 10:15 AM.
 
  


Reply

Tags
client, crash, server, socket


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian with Apache and TvHeadend: crashes and crashes again mimu88 Linux - General 2 01-12-2015 06:17 PM
Freenx Server, the Client always crashes for one user, other users work zurcherart Linux - Server 1 12-20-2009 06:03 PM
plasma desktop crashes, nepomuk crashes, after loggin in fm_clau SUSE / openSUSE 2 09-02-2009 11:14 AM
x11vnc server crashes when client connects vin109 Linux - Newbie 1 04-12-2008 09:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration