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,260
    • Issues 4,260
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 398
    • Merge Requests 398
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #14074

Closed
Open
Opened Aug 01, 2017 by Ben Gamari@bgamari🐢Maintainer

fdReadBuf001 fails non-deterministically on FreeBSD

With this patch to libraries/unix,

diff --git a/tests/fdReadBuf001.hs b/tests/fdReadBuf001.hs
index 4c121a2..f987c94 100644
--- a/tests/fdReadBuf001.hs
+++ b/tests/fdReadBuf001.hs
@@ -21,7 +21,7 @@ main = do
            r <- fdReadBuf rd p block
            let (chunk,rest) = splitAt (fromIntegral r) text
            chars <- peekArray (fromIntegral r) p
-           when (chars /= chunk) $ error "mismatch"
+           when (chars /= chunk) $ error $ "mismatch: expected="++show chunk++", found="++show chars
            when (null rest) $ exitWith ExitSuccess
            loop rest
     loop bytes

fdReadBuf001 sometimes fails under the ghci way on FreeBSD 11.0 with something like,

=====> fdReadBuf001(ghci) 1 of 1 [0, 0, 0]
cd "../../libraries/unix/tests/fdReadBuf001.run" && "/home/ben/ghc-8.2.1/bin/ghc" fdReadBuf001.hs -dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -dno-debug-output  --interactive -v0 -ignore-dot-ghci -fno-ghci-history +RTS -I0.1 -RTS -package unix< fdReadBuf001.genscript
Wrong exit code for fdReadBuf001(ghci) (expected 0 , actual 1 )
Stderr ( fdReadBuf001 ):
fdReadBuf001: mismatch: expected=[101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112], found=[168,149,144,14,8,0,0,0,58,1,0,0,0,0,0,0,32,228,123,10,8,0,0,0,200,149,144,14,8,0,0,0,0,150,144,14,8,0,0,0,96,127,174,10,8,0,0,0,33,152,144,14,8,0,0,0,0,150,144,14,8,0,0,0,42,0,0,0,0,0,0,0,96,127,174,10,8,0,0,0,162,21,74,13,8,0,0,0,56,150,144,14,8,0,0,0,96,127,174,10,8,0,0,0,10,152,144,14,8,0,0,0,56,150,144,14,8,0,0,0,32,228,123,10,8,0,0,0,200,149,144,14,8,0,0,0,112,150,144,14,8,0,0,0,112,209,123,10,8,0,0,0,138,150,144,14,8,0,0,0,88,150,144,14,8,0,0,0,96,127,174,10,8,0,0,0,249,150,144,14,8,0,0,0,48,187,247,9,8,0,0,0,129,223,208,10,8,0,0,0,96,127,174,10,8,0,0,0,9,151,144,14,8,0,0,0,16,46,250,9,8,0,0,0,184,150,144,14,8,0,0,0,224,227,123,10,8,0,0,0,111,0,0,0,0,0,0,0,8,246,255,9,8,0,0,0,111,0,0,0,0,0,0,0,224,0,194,9,8,0,0,0]
CallStack (from HasCallStack):
  error, called at fdReadBuf001.hs:24:36 in main:Main
Trac metadata
Trac field Value
Version 8.2.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#14074