From: Boyd Lynn Gerber <gerberb@xenau.zenez.com> Subject: Re: HELP OpenServer socket + threads Date: Wed, 26 May 2004 07:31:19 -0600 Message-ID: <Pine.LNX.4.58.0405260719060.30332@xenau.zenez.com> References: <c91rdn$5gh$1@s1.read.news.oleane.net> On Wed, 26 May 2004, Gabriel Biberian wrote: > I recently had to compile a C++ program on SCO OpenServer (5.0.7). The > software runs fine on linux, bsd, osx, aix, solaris, but OpenServer > seems to cause troubles. > > I installed the gnutools from ftp.sco.com and as i need Posix Threads, i > also installed FSU-Threads v3.9 from SKUNKWARE.
You really need the latest version of FSU-threads. The website for FSU-threads is. http://moss.csc.ncsu.edu/~mueller/pthreads/ I host the SCO Version of threads. You can get it on ftp.zenez.com in the pub/zenez/prgms directory. ftp://ftp.zenez.com/pub/zenez/prgms/FSU-threads.tar.gz > There are many read/write/select calls on sockets and the program always > randomly segfaults and dumps core. These are known problems with this version. They are fixed in the latest version of the threads program.
> Apparently there seems to be a problem in memory alloc/free... > > Here is how i link the program > g++ -L/usr/local/lib -lmalloc -lgthreads -lsocket -lgthreads > > I read something in the MySQl documentation that to get pthreads to run > well with sockets, you must link with gnu malloc, but i don't think i > understand how to do that. I tried: > g++ -L/usr/local/lib -L/usr/local/lib/libmalloc.a -lgthreads -lsocket > -lgthreads > but it doesn't help at all. > I also tried installing a more recent version of FSU-threads (3.14), but > the problem persists. > > Anyone out there encounter this problem??? > Is there a solution? > You need to make sure you use the Malloc that comes with FSU-threads. The general version of it does not include this malloc as part of the FSU-threads program. It also when you compile from source can replace the system libmalloc.a. What I often see happen is the system libmalloc.a get put back in place and then even though I have specified the /usr/local/lib location g++ pics up the /usr/lib stuff first. I always build my FSU-threads library including the malloc library and put it in /usr/lib. Then I have not had problems. Good Luck, -- Boyd Gerber <gerberb@zenez.com> ZENEZ 1042 East Fort Union #135, Midvale Utah 84047
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.
Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.
Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.
We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.
Click here to add your comments
Don't miss responses! Subscribe to Comments by RSS or by Email
Click here to add your comments
If you want a picture to show with your comment, go get a Gravatar