LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-25-2010, 11:04 AM   #1
lambert
LQ Newbie
 
Registered: Jan 2010
Posts: 3

Rep: Reputation: 0
Question Somebody lend a hand to figure out what's the problem on Solaris


Hi guys,

My tcp socket server which i developed under cygwin couple of days ago had a problem of recieving command from a client on solaris. The server is supposed to realize authentication and products listing sort of functions and so forth. There is no problem when i execute server and client under cygwin. The weird thing is every time when i send a "L" command which means want to list the products on the server side. The client process is closed by the server. Here is what i copied from the terminal: "Connection to 127.0.0.1 closed by foreign host", and the server side has saying goes like this:"Children 11800 terminated with status 138", and generate the core which may have something wrong in the memory?

I've been checking online to see what this status 138 means. So far, several explainations may give a hint. 1:buffer size exceed the size of vitual memory? 2:dereferencing pointer to a incomplete type(i saw it online)? 3:NFS write error on host variable: No space left on
device(I use df command to check there is much more space than i expected ).
Now i don't know why it happend. Somebody lend a hand???

Waiting online!!!

BTW:solaris version is Solaris/SPARC 9
 
Old 01-25-2010, 01:17 PM   #2
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by lambert View Post
Waiting online!
Are you checking the return values of all of your socket functions (i.e. socket, connect, recv, etc.) and printing out the string value of any errors you see using strerror?

For example:
Code:
    result = recv(socket, buffer, length, flags);
    if (-1 == result)
    {
        fprintf(stderr, "ERROR: recv failed: %s\n", strerror(errno));
        // TODO: Handle the error gracefully (e.g. close the socket
        // and exit the program)
    }
 
Old 01-25-2010, 07:49 PM   #3
lambert
LQ Newbie
 
Registered: Jan 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by David1357 View Post
Are you checking the return values of all of your socket functions (i.e. socket, connect, recv, etc.) and printing out the string value of any errors you see using strerror?

For example:
Code:
    result = recv(socket, buffer, length, flags);
    if (-1 == result)
    {
        fprintf(stderr, "ERROR: recv failed: %s\n", strerror(errno));
        // TODO: Handle the error gracefully (e.g. close the socket
        // and exit the program)
    }
good point David, Thanks for your remind. I'll do that
 
Old 01-25-2010, 10:13 PM   #4
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Some of the POSIX-defined structures differ from system to system, e.g. the ordering of members of struct flock differs between glibc and FreeBSD; therefore, make sure you're explicitly initializing members of such structs (if applicable.) The networking-related operations seem especially susceptible to this sort of thing because of the extensive use of structs. Did you have any build warnings on Solaris? Did you run a backtrace on the core dump? That should tell you where the problem is, provided you built with debug symbols.
Kevin Barry
 
Old 01-31-2010, 03:55 AM   #5
lambert
LQ Newbie
 
Registered: Jan 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Smile Problem solved

Sorry for late response, The problem has been solved. The problem results from the size differentiation of pointer between 32bit OS and 64bit OS. Thank you guys for your kind help!!!
 
  


Reply

Tags
programming, socket, solaris



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
[SOLVED] can anyone lend me their 64-bit /lib64/libuuid.so.1.2 file? zuzoa Slackware 2 09-13-2009 02:46 PM
LXer: Big Vendors Lend Credibility to Open Source LXer Syndicated Linux News 0 03-20-2007 07:16 AM
Commandline gurus lend me your ears Deviathan Linux - General 3 09-27-2006 11:30 AM
LXer: Linux Training and Laptops Go Hand in Hand at LinuxCertified LXer Syndicated Linux News 0 01-31-2006 12:01 PM
Ok starting to get the hand of this drivers though problem veener88 Linux - Newbie 15 08-07-2005 10:17 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:32 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