summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@well-typed.com>2021-01-02 23:26:31 -0500
committerBen Gamari <ben@smart-cactus.org>2021-01-03 17:52:32 -0500
commita7105e53921e715d4d70c7c45ddc79bdc6eebffc (patch)
tree0c747d75f2a6e352b91dfdab67e7b7ed381324c3
parenta8926e951eed83a34d39ddaad409ba685b21b38a (diff)
downloadhaskell-wip/T19155.tar.gz
rts/PEi386: Fix reentrant lock usagewip/T19155
Previously lookupSymbol_PEi386 would call lookupSymbol while holding linker_mutex. Fix this by rather calling `lookupDependentSymbol`. This is safe because lookupSymbol_PEi386 unconditionally holds linker_mutex. Happily, this un-breaks `T12771`, `T13082_good`, and `T14611`, which were previously marked as broken due to #18718. Closes #19155.
-rw-r--r--rts/linker/PEi386.c2
-rw-r--r--testsuite/tests/rts/T12771/all.T1
-rw-r--r--testsuite/tests/rts/T13082/all.T1
-rw-r--r--testsuite/tests/rts/T14611/all.T1
4 files changed, 1 insertions, 4 deletions
diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c
index 917a641310..9f13b4ce3d 100644
--- a/rts/linker/PEi386.c
+++ b/rts/linker/PEi386.c
@@ -2064,7 +2064,7 @@ SymbolAddr *lookupSymbol_PEi386(SymbolName *lbl)
else if (pinfo && pinfo->owner && isSymbolImport (pinfo->owner, lbl))
{
/* See Note [BFD import library]. */
- HINSTANCE dllInstance = (HINSTANCE)lookupSymbol(pinfo->value);
+ HINSTANCE dllInstance = (HINSTANCE)lookupDependentSymbol(pinfo->value, NULL);
if (!dllInstance && pinfo->value)
return pinfo->value;
diff --git a/testsuite/tests/rts/T12771/all.T b/testsuite/tests/rts/T12771/all.T
index 347c81b04e..55ada90cb3 100644
--- a/testsuite/tests/rts/T12771/all.T
+++ b/testsuite/tests/rts/T12771/all.T
@@ -1,5 +1,4 @@
test('T12771',
[extra_files(['foo.c', 'main.hs', 'foo_dll.c']),
- expect_broken(18718),
unless(opsys('mingw32'), skip)],
makefile_test, ['T12771'])
diff --git a/testsuite/tests/rts/T13082/all.T b/testsuite/tests/rts/T13082/all.T
index 70582b250c..8219127051 100644
--- a/testsuite/tests/rts/T13082/all.T
+++ b/testsuite/tests/rts/T13082/all.T
@@ -16,7 +16,6 @@ def normalise_search_dirs (str):
#--------------------------------------
test('T13082_good',
[extra_files(['foo.c', 'main.hs', 'foo_dll.c']),
- expect_broken(18718),
unless(opsys('mingw32'), skip)],
makefile_test, ['T13082_good'])
diff --git a/testsuite/tests/rts/T14611/all.T b/testsuite/tests/rts/T14611/all.T
index 9077e0bbda..ef7873ce16 100644
--- a/testsuite/tests/rts/T14611/all.T
+++ b/testsuite/tests/rts/T14611/all.T
@@ -1,5 +1,4 @@
test('T14611',
[extra_files(['foo.c', 'main.hs', 'foo_dll.c']),
- expect_broken(18718),
unless(opsys('mingw32'), skip)],
makefile_test, ['T14611'])