If this isn't exactly what you wanted, please try our Search (there's a LOT of techy and non-techy stuff here about Linux, Unix, Mac OS X and just computers in general!):
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
Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)
| Views for this page | ||||
|---|---|---|---|---|
| Today | This Week | This Month | This Year | Overall |
| 1 | 4 | 6 | 6 | 319 |
/Bofcusm/2483.html copyright 1997-2004 (various authors) All Rights Reserved
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.

Click here to add your comments