Re: [GHC] #7062: Spurious undefined reference to `openpty'

2012-07-25 Thread GHC
#7062: Spurious undefined reference to `openpty'
-+--
Reporter:  simonmar  |   Owner:  
Type:  bug   |  Status:  merge   
Priority:  high  |   Milestone:  7.4.3   
   Component:  Compiler  | Version:  7.4.2   
Keywords:|  Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  | Failure:  None/Unknown
  Difficulty:  Unknown   |Testcase:  
   Blockedby:|Blocking:  
 Related:|  
-+--

Comment(by nus):

 Replying to [comment:8 trommler]:
 > Replying to [comment:7 simonmar]:
 > > @trommler does the patch fix it for you?
 > Yes, it fixes the linker issue.
 >
 > The test, however, still fails for me. Now libHSunix*.so cannot be
 found:
 >
 > {{{
 > => process001(dyn) 1 of 13 [0, 0, 0]
 > cd . && '/local/home/peter/ghc-HEAD-validate/inplace/bin/ghc-stage2'
 -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-
 db -rtsopts  -fno-ghci-history -o process001 process001.hs -O -dynamic
 >process001.comp.stderr 2>&1
 > cd . && ./process001process001.run.stdout
 2>process001.run.stderr
 > Wrong exit code (expected 0 , actual 127 )
 > Stdout:
 >
 > Stderr:
 > ./process001: error while loading shared libraries:
 libHSunix-2.5.1.0-ghc7.5.20120713.so: cannot open shared object file: No
 such file or directory
 > }}}
 I'm not sure what's going on with that build. After applying
 
