[GHC] #8290: lookupSymbol API is unsafe

#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

#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
Date: Fri Sep 13 20:52:57 2013 -0700 Properly provide leading underscore when necessary.
Signed-off-by: Edward Z. Yang
}}} 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

#8290: lookupSymbol API is unsafe -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: task | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 7.9 (Linker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by ezyang): * component: Runtime System => Runtime System (Linker) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8290#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8290: lookupSymbol API is unsafe -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: task | Status: new Priority: low | Milestone: Component: Runtime System | Version: 7.9 (Linker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by ezyang): * priority: normal => low -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8290#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC