Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,386
    • Issues 4,386
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 371
    • Merge Requests 371
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #13599

Closed
Open
Opened Apr 20, 2017 by Ben Gamari@bgamari🐢Maintainer

Something is fishy in Windows hLock implementation

Ever since we merged the package database locking patch (#13194) I have suspected that something isn't quite right in the locking logic on Windows. The first suspicious sign is that we had to limit the locking range (7e273ea2) due to mysterious ERROR_LOCK_INVALID_RANGE errors on Harbormaster. While the fix in 7e273ea2 seemed to make the issue disappear, we never were able to pin down the issue.

However, now I'm seeing the ERROR_LOCK_INVALID_RANGE issue once again on my local Windows during binary-dist-prep. In particular, it binary-dist-prep seems to reliably fail while registering the compiler directory. Watching the system calls performed by ghc-pkg with procmon suggests that the issue is a negative offset being passed to LockFile. Moreover, LockFile calls from previous ghc-pkg invocations show other, apparently random offset values being passed. The offset is passed to LockFileEx (the interface used by our hLock implementation) via an OVERLAPPED structure, which we locally allocate and zero prior to the LockFileEx call. I still haven't worked out where these random values are coming from.

Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority highest
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC arybczak
Operating system
Architecture
Assignee
Assign to
8.2.1
Milestone
8.2.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#13599