GHC | 26 May 2013 00:37
Favicon

#7934: usleep hangs, no threads

#7934: usleep hangs, no threads
----------------------------------------+-----------------------------------
Reporter:  gelisam                      |          Owner:                
    Type:  bug                          |         Status:  new           
Priority:  normal                       |      Component:  Runtime System
 Version:  7.4.2                        |       Keywords:                
      Os:  MacOS X                      |   Architecture:  x86_64 (amd64)
 Failure:  Incorrect result at runtime  |      Blockedby:                
Blocking:                               |        Related:  1156          
----------------------------------------+-----------------------------------
 import System.Posix.Unistd
 main = flip mapM_ [0..] $ \i -> do
          usleep 100000
          print i

 ===

 The above program hangs after a variable number of iterations (usually
 around 120, sometimes up to 200, often before the first call to print).

 The documentation for usleep warns about bad interactions with threads,
 but the above program doesn't use any.

 The problem also occurs with nanosleep, but not with threadDelay.

 #1156 sounds related, but this time the problem also occurs without
 -threaded.

 ===

(Continue reading)

GHC | 25 May 2013 15:15
Favicon

#7933: JavaScript Cmm backend

#7933: JavaScript Cmm backend
-----------------------------+----------------------------------------------
Reporter:  bosu              |          Owner:                  
    Type:  feature request   |         Status:  new             
Priority:  normal            |      Component:  Compiler        
 Version:  7.6.3             |       Keywords:                  
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
 Failure:  None/Unknown      |      Blockedby:                  
Blocking:                    |        Related:                  
-----------------------------+----------------------------------------------
 I'd like to RFC on the attached patch implementing JavaScript Cmm backend
 for GHC.

 It adds -fjavascript compilation option. Calling ghc -fjavascript produces
 JS in the output file.
 Otherwise the ghc binary should be fully functional as a native compiler.
 Thus -fjavascript is
 similar to -fllvm in spirit.

 The patch adds HscJavaScript constructor to HscTarget. It is used to
 dispatch code output to
 the new JsCodeGen module.

 Generated JavaScript code relies on the built-in JS garbage collection.
 JsTransforms module
 disables GHC Hp and Sp overflow checks.

 As JavaScript has no pointers, we emulate them using JS closures
 containing arrays and indices.
 To distinguish between pointers and scalars we run Hoopl heuristics in
(Continue reading)

GHC | 25 May 2013 06:09
Favicon

#7932: haskell-src-exts should depend on happy

#7932: haskell-src-exts should depend on happy
-----------------------+----------------------------------------------------
Reporter:  JasonGross  |          Owner:                   
    Type:  bug         |         Status:  new              
Priority:  normal      |      Component:  libraries (other)
 Version:  7.4.2       |       Keywords:                   
      Os:  Linux       |   Architecture:  Unknown/Multiple 
 Failure:  Other       |      Blockedby:                   
