Languages and Scripting

Re: Alib and pthread incompatible???

 
SOLVED
Go to solution
Scott Milne
Occasional Contributor

Alib and pthread incompatible???

When we attempt to run out app with the Alib and pthread we get a Segmentation fault. Without Alib our app runs fine (until I need the audio library). I have a sample program that runs fine with Alib but Segmentation faults when pthread is linked in.

I installed the audio lib from the 11.11 dev kit. Does anyone have any ideas?
3 REPLIES 3
susan gregory_1
Valued Contributor
Solution

Re: Alib and pthread incompatible???

What compile and link options are you using when you compile your Alib app? If it is multi-threaded you may need just more than linking with -lpthread. Are you passing -D_REENTRANT, -D_HPUX_SOURCE and/or some of the other pthread compiler options? Check out the man page for pthread for some info on those options.
Are you linking in libdce.* or libcma.*? Those are also multi-threaded libraries and their pthread calls are incompatible with those in libpthread.*, so if the program or any of the libraries it is loading are also linking (or have linked) with -ldce or -lcma, you will need to remove those libraries from the link if you are going to add -pthread.
Don't know if it will help, but those are my 2 cents.
Scott Milne
Occasional Contributor

Re: Alib and pthread incompatible???

Thats the problem we are using libpthread and the audio library (Alib) version that we have is using the cma threads library.

Now how do we solve the problem? We need to use the pthread library, and the audio library is linked against the DEC threads package. We need to get a pthread version of the audio library but I so far have not been able to find one. Any ideas?
Mike Stroyan
Honored Contributor

Re: Alib and pthread incompatible???

Put patches PHSS_28547 and PHSS_28548 on your development system. You will need to require PHSS_28547 on runtime systems.

The PHSS_28547 AudioSubsystem patch includes /opt/audio/lib/libAlibkt.1 (and /opt/audio/lib/pa20_64/libAlibkt.1). The PHSS_28548 Audio DevKit patch includes the symbolic links from libAlibkt.sl names that you will need at link time. These libraries use pthread kernel threading.