[GHC] #8290: lookupSymbol API is unsafe

GHC ghc-devs at haskell.org
Sat Sep 14 06:02:15 CEST 2013


#8290: lookupSymbol API is unsafe
-------------------------------------+-------------------------------------
       Reporter:  ezyang             |             Owner:
           Type:  task               |            Status:  new
       Priority:  normal             |         Milestone:
      Component:  Runtime System     |           Version:  7.7
       Keywords:                     |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple   |   Type of failure:  Documentation
     Difficulty:  Easy (less than 1  |  bug
  hour)                              |         Test Case:
     Blocked By:                     |          Blocking:
Related Tickets:                     |
-------------------------------------+-------------------------------------
 lookupSymbol is one of those functions that looks nice and innocuous on
 the tin, until you realize actually it doesn't actually do what you want,
 and seduces you into writing code that doesn't work on Mac OS X. Case in
 point, this recent test suite commit:

 {{{
 commit 29b0521cd9be39b4026103d184d1fec14ef3bc22
 Author: Edward Z. Yang <ezyang at mit.edu>
 Date:   Fri Sep 13 20:52:57 2013 -0700

     Properly provide leading underscore when necessary.

     Signed-off-by: Edward Z. Yang <ezyang at mit.edu>
 }}}

 Yes, the API is "correct" in some sense, but from a portability sense, we
 really want the function to add the underscore itself.

 If we change this particular function, we will probably break most dynamic
 loading code (including GHC's). We could also add a safe variant of the
 function. We just need to decide something to do.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8290>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list