[MacPorts] #60702: darwintrace's tid_key/sock_key creation is not safe in the presence of other initializers

MacPorts noreply at macports.org
Tue Jun 23 10:19:31 UTC 2020


#60702: darwintrace's tid_key/sock_key creation is not safe in the presence of
other initializers
-----------------------+--------------------
 Reporter:  saagarjha  |      Owner:  (none)
     Type:  defect     |     Status:  new
 Priority:  Normal     |  Milestone:
Component:  base       |    Version:
 Keywords:  tracemode  |       Port:
-----------------------+--------------------
 darwintrace initializes its pthread keys in a library initializer in an
 attempt to ensure they are set up before any other code using them runs.
 However, this is not good enough: as darwintrace interposes standard
 library functions and library initializer order is largely indeterminate,
 this means that other constructors may run before ours does and call a
 function we interpose. This means we will use uninitialized keys; on my
 system this now causes a SIGSEGV. I have a rough patch for this but I'm
 still trying to figure out how to get MacPorts to actually compile in my
 changes to darwintrace.h/c–no matter what I do to it, configure/make seems
 to ignore my changes. If anybody has any pointers on how I can build my
 changes they would be much appreciated and likely result in a patch being
 sent :)

-- 
Ticket URL: <https://trac.macports.org/ticket/60702>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list