http://hackage.haskell.org/trac/ghc/changeset/301b37255fb9ea3abd634cf9caf774c6dab647b7
 to the pristine ghc-7.4.2 sources the `process001(dyn)` test from the
 7.4.2 testsuite finishes OK here.
 > This matches nus' results with readelf above. In number 2) note that
 libHSunix... is missing in {{{readelf -d process001}}} output. That means
 the Rpath to libHSunix... is also not included in process001 and hence the
 "No such file or directory."
 Perhaps you're checking a different executable? Here RPATH of the produced
 executable has the path to the directory containing `HSunix`:
 {{{
 $ cd ~/dev/ghc-7.4.2/libraries/process/tests
 $ /home/user/dev/ghc-7.4.2/inplace/bin/ghc-stage2 -fforce-recomp -dcore-
 lint -dcmm-lint -dno-debug-output -no-user-package-conf -rtsopts  -fno-
 ghci-history -o process001 process001.hs -O -dynamic
 [1 of 1] Compiling Main ( process001.hs, process001.o )
 Linking process001 ...
 $ readelf -d process001
 Dynamic section at offset 0x2d98 contains 25 entries:
   TagType Name/Value
  0x0001 (NEEDED) Shared library:
 [libHSprocess-1.1.0.1-ghc7.4.2.so]
  0x0001 (NEEDED) Shared library:
 [libHSbase-4.5.1.0-ghc7.4.2.so]
  0x0001 (NEEDED) Shared library: [libHSghc-
 prim-0.2.0.0-ghc7.4.2.so]
  0x0001 (NEEDED) Shared library: [libHSrts-
 ghc7.4.2.so]
  0x0001 (NEEDED) Shared library: [libc.so.6]
  0x000f (RPATH)  Library rpath:
 [/home/user/dev/ghc-7.4.2/libraries/process/dist-
 install/build:/home/user/dev/ghc-7.4.2/libraries/directory/dist-
 install/build:/home/user/dev/ghc-7.4.2/libraries/unix/dist-
 install/build:/home/user/dev/ghc-7.4.2/libraries/bytestring/dist-
 install/build:/home/user/dev/ghc-7.4.2/libraries/old-time/dist-
 install/build:/home/user/dev/ghc-7.4.2/libraries/old-locale/dist-
 install/build:/home/user/dev/ghc-7.4.2/libraries/filepath/dist-
 install/build:/home/user/dev/ghc-7.4.2/libraries/base/dist-
 install/build:/home/user/dev/ghc-7.4.2/libraries/integer-gmp/dist-
 install/build:/home/user/dev/ghc-7.4.2/libraries/ghc-prim/dist-
 install/build:/home/user/dev/ghc-7.4.2/rts/dist/build]
 [...snip...]
 }}}

 From the libraries involved in the link, produced after applying the
 patch, `HSprocess`, `HSdirectory`, `HSunix`, only `HSunix` and
 `HSdirectory` have changed their DT_NEEDED tags in the dynamic sections,
 `HSprocess` remains same.
 {{{
 --- non-patched-elf-HSdirectory.so  2012-07-26 07:20:31.783083933
 +0400
 +++ patched-elf-HSdirectory.so  2012-07-26 09:26:01.773447158 +0400
 @@ -1,9 +1,7 @@

 -Dynamic section at offset 0x1a9e8 contains 30 entries:
 +Dynamic section at offset 0x1aa08 contains 28 entries:
TagType Name/Value
   0x0001 (NEEDED) Shared library:
 [libHSunix-2.5.1.1-ghc7.4.2.so]
 - 0x0001 (NEEDED) Shared library: [libutil.so.1]
 - 0x0001 (NEEDED) Shared library: [libdl.so.2]
 [...snip...]
 }}}
 {{{
 --- non-patched-elf-HSunix.so   2012-07-26 07:20:27.843084217 +0400
 +++ patched-elf-HSunix.so   2012-07-26 09:25:44.133448671 +0400
 @@ -1,6 +1,9 @@

 -Dynamic section at offset 0xb1798 contains 26

[GHC] #7098: GHC 7.4.1 reports an internal error and core dumps while using DPH

2012-07-25 Thread GHC
#7098: GHC 7.4.1 reports an internal error and core dumps while using DPH
--+-
 Reporter:  Prasanna  |  Owner:  
 Type:  bug   | Status:  new 
 Priority:  normal|  Component:  Compiler
  Version:  7.4.1 |   Keywords:  DPH 
   Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
  Failure:  None/Unknown  |   Testcase:  
Blockedby:|   Blocking:  
  Related:|  
--+-
 While compiling a DPH program I got the following error,

 Main: internal error: allocGroup: requested zero blocks
 (GHC version 7.4.1 for i386_unknown_linux)
 Please report this as a GHC bug:
 http://www.haskell.org/ghc/reportabug
 Aborted (core dumped)

 I have attached the code files that I was using.

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler

___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #7062: Spurious undefined reference to `openpty'

2012-07-25 Thread GHC
#7062: Spurious undefined reference to `openpty'
-+--
Reporter:  simonmar  |   Owner:  
Type:  bug   |  Status:  merge   
Priority:  high  |   Milestone:  7.4.3   
   Component:  Compiler  | Version:  7.4.2   
Keywords:|  Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  | Failure:  None/Unknown
  Difficulty:  Unknown   |Testcase:  
   Blockedby:|Blocking:  
 Related:|  
-+--

Comment(by nus):

 Replying to [comment:7 simonmar]:
 > I still don't understand what was going wrong, and I'm afraid your
 explanation doesn't clarify things for me.  The problem I encountered is
 that we had a link line like
 >
 {{{
   ... -lHSprocess -lHSunix -lutil ...
 }}}
 >
 > where `libHSprocess` depends on `libHSunix` which depends on `1libutil`.
 But the linker reported a missing symbol `openpty` that is undefined in
 `libHSunix` and defined in `libutil`.

 The sequence is
 {{{ ... -lHSprocess -lHSdirectory -lHSunix -lutil ... }}}
 Both 'HSprocess' and 'HSdirectory' depend on 'HSunix' which has 'openpty'
 undefined. With '--as-needed' only the first encounter of undefined
 'openpty' gets satisfied from libutil.

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler

___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #7087: 'select' fails for very large arguments to 'threadDelay'

2012-07-25 Thread GHC
#7087: 'select' fails for very large arguments to 'threadDelay'
+---
  Reporter:  Gabriel439 |  Owner:
  Type:  bug| Status:  closed
  Priority:  normal |  Milestone:  7.6.1 
 Component:  Compiler   |Version:  7.4.1 
Resolution:  duplicate  |   Keywords:  threadDelay select
Os:  Linux  |   Architecture:  x86_64 (amd64)
   Failure:  Runtime crash  | Difficulty:  Unknown   
  Testcase: |  Blockedby:
  Blocking: |Related:  #6019 
+---
Changes (by pcapriotti):

  * status:  new => closed
  * difficulty:  => Unknown
  * resolution:  => duplicate
  * related:  => #6019
  * milestone:  => 7.6.1


Comment:

 Thanks for the report. This is fixed in HEAD. See #6019.

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler

___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


[GHC] #7097: linker fails to load package with binding to foreign library

2012-07-25 Thread GHC
#7097: linker fails to load package with binding to foreign library
--+-
 Reporter:  nus   |  Owner:
 Type:  bug   | Status:  new   
 Priority:  normal|  Component:  Runtime System
  Version:  7.4.2 |   Keywords:
   Os:  Windows   |   Architecture:  x86   
  Failure:  None/Unknown  |   Testcase:
Blockedby:|   Blocking:
  Related:|  
--+-
 GHCI is unable to load 'network' package on Windows. The versions:
 {{{
 $ ghci --version
 The Glorious Glasgow Haskell Compilation System, version 7.4.2
 }}}
 {{{
 $ ghc-pkg list network
 c:/mnt/data1/ghc32b\lib\package.conf.d:
 network-2.3.0.14
 }}}

 The test code:
 {{{
 import Network

 main = withSocketsDo $ do listenOn (PortNumber ) -- >>= accept
 }}}

 The failure:
 {{{
 > ghci winsock-load-failure.hs
 GHCi, version 7.4.2: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 [1 of 1] Compiling Main ( winsock-crash.hs, interpreted )
 Ok, modules loaded: Main.
 *Main> main
 Loading package bytestring-0.9.2.1 ... linking ... done.
 Loading package transformers-0.3.0.0 ... linking ... done.
 Loading package mtl-2.1.2 ... linking ... done.
 Loading package array-0.4.0.0 ... linking ... done.
 Loading package deepseq-1.3.0.0 ... linking ... done.
 Loading package text-0.11.2.2 ... linking ... done.
 Loading package parsec-3.1.3 ... linking ... done.
 Loading package network-2.3.0.14 ... linking ... :
 C:\mnt\data1\ghc32b\network-2.3.0.14\ghc-7.4.2\HSnetwork-2.3.0.14.o:
 unknown symbol `__imp__WSACleanup'
 ghc.exe: unable to load package `network-2.3.0.14'
 }}}

 The load trace log ('+RTS -Dl'):
 {{{
 [...snip...]
 lookupSymbol: looking up __imp__WSACleanup@0
 initLinker: start
 initLinker: idempotent return
 lookupSymbol: symbol not found
 :
 C:\mnt\data1\ghc32b\network-2.3.0.14\ghc-7.4.2\HSnetwork-2.3.0.14.o:
 unknown symbol `__imp__WSACleanup'
 [...snip...]
 }}}

 The symbol to be resolved:
 {{{
 $ nm network-2.3.0.14/ghc-7.4.2/HSnetwork-2.3.0.14.o |grep WSACleanup
  U __imp__WSACleanup@0
 }}}

 The actual symbol in the foreign library:
 {{{
 $ objdump -p  /c/Windows/System32/ws2_32.dll
 c:/Windows/System32/ws2_32.dll: file format pei-i386
 [...snip...]
 [Ordinal/Name Pointer] Table
 [...snip...]
 [ 115] WSACleanup
 [...snip...]
 }}}

 The test snippet only works when compiled by ghc (so the resulting binary
 is produced by ld.bfd).

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler

___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


[GHC] #7096: linker fails to load package with binding to foreign library

2012-07-25 Thread GHC
#7096: linker fails to load package with binding to foreign library
--+-
 Reporter:  nus   |  Owner:
 Type:  bug   | Status:  new   
 Priority:  normal|  Component:  Runtime System
  Version:  7.4.2 |   Keywords:
   Os:  Windows   |   Architecture:  x86   
  Failure:  None/Unknown  |   Testcase:
Blockedby:|   Blocking:
  Related:|  
--+-
 GHCI is unable to load 'network' package on Windows. The versions:
 {{{
 $ ghci --version
 The Glorious Glasgow Haskell Compilation System, version 7.4.2
 }}}
 {{{
 $ ghc-pkg list network
 c:/mnt/data1/ghc32b\lib\package.conf.d:
 network-2.3.0.14
 }}}

 The test code:
 {{{
 import Network

 main = withSocketsDo $ do listenOn (PortNumber ) -- >>= accept
 }}}

 The failure:
 {{{
 > ghci winsock-load-failure.hs
 GHCi, version 7.4.2: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 [1 of 1] Compiling Main ( winsock-crash.hs, interpreted )
 Ok, modules loaded: Main.
 *Main> main
 Loading package bytestring-0.9.2.1 ... linking ... done.
 Loading package transformers-0.3.0.0 ... linking ... done.
 Loading package mtl-2.1.2 ... linking ... done.
 Loading package array-0.4.0.0 ... linking ... done.
 Loading package deepseq-1.3.0.0 ... linking ... done.
 Loading package text-0.11.2.2 ... linking ... done.
 Loading package parsec-3.1.3 ... linking ... done.
 Loading package network-2.3.0.14 ... linking ... :
 C:\mnt\data1\ghc32b\network-2.3.0.14\ghc-7.4.2\HSnetwork-2.3.0.14.o:
 unknown symbol `__imp__WSACleanup'
 ghc.exe: unable to load package `network-2.3.0.14'
 }}}

 The load trace log ('+RTS -Dl'):
 {{{
 [...snip...]
 lookupSymbol: looking up __imp__WSACleanup@0
 initLinker: start
 initLinker: idempotent return
 lookupSymbol: symbol not found
 :
 C:\mnt\data1\ghc32b\network-2.3.0.14\ghc-7.4.2\HSnetwork-2.3.0.14.o:
 unknown symbol `__imp__WSACleanup'
 [...snip...]
 }}}

 The symbol to be resolved:
 {{{
 $ nm network-2.3.0.14/ghc-7.4.2/HSnetwork-2.3.0.14.o |grep WSACleanup
  U __imp__WSACleanup@0
 }}}

 The actual symbol in the foreign library:
 {{{
 $ objdump -p  /c/Windows/System32/ws2_32.dll
 c:/Windows/System32/ws2_32.dll: file format pei-i386
 [...snip...]
 [Ordinal/Name Pointer] Table
 [...snip...]
 [ 115] WSACleanup
 [...snip...]
 }}}

 The test snippet only works when compiled by ghc (so the resulting binary
 is produced by ld.bfd).

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler

___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #6104: Regression: space leak in HEAD vs. 7.4

2012-07-25 Thread GHC
#6104: Regression: space leak in HEAD vs. 7.4
-+--
Reporter:  simonmar  |   Owner:  igloo   
Type:  bug   |  Status:  merge   
Priority:  highest   |   Milestone:  7.6.1   
   Component:  Compiler  | Version:  7.5 
Keywords:|  Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  | Failure:  Compile-time performance bug
  Difficulty:  Unknown   |Testcase:  
   Blockedby:|Blocking:  
 Related:|  
-+--
Changes (by pcapriotti):

  * status:  new => merge


Comment:

 Residency is now only 25% bigger in HEAD. Closing.

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler

___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


[GHC] #7095: Kind-polymorphic typechecking requires better documentation.

2012-07-25 Thread GHC
#7095: Kind-polymorphic typechecking requires better documentation.
--+-
 Reporter:  schernichkin  |  Owner:   
 Type:  feature request   | Status:  new  
 Priority:  normal|  Component:  Documentation
  Version:  7.4.2 |   Keywords:  Kind polymorphism
   Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple 
  Failure:  None/Unknown  |   Testcase:   
Blockedby:|   Blocking:   
  Related:|  
--+-
 Hi. I faced some difficulties using kind-polymorphic instances and I think
 documentation should be improved. Consider following code:

 {{{
 {-# LANGUAGE DataKinds, TypeOperators, PolyKinds, FlexibleInstances,
 FlexibleContexts #-}

 data Wrapped t = Wrapped

 class Len l where
 len :: l -> Int

 instance Len (Wrapped '[]) where
 len = const 0

 instance (Len (Wrapped xs)) => Len (Wrapped (x ': xs)) where
 len x = 1 + (len $ wrappedTail x)

 wrappedTail :: Wrapped (x ': xs) -> Wrapped xs
 wrappedTail = const Wrapped

 -- | test1 == zero just as excepted.
 test1 = len (undefined  :: Wrapped '[])

 -- | Since I have typeclasses defined for Wrapped (* ': [*]) and for
 (Wrapped '[])
 -- I except to get 1 here, but this does not typecheck with following
 message:
 -- No instance for (Len (Wrapped [*] ([] *)))
 test2 = len (undefined  :: Wrapped '[Int])
 }}}

 It will not typecheck. Of couse it is possible to fix it by adding type
 signature to Wrapped:

 {{{
 {-# LANGUAGE DataKinds, TypeOperators, PolyKinds, FlexibleInstances,
 FlexibleContexts, KindSignatures #-}

 data Wrapped (t :: [*]) = Wrapped
 }}}

 but it is extremely hard to figure out relaying just on information
 provided here: http://www.haskell.org/ghc/docs/7.4.1/html/users_guide
 /kind-polymorphism-and-promotion.html, especially in complex scenarios. I
 think this page should provide more information on type-checker messages
 format related to polymorphic kind, and some common pitfalls.

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler

___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs