Repository navigation
Conversation
phadej
reviewed
Jan 4, 2023
| @@ -763,7 +769,15 @@ hashThreadId (ThreadId t) = hash (fromIntegral (getThreadId t) :: Int) | |||
|
|
|||
| -- this cannot be capi, as GHC panics. | |||
| foreign import ccall unsafe "rts_getThreadId" getThreadId | |||
Contributor
There was a problem hiding this comment.
is rts_getThreadId exported from some header? Could you change that to ccall to capi (with CApiFFI).
Contributor
There was a problem hiding this comment.
Ah, crap. It cannot be capi as GHC panics, but does even GHC-9.4 panic still? It does :( https://gitlab.haskell.org/ghc/ghc/-/issues/22705
Contributor
Author
There was a problem hiding this comment.
If I change it to capi, I get
ghc: panic! (the 'impossible' happened)
(GHC version 9.2.4:
toCType
ThreadId#
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/GHC/Utils/Panic.hs:181:37 in ghc:GHC.Utils.Panic
pprPanic, called at compiler/GHC/HsToCore/Foreign/Decl.hs:763:17 in ghc:GHC.HsToCore.Foreign.Decl
which seems to be consistent with the comment
hashable/src/Data/Hashable/Class.hs
Line 764 in 18138a1
you added in #213.
netbsd-srcmastr
pushed a commit
to NetBSD/pkgsrc
that referenced
this pull request
Jan 25, 2023
Version 1.4.2.0 * Fix the foreign signature of getThreadId haskell-unordered-containers/hashable#263 * Drop support for GHCs prior GHC-8.2 The recent unordered-containers releases support only GHC-8.2+ * Add instance for OsString, PosixString, WindowsString from filepath-1.4.100.1 * Add Hashable ByteArray instance using data-array-byte compat package
msk
pushed a commit
to msk/pkgsrc
that referenced
this pull request
May 11, 2026
Version 1.4.2.0 * Fix the foreign signature of getThreadId haskell-unordered-containers/hashable#263 * Drop support for GHCs prior GHC-8.2 The recent unordered-containers releases support only GHC-8.2+ * Add instance for OsString, PosixString, WindowsString from filepath-1.4.100.1 * Add Hashable ByteArray instance using data-array-byte compat package
jperkin
pushed a commit
to TritonDataCenter/pkgsrc
that referenced
this pull request
May 14, 2026
Version 1.4.2.0 * Fix the foreign signature of getThreadId haskell-unordered-containers/hashable#263 * Drop support for GHCs prior GHC-8.2 The recent unordered-containers releases support only GHC-8.2+ * Add instance for OsString, PosixString, WindowsString from filepath-1.4.100.1 * Add Hashable ByteArray instance using data-array-byte compat package
tsutsui
pushed a commit
to tsutsui/pkgsrc
that referenced
this pull request
Oct 17, 2026
Version 1.4.2.0 * Fix the foreign signature of getThreadId haskell-unordered-containers/hashable#263 * Drop support for GHCs prior GHC-8.2 The recent unordered-containers releases support only GHC-8.2+ * Add instance for OsString, PosixString, WindowsString from filepath-1.4.100.1 * Add Hashable ByteArray instance using data-array-byte compat package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found via the GHC WASM backend: https://gitlab.haskell.org/ghc/ghc/-/issues/22617#note_470653
Also see https://hackage-search.serokell.io/?q=rts_getThreadId for other packages doing the same thing.