Opened 5 years ago

Closed 5 years ago

#9333 closed bug (fixed)

Thread status decoded wrong in base library

Reported by: jberthold Owned by: jberthold
Priority: normal Milestone: 7.10.1
Component: libraries/base Version: 7.8.3
Keywords: Cc: simonmar, ezyang, hvr, ekmett, jberthold
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect result at runtime Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D83
Wiki Page:

Description

Kyle Van Berendonck <kvanberendonck@…> in a message on ghc-devs pointed to base/GHC/Conc/Sync.lhs decoding thread block reasons from constants defined in includes/rts/Constants.h to a Haskell type.

The constants were modified in GHC-7.8.2, which created problems with eventlogs (ticket #9003), so the constants were reverted, but base was not adapted to the respective fix.

Attachments (3)

ghc9333-test (2.7 KB) - added by jberthold 5 years ago.
test program and output for ghc-7.6.3 and 7.8.3
0001-use-GHC-7.8.3-s-values-for-thread-block-reason.libraries_base.patch (2.1 KB) - added by jberthold 5 years ago.
Patch for base library going with GHC-7.8.3
T9333.hs (1.1 KB) - added by jberthold 5 years ago.
simplified test program, will be included in HEAD testsuite

Download all attachments as: .zip

Change History (10)

comment:1 Changed 5 years ago by jberthold

Cc: jberthold added

Changed 5 years ago by jberthold

Attachment: ghc9333-test added

test program and output for ghc-7.6.3 and 7.8.3

comment:2 Changed 5 years ago by carter

the 7.8 version is here https://github.com/ghc/packages-base/blob/ghc-7.8/GHC/Conc/Sync.lhs#L484-L495

(looks like it was last touched fall 2013 )

Changed 5 years ago by jberthold

Patch for base library going with GHC-7.8.3

Changed 5 years ago by jberthold

Attachment: T9333.hs added

simplified test program, will be included in HEAD testsuite

comment:3 Changed 5 years ago by jberthold

@Carter: Yes, fall 2013 was when the block reason codes were extended. This bug is related to #9003 (modified block reason codes), the respective fix should have changed base back to what it was before (and adding a new case for 14).

I have put together a fix and a small test for this. Taking this as an opportunity to set up the phabricator environment, I submitted the fix there (Phab:D83) for HEAD. The respective fix for ghc-7.8.3 will be in libraries/base (separate), a patch is attached (as well as the test case Haskell code).

Last edited 5 years ago by jberthold (previous) (diff)

comment:4 Changed 5 years ago by jberthold

Differential Rev(s): D83
Owner: set to jberthold

comment:5 Changed 5 years ago by jberthold

Differential Rev(s): D83Phab:D83
Status: newpatch

comment:6 Changed 5 years ago by Austin Seipp <austin@…>

In 4ee8c27302e6bb3892e7c47a7111b0683d032c07/ghc:

use GHC-7.8.3's values for thread block reason (fixes #9333)

Summary:
For now, BlockedOnMVar and BlockedOnMVarRead are not distinguished.
Making the distinction would mean to change an exported datatype
(API change). Code for this change is included but commented out.

The patch adds a test for the threadstatus, which retrieves status
BlockedOnMVar for two threads blocked on writing and reading an MVar.

Test Plan: ran validate, including the new test

Reviewers: simonmar, austin, ezyang

Reviewed By: austin, ezyang

Subscribers: phaskell, simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D83

comment:7 Changed 5 years ago by thoughtpolice

Milestone: 7.10.1
Resolution: fixed
Status: patchclosed

Merged, thanks!

Note: See TracTickets for help on using tickets.