[pulseaudio-tickets] [PulseAudio] #478: Fixes for build and run time problems under Mac OS X

PulseAudio trac-noreply at tango.0pointer.de
Mon Feb 9 12:14:21 PST 2009


#478: Fixes for build and run time problems under Mac OS X
---------------------+------------------------------------------------------
  Reporter:  Tron    |       Owner:  lennart
      Type:  defect  |      Status:  new    
  Priority:  normal  |   Milestone:         
 Component:  core    |    Severity:  normal 
Resolution:          |    Keywords:         
---------------------+------------------------------------------------------
Comment (by lennart):

 Sure, I know it's not ELF. That doesn't mean there is no equivalent for -z
 nodelete.

 Destructor functions unbfortunately are no option. We used them in the
 past and they are still used if you set $VALGRIND=1. The reason why they
 are not useful to us is that we have to deal with the case that a process
 exits while background threads that access pa structures are still
 running. The destructor functions will be called by the thread that calls
 exit() -- while the oher threads might still be running. Hence we cannot
 free all data structures they might still access. Except if we'd add a
 horrible and fragile and unportable locking logic just for this. This
 problem was exposed in the past in libcanberra  which may dynamically
 load/unload libpulse. The main program may call exit() at any time while a
 libcanberra thread might still be running. So using destructors resulted
 in segfaults in some cases. (Oh, and believe me this was hard to debug).
 The alternative, not using destructors is only viable if we have -z
 nodelete since otherwise we will leak memory each time we are pulled in
 via dlopen(). Which became very visible with libcanberra, too.

 So, I see no other option than having -z nodelete or some other similar
 option.

 Maybe it is possible to hack something based on dlopen(RTLD_NODELETE) for
 Macosx?

-- 
Ticket URL: <http://pulseaudio.org/ticket/478#comment:7>
PulseAudio <http://pulseaudio.org/>
The PulseAudio Sound Server


More information about the pulseaudio-bugs mailing list