Blocking:              |        Related:                   
-----------------------+----------------------------------------------------
 cabal-dev install haskell-src-exts-1.13.5 fails with a missing happy:

 $ cabal-dev install haskell-src-exts-1.13.5
 Resolving dependencies...
 [1 of 1] Compiling Main             ( /tmp/haskell-src-exts-1.13.5-24348
 /haskell-src-exts-1.13.5/Setup.hs, /tmp/haskell-src-exts-1.13.5-24348
 /haskell-src-ext
 s-1.13.5/dist/setup/Main.o )

 /tmp/haskell-src-exts-1.13.5-24348/haskell-src-exts-1.13.5/Setup.hs:1:1:
     Warning: In the use of `runTests'
              (imported from Distribution.Simple, but defined in
 Distribution.Simple.UserHooks):
              Deprecated: "Please use the new testing interface instead!"
 Linking /tmp/haskell-src-exts-1.13.5-24348/haskell-src-
 exts-1.13.5/dist/setup/setup ...
 Configuring haskell-src-exts-1.13.5...
 setup: The program happy version >=1.17 is required but it could not be
 found.
 Failed to install haskell-src-exts-1.13.5
(Continue reading)

GHC | 24 May 2013 19:05
Favicon

#7931: Deriving Read of an empty datatype crashes

#7931: Deriving Read of an empty datatype crashes
-----------------------------+----------------------------------------------
Reporter:  monoidal          |          Owner:                  
    Type:  bug               |         Status:  new             
Priority:  normal            |      Component:  Compiler        
 Version:  7.6.3             |       Keywords:                  
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
 Failure:  None/Unknown      |      Blockedby:                  
Blocking:                    |        Related:                  
-----------------------------+----------------------------------------------
 Standalone deriving Read of an empty datatype crashes:

 {{{
 {-# LANGUAGE StandaloneDeriving #-}
 data A
 deriving instance Read A
 }}}

 {{{
 ghc: panic! (the 'impossible' happened)
   (GHC version 7.7.20130515 for x86_64-unknown-linux):
         Prelude.foldr1: empty list

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
 }}}

 (Oddly, the "panic" message is given only by ghc, not ghci, but this is
 minor.)

 While the Read instance seems to be of little use, it can be used for
(Continue reading)

GHC | 24 May 2013 18:26
Favicon

#7930: Nested STM Invariants are lost

#7930: Nested STM Invariants are lost
----------------------------------------+-----------------------------------
Reporter:  fryguybob                    |          Owner:  fryguybob       
    Type:  bug                          |         Status:  new             
Priority:  normal                       |      Component:  Runtime System  
 Version:  7.6.3                        |       Keywords:  STM             
      Os:  Unknown/Multiple             |   Architecture:  Unknown/Multiple
 Failure:  Incorrect result at runtime  |      Blockedby:                  
Blocking:                               |        Related:                  
----------------------------------------+-----------------------------------
 Invariants from a successful nested transaction should be merged with the
 parent.

 {{{
 import Control.Concurrent
 import Control.Concurrent.STM

 main = do
     x <- atomically $
         do a <- newTVar True
            (always (readTVar a) >> retry) `orElse` return ()
            return a
     atomically (writeTVar x False) -- Should not and does not fail

     y <- atomically $
         do a <- newTVar True
            always (readTVar a) `orElse` return ()
            return a
     atomically (writeTVar y False) -- Should fail, but does not!

(Continue reading)

GHC | 24 May 2013 06:34
Favicon

#7929: -pgma and -pgmc flags dont work as expected on mac

#7929: -pgma and -pgmc flags dont work as expected on mac
-------------------------+--------------------------------------------------
Reporter:  carter        |          Owner:                
    Type:  bug           |         Status:  new           
Priority:  normal        |      Component:  Compiler      
 Version:  7.6.3         |       Keywords:                
      Os:  MacOS X       |   Architecture:  x86_64 (amd64)
 Failure:  None/Unknown  |      Blockedby:  7678          
Blocking:                |        Related:  7922,7678     
-------------------------+--------------------------------------------------
 This is a bug report version of a related ticket.

 As I discuss in
 [http://hackage.haskell.org/trac/ghc/ticket/7922#comment:23 this ticket],
 the Assembler available on the Mac OS X platform does not support AVX
 instructions, though the operating system/ platform does.

 Clang, because it uses LLVM as a backend, supports AVX, and can generate
 AVX simd ops in the  object code directly, or AVX assembly, or assemble
 assembly that uses AVX.  Clang will select AVX instructions on SandyBridge
 or newer macs when given the -march=native flag.

 There is another subtlety: the Apple Developer tools version of gcc 4.2 is
 old enough that it doesn't understand -march=native / doesn't support avx,
 and while newer versions of gcc (eg gcc 4.8), understand -march=native,
 and can choose -march=corei7-avx as appropriate (which corresponds to most
 new macs of the past 2 years), and while these newer gcc's can generate
 assembly that uses AVX instructions, these newer gcc's still seem to try
 to use the system assembler.

(Continue reading)

GHC | 24 May 2013 03:00
Favicon

#7928: GHC fails to terminate while compiling with optimizations

#7928: GHC fails to terminate while compiling with optimizations
-----------------------------+----------------------------------------------
Reporter:  Ptharien's Flame  |          Owner:                
    Type:  bug               |         Status:  new           
Priority:  normal            |      Component:  Compiler      
 Version:  7.6.3             |       Keywords:                
      Os:  Unknown/Multiple  |   Architecture:  x86_64 (amd64)
 Failure:  Other             |      Blockedby:                
Blocking:                    |        Related:                
-----------------------------+----------------------------------------------
 When I try to compile random-fu-0.2.4.0 from Hackage, using the command:

 {{{
 cabal install --ghc --ghc-options="-fllvm -O2 -dcore-lint" --enable-
 optimization=2 random-fu-0.2.4.0
 }}}

 I get the following output:

 {{{
 Resolving dependencies...
 Configuring random-fu-0.2.4.0...
 Building random-fu-0.2.4.0...
 Preprocessing library random-fu-0.2.4.0...
 [ 1 of 27] Compiling Data.Random.Internal.Find (
 src/Data/Random/Internal/Find.hs, dist/build/Data/Random/Internal/Find.o )
 [ 2 of 27] Compiling Data.Random.Internal.Fixed (
 src/Data/Random/Internal/Fixed.hs, dist/build/Data/Random/Internal/Fixed.o
 )
 [ 3 of 27] Compiling Data.Random.Internal.TH (
(Continue reading)

GHC | 24 May 2013 01:13
Favicon

#7927: Error in 'lift' line causes the 'impossible' to happen

#7927: Error in 'lift' line causes the 'impossible' to happen
-------------------------------+--------------------------------------------
Reporter:  MitchellSalad       |          Owner:                
    Type:  bug                 |         Status:  new           
Priority:  normal              |      Component:  Compiler      
 Version:  7.6.3               |       Keywords:                
      Os:  Linux               |   Architecture:  x86_64 (amd64)
 Failure:  Compile-time crash  |      Blockedby:                
Blocking:                      |        Related:                
-------------------------------+--------------------------------------------
 import Control.Monad.Trans.Class (lift)
 import Control.Monad.Trans.Maybe (MaybeT)

 foo :: MaybeT IO ()
 foo = lift putStrLn "foo"

 --------

 This code caused the following output from GHC:

 Couldn't match kind `* -> *' with `*'
     Expected type: [Char] -> MaybeT IO ()
       Actual type: [Char] -> MaybeT IO ()
     Kind incompatibility when matching types:
       [Char] :: * -> *
       [Char] :: *
     The function `lift'ghc: panic! (the 'impossible' happened)
   (GHC version 7.6.3 for x86_64-unknown-linux):
         kindFunResult
 <<details unavailable>>
(Continue reading)

GHC | 23 May 2013 00:42
Favicon

#7926: eventfd: unsupported operation when doing anything

#7926: eventfd: unsupported operation when doing anything
--------------------------+-------------------------------------------------
Reporter:  guest          |          Owner:                
    Type:  bug            |         Status:  new           
Priority:  normal         |      Component:  Compiler      
 Version:  7.6.3          |       Keywords:                
      Os:  Linux          |   Architecture:  x86_64 (amd64)
 Failure:  Runtime crash  |      Blockedby:                
Blocking:                 |        Related:                
--------------------------+-------------------------------------------------
 I'm using Debian jessie; sources.list is thus:

 {{{deb http://ftp.us.debian.org/debian jessie main contrib non-free}}}

 Ran apt-get upgrade 10 minutes ago. The contents of
 /var/log/apt/history.log (sorry for the massive list, not sure how to
 narrow it down): https://gist.github.com/joelteon/07c912a3e7e49be820cc

 ghc/ghci output (exit 1):

 {{{eventfd: unsupported operation (Function not implemented)}}}

 When launching a precompiled executable, the first time it executes an I/O
 action (exit 1):

 {{{hClose: user error (Pattern match failure in do expression at
 libraries/base/GHC/Event/Thread.hs:84:3-10}}}

 `strace ghci` output is in this gist:
 https://gist.github.com/anonymous/dcc02c8b29a65ec49be6
(Continue reading)

GHC | 22 May 2013 23:10
Favicon

#7925: ghc 7.4.2 builds with errors on Red Had Enterprise Linux 6

#7925: ghc 7.4.2 builds with errors on Red Had Enterprise Linux 6
-------------------+--------------------------------------------------------
Reporter:  nr      |          Owner:                  
    Type:  bug     |         Status:  new             
Priority:  normal  |      Component:  Compiler        
 Version:  7.4.2   |       Keywords:                  
      Os:  Linux   |   Architecture:  Unknown/Multiple
 Failure:  Other   |      Blockedby:                  
Blocking:          |        Related:                  
-------------------+--------------------------------------------------------
 GHC 7.4.2 builds on RHEL 6, but with three test failures.  None of these
 errors are show-stopping, and we seem to have a good Haskell Platform now
 built on top, but since 7.4.2 is a numbered release, the failures were
 unexpected, so I am reporting them.
 {{{
 >   >  Unexpected failures:
 >   >      lib/Time                  T5430 [bad stdout] (normal)
 >   >      perf/compiler             parsing001 [stat not good enough]
 (normal)
 >   >      simplCore/should_compile  spec-inline [stderr mismatch]
 (optasm)
 }}}

--

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7925>
GHC | 22 May 2013 15:40
Favicon

#7924: throwIO gets subsumed by a later imprecise exception

#7924: throwIO gets subsumed by a later imprecise exception
-----------------------------+----------------------------------------------
Reporter:  dmwit             |          Owner:                  
    Type:  bug               |         Status:  new             
Priority:  normal            |      Component:  Compiler        
 Version:  7.6.1             |       Keywords:                  
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
 Failure:  None/Unknown      |      Blockedby:                  
Blocking:                    |        Related:                  
-----------------------------+----------------------------------------------
 The code below exits with exception "Boom" when compiled with no options
 (the expected behavior, since throwIO should always subsume exceptions
 that come later in the IO monad), but with a head-of-empty-list exception
 when compiled with -O. Similar code has shown this problem on 7.2 and 7.4.

 {{{
 {-# LANGUAGE DeriveDataTypeable #-}
 import Control.Exception (throwIO, Exception)
 import Control.Monad (when)
 import Data.Typeable (Typeable)

 data Boom = Boom deriving (Show, Typeable)
 instance Exception Boom

 main = do
     args <- return []

     -- Should throw this exception.
     when (length args /= 1) (throwIO Boom)

(Continue reading)


Gmane