Somebody lend a hand to figure out what's the problem on Solaris
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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???
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)
}
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
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
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!!!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.