summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@well-typed.com>2021-01-02 23:26:31 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-01-09 21:22:14 -0500
commitf6b843cd44fd0170af06f52f2e1d25908184aabb (patch)
treef2140bec0d302a5f26a245c695f41a686112662f
parentd1b9d679459bcdca064d3049cc76db50c625b1a1 (diff)
downloadhaskell-f6b843cd44fd0170af06f52f2e1d25908184aabb.tar.gz
rts/PEi386: Fix reentrant lock usage
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'])