LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 08: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, 09:34 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,399

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
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, 11:35 AM   #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, 12: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, 03:23 AM   #5
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,399

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
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, 03: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, 07:18 AM   #7
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,399

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
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, 08: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, 09:11 AM   #9
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
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 09:15 AM.
 
  


Reply

Tags
client, crash, server, socket



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 05:17 PM
Freenx Server, the Client always crashes for one user, other users work zurcherart Linux - Server 1 12-20-2009 05:03 PM
plasma desktop crashes, nepomuk crashes, after loggin in fm_clau SUSE / openSUSE 2 09-02-2009 10:14 AM
x11vnc server crashes when client connects vin109 Linux - Newbie 1 04-12-2008 08:49 PM

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

All times are GMT -5. The time now is 11:52 AM.

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
Open Source Consulting | Domain Registration