GHC | 1 Apr 2011 01:22
Favicon

#5071: GHCi crashes on large alloca/allocaBytes requests

#5071: GHCi crashes on large alloca/allocaBytes requests
---------------------------------+------------------------------------------
    Reporter:  guest             |       Owner:              
        Type:  bug               |      Status:  new         
    Priority:  normal            |   Component:  Compiler    
     Version:  7.0.3             |    Keywords:              
    Testcase:                    |   Blockedby:              
          Os:  Unknown/Multiple  |    Blocking:              
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown
---------------------------------+------------------------------------------
 GHCi, and ghc, seems to exit (crash?) on certain types of memory
 allocation exceptions.

 The FFI addendum says that the allocation functions should be able to
 return null:
 http://www.cse.unsw.edu.au/~chak/haskell/ffi/ffi/ffise5.html#x8-230005

 Section 5.8 says this:

 > If any of the allocation functions fails, a value of Ptr.nullPtr is
 produced. If free or reallocBytes is applied to a memory area that has
 been allocated with alloca or allocaBytes, the behaviour is undefined. Any
 further access to memory areas allocated with alloca or allocaBytes, after
 the computation that was passed to the allocation function has terminated,
 leads to undefined behaviour. Any further access to the memory area
 referenced by a pointer passed to realloc, reallocBytes, or free entails
 undefined behaviour.

 In practice, code examples and documentation appear to rely on `alloca`
 '''NOT''' returning a `nullPtr`:
(Continue reading)

GHC | 1 Apr 2011 01:29
Favicon

Re: #5071: GHCi crashes on large alloca/allocaBytes requests

#5071: GHCi crashes on large alloca/allocaBytes requests
---------------------------------+------------------------------------------
    Reporter:  guest             |       Owner:              
        Type:  bug               |      Status:  new         
    Priority:  normal            |   Component:  Compiler    
     Version:  7.0.3             |    Keywords:              
    Testcase:                    |   Blockedby:              
          Os:  Unknown/Multiple  |    Blocking:              
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown
---------------------------------+------------------------------------------
Changes (by dmwit):

 * cc: daniel <at> … (added)

--

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5071#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs <at> haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC | 1 Apr 2011 04:46
Favicon

Re: #5071: GHCi crashes on large alloca/allocaBytes requests

#5071: GHCi crashes on large alloca/allocaBytes requests
---------------------------------+------------------------------------------
    Reporter:  guest             |       Owner:              
        Type:  bug               |      Status:  new         
    Priority:  normal            |   Component:  Compiler    
     Version:  7.0.3             |    Keywords:              
    Testcase:                    |   Blockedby:              
          Os:  Unknown/Multiple  |    Blocking:              
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown
---------------------------------+------------------------------------------

Comment(by guest):

 The Haskell 2010 FFI section agrees that `nullPtr` should be produced:
 http://www.haskell.org/onlinereport/haskell2010/haskellch31.html#x39-28600031

--

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5071#comment:2>
GHC | 1 Apr 2011 04:55
Favicon

Re: #5071: GHCi crashes on large alloca/allocaBytes requests

#5071: GHCi crashes on large alloca/allocaBytes requests
---------------------------------+------------------------------------------
    Reporter:  guest             |       Owner:              
        Type:  bug               |      Status:  new         
    Priority:  normal            |   Component:  Compiler    
     Version:  7.0.3             |    Keywords:              
    Testcase:                    |   Blockedby:              
          Os:  Unknown/Multiple  |    Blocking:              
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown
---------------------------------+------------------------------------------

Comment(by chak):

 I would suggest to make the libraries comply with the Haskell standard.
 Raising an exception instead of returning a `nullPtr` will break all code
 that is written against the standard.

--

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5071#comment:3>
GHC | 1 Apr 2011 11:07
Favicon

Re: #5061: Implement FFI spec behaviour for *CString family

#5061: Implement FFI spec behaviour for *CString family
---------------------------------+------------------------------------------
    Reporter:  batterseapower    |        Owner:              
        Type:  bug               |       Status:  patch       
    Priority:  normal            |    Milestone:              
   Component:  Compiler          |      Version:  7.0.3       
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------
Changes (by batterseapower):

  * status:  new => patch

--

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5061#comment:5>
GHC | 1 Apr 2011 11:43
Favicon

Re: #5052: stdcall on OS X is broken

#5052: stdcall on OS X is broken
-------------------------+--------------------------------------------------
    Reporter:  igloo     |        Owner:              
        Type:  bug       |       Status:  patch       
    Priority:  normal    |    Milestone:              
   Component:  Compiler  |      Version:  7.0.2       
    Keywords:            |     Testcase:              
   Blockedby:            |   Difficulty:              
          Os:  MacOS X   |     Blocking:              
Architecture:  x86       |      Failure:  None/Unknown
-------------------------+--------------------------------------------------
Changes (by batterseapower):

  * status:  new => patch

Comment:

 I've attached a ticket that seems to fix this bug for me. The problem is
 that the codegen for foreign calls makes sure the stack is 16-byte aligned
 on OS X by pushing some padding. In the case where the foreign call is
 cdecl, that padding gets popped after the call, but if the convention is
 stdcall then it doesn't generate any popping code at all. However, this is
 incorrect because the stdcall only promises to pop the arguments, not the
 padding.

 The fix is to generate code to pop the padding (if any) on OS X.

--

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5052#comment:3>
(Continue reading)

GHC | 1 Apr 2011 11:53
Favicon

Re: #5065: dph tests failing

#5065: dph tests failing
--------------------------------------+-------------------------------------
    Reporter:  igloo                  |        Owner:              
        Type:  bug                    |       Status:  new         
    Priority:  normal                 |    Milestone:              
   Component:  Data Parallel Haskell  |      Version:  7.1         
    Keywords:                         |     Testcase:              
   Blockedby:                         |   Difficulty:              
          Os:  Unknown/Multiple       |     Blocking:  5070        
Architecture:  Unknown/Multiple       |      Failure:  None/Unknown
--------------------------------------+-------------------------------------

Comment(by ezyang):

 The failure I'm getting is:

 {{{
 [1 of 2] Compiling PrimesVect       ( PrimesVect.hs, PrimesVect.o )
 *** Vectorisation error ***
     Variable not vectorised: Control.Exception.Base.patError

 }}}

 So maybe a Core optimization pass isn't managing to eliminate the
 patError?

--

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5065#comment:2>
GHC | 1 Apr 2011 12:09
Favicon

Re: #4855: Debug.Trace.trace mangles Unicode strings

#4855: Debug.Trace.trace mangles Unicode strings
-------------------------------+--------------------------------------------
    Reporter:  andersk         |        Owner:                             
        Type:  bug             |       Status:  new                        
    Priority:  normal          |    Milestone:  7.4.1                      
   Component:  libraries/base  |      Version:  7.0.1                      
    Keywords:                  |     Testcase:                             
   Blockedby:                  |   Difficulty:                             
          Os:  Linux           |     Blocking:                             
Architecture:  x86_64 (amd64)  |      Failure:  Incorrect result at runtime
-------------------------------+--------------------------------------------

Comment(by batterseapower):

 This happens because GHC call the C function debugBelch to output a
 "trace" string. This has the advantage that the user of GHC can override
 how "trace" messages are handled by changing the debugMsgFn function
 pointer.

 If we were to simply delete the GHC-specific #ifdef in Debug.Trace we
 would be using "hPtStrLn stderr" instead, so the correct locale encoding
 would be applied and trace would handle unicode properly.

 Another option is to fix #5061, at which point we can make Trace work
 properly by using withCString instead of withCAString.

--

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4855#comment:3>
GHC | 1 Apr 2011 12:34
Favicon

Re: #5065: dph tests failing

#5065: dph tests failing
--------------------------------------+-------------------------------------
    Reporter:  igloo                  |        Owner:              
        Type:  bug                    |       Status:  new         
    Priority:  normal                 |    Milestone:              
   Component:  Data Parallel Haskell  |      Version:  7.1         
    Keywords:                         |     Testcase:              
   Blockedby:                         |   Difficulty:              
          Os:  Unknown/Multiple       |     Blocking:  5070        
Architecture:  Unknown/Multiple       |      Failure:  None/Unknown
--------------------------------------+-------------------------------------
Changes (by simonpj):

 * cc: chak <at> …, benl <at> … (added)

Comment:

 I think Manuel is in mid-flight on some of this.

--

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5065#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs <at> haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
GHC | 1 Apr 2011 12:37
Favicon

Re: #5059: Pragma to SPECIALISE on value arguments

#5059: Pragma to SPECIALISE on value arguments
---------------------------------+------------------------------------------
    Reporter:  batterseapower    |        Owner:              
        Type:  feature request   |       Status:  new         
    Priority:  normal            |    Milestone:              
   Component:  Compiler          |      Version:  7.0.3       
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------

Comment(by simonpj):

 Right.  Like I said `inline` would need fixing to be able to inline even
 recursive functions.  But then it might work just fine, right?

--

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5059#comment:5>

Gmane