[GHC] #8290: lookupSymbol API is unsafe
GHC
ghc-devs at haskell.org
Wed Sep 24 15:45:20 UTC 2014
#8290: lookupSymbol API is unsafe
-------------------------------------+-------------------------------------
Reporter: ezyang | Owner:
Type: task | Status: new
Priority: normal | Milestone:
Component: Runtime | Version: 7.9
System | Keywords:
Resolution: | Architecture: Unknown/Multiple
Operating System: | Difficulty: Easy (less than 1
Unknown/Multiple | hour)
Type of failure: | Blocked By:
Documentation bug | Related Tickets:
Test Case: |
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
Changes (by thomie):
* cc: simonmar (added)
* version: 7.7 => 7.9
Old description:
> 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.
New description:
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 02d4958903e967b78fc3bbceddc2ce8ce33901c0
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.
--
Comment:
Link to mentioned commit: 02d4958903e967b78fc3bbceddc2ce8ce33901c0.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8290#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list