Re: [GHC] #7276: -fdefer-type-errors allows the types of quotations to be coerced, causing segmentation fault

2012-11-29 Thread GHC
#7276: -fdefer-type-errors allows the types of quotations to be coerced, causing
segmentation fault
--+-
  Reporter:  parcs|  Owner:  
  Type:  bug  | Status:  closed  
  Priority:  normal   |  Milestone:  7.6.2   
 Component:  Compiler |Version:  7.6.1   
Resolution:  fixed|   Keywords:  
Os:  Unknown/Multiple |   Architecture:  Unknown/Multiple
   Failure:  Compile-time crash   | Difficulty:  Unknown 
  Testcase:  th/T7276, th/T7276b  |  Blockedby:  
  Blocking:   |Related:  
--+-
Changes (by igloo):

  * status:  merge = closed
  * resolution:  = fixed


Comment:

 Merged as 50837615c7e1d1d6b703e99ee7fd8fcf0bfee30c and
 da26f6c38c22158f698ec75d910ebe4a61923d25

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7276#comment:10
GHC http://www.haskell.org/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] #7276: -fdefer-type-errors allows the types of quotations to be coerced, causing segmentation fault

2012-10-26 Thread GHC
#7276: -fdefer-type-errors allows the types of quotations to be coerced, causing
segmentation fault
-+--
  Reporter:  parcs   |  Owner:  
  Type:  bug | Status:  new 
  Priority:  normal  |  Milestone:  7.6.2   
 Component:  Compiler|Version:  7.6.1   
Resolution:  |   Keywords:  
Os:  Unknown/Multiple|   Architecture:  Unknown/Multiple
   Failure:  Compile-time crash  | Difficulty:  Unknown 
  Testcase:  th/T7276|  Blockedby:  
  Blocking:  |Related:  
-+--

Comment(by simonpj@…):

 commit 0b2a6a0580c34e4fcb77a67719d77b358bb4d69d
 {{{
 Author: Simon Peyton Jones simo...@microsoft.com
 Date:   Mon Oct 15 15:07:16 2012 +0100

 Wrap a bracket quotation in a coercion that makes it have the right
 type

 This is the right fix to Trac #7276 (part 2), which makes the
 interaction with -fdefer-type-errors and TH work properly.

  compiler/typecheck/TcSplice.lhs |   14 +++---
  1 files changed, 7 insertions(+), 7 deletions(-)
 }}}

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7276#comment:8
GHC http://www.haskell.org/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] #7276: -fdefer-type-errors allows the types of quotations to be coerced, causing segmentation fault

2012-10-26 Thread GHC
#7276: -fdefer-type-errors allows the types of quotations to be coerced, causing
segmentation fault
--+-
  Reporter:  parcs|  Owner:  
  Type:  bug  | Status:  merge   
  Priority:  normal   |  Milestone:  7.6.2   
 Component:  Compiler |Version:  7.6.1   
Resolution:   |   Keywords:  
Os:  Unknown/Multiple |   Architecture:  Unknown/Multiple
   Failure:  Compile-time crash   | Difficulty:  Unknown 
  Testcase:  th/T7276, th/T7276b  |  Blockedby:  
  Blocking:   |Related:  
--+-
Changes (by simonpj):

  * status:  new = merge
  * testcase:  th/T7276 = th/T7276, th/T7276b


Comment:

 I've added a regression test for the second bug too.

 Simon

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7276#comment:9
GHC http://www.haskell.org/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] #7276: -fdefer-type-errors allows the types of quotations to be coerced, causing segmentation fault

2012-10-19 Thread GHC
#7276: -fdefer-type-errors allows the types of quotations to be coerced, causing
segmentation fault
-+--
  Reporter:  parcs   |  Owner:  
  Type:  bug | Status:  new 
  Priority:  normal  |  Milestone:  7.6.2   
 Component:  Compiler|Version:  7.6.1   
Resolution:  |   Keywords:  
Os:  Unknown/Multiple|   Architecture:  Unknown/Multiple
   Failure:  Compile-time crash  | Difficulty:  Unknown 
  Testcase:  th/T7276|  Blockedby:  
  Blocking:  |Related:  
-+--
Changes (by igloo):

  * status:  merge = new
  * milestone:  = 7.6.2


Comment:

 Let's fix the new problems before merging.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7276#comment:7
GHC http://www.haskell.org/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] #7276: -fdefer-type-errors allows the types of quotations to be coerced, causing segmentation fault

2012-10-14 Thread GHC
#7276: -fdefer-type-errors allows the types of quotations to be coerced, causing
segmentation fault
-+--
Reporter:  parcs |   Owner:
Type:  bug   |  Status:  merge 
Priority:  normal|   Milestone:
   Component:  Compiler  | Version:  7.6.1 
Keywords:|  Os:  Unknown/Multiple  
Architecture:  Unknown/Multiple  | Failure:  Compile-time crash
  Difficulty:  Unknown   |Testcase:  th/T7276  
   Blockedby:|Blocking:
 Related:|  
-+--

Comment(by parcs):

 I think I found the underlying issue: when the inferred type and actual
 type of a TH bracket don't match, the TH bracket does not get replaced
 with a call to `error`. Instead, the bracket is just coerced to whatever
 type it's expected to be, e.g.:

 {{{
  let a = [| True |] :: Int
  a
 1099511628032
 }}}

 instead of:

 {{{
  let a = [| True |] :: Int
  a
 *** Exception: interactive:2:9:
 Couldn't match type `Language.Haskell.TH.Syntax.Q
 ...
 (deferred type error)
 }}}

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7276#comment:6
GHC http://www.haskell.org/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] #7276: -fdefer-type-errors allows the types of quotations to be coerced, causing segmentation fault

2012-10-10 Thread GHC
#7276: -fdefer-type-errors allows the types of quotations to be coerced, causing
segmentation fault
-+--
Reporter:  parcs |   Owner:
Type:  bug   |  Status:  merge 
Priority:  normal|   Milestone:
   Component:  Compiler  | Version:  7.6.1 
Keywords:|  Os:  Unknown/Multiple  
Architecture:  Unknown/Multiple  | Failure:  Compile-time crash
  Difficulty:  Unknown   |Testcase:  th/T7276  
   Blockedby:|Blocking:
 Related:|  
-+--

Comment(by parcs):

 It looks like you can still trigger a segfault if you bind the quotation
 to an identifier while coercing its type and then splicing the quotation,
 e.g.

 {{{
 :set -fdefer-type-errors
 :set -XTemplateHaskell

 import Language.Haskell.TH

 let x = [d|a = ()|] :: Q Exp
 :t $x
 }}}

 The patch also makes GHC too aggressive than it should be with respect to
 type errors within declaration quotations. For example the type error in
 `$([d|a = () ()|])` could be deferred but after this patch it becomes an
 eager type error. Likewise, you can no longer do e.g. `:t $([|() ()|])`
 within GHCi to view the type of a malformed expression quotation.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7276#comment:5
GHC http://www.haskell.org/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] #7276: -fdefer-type-errors allows the types of quotations to be coerced, causing segmentation fault

2012-10-03 Thread GHC
#7276: -fdefer-type-errors allows the types of quotations to be coerced, causing
segmentation fault
+---
 Reporter:  parcs   |  Owner:  
 Type:  bug | Status:  new 
 Priority:  normal  |  Component:  Compiler
  Version:  7.6.1   |   Keywords:  
   Os:  Unknown/Multiple|   Architecture:  Unknown/Multiple
  Failure:  Compile-time crash  |   Testcase:  
Blockedby:  |   Blocking:  
  Related:  |  
+---

Comment(by simonpj@…):

 commit a501c950652d3cb56335781289f0f502c0cf2f4e
 {{{
 Author: Simon Peyton Jones simo...@microsoft.com
 Date:   Mon Oct 1 21:52:19 2012 +0100

 Make sure that we check for type errors strictly in a Template Haskell
 splice, even if -fdefer-type-errors is on

 We're going to run this code, so there's no point in deferring type
 errors.  Worse, TcSplice uses unsafeCoerce (for vevy good reasons),
 so splicing a type into a place where an expression is expected would
 yield a seg-fault if we plough on regardless.

 Fixes Trac #7276

  compiler/typecheck/TcSplice.lhs |6 ++
  1 files changed, 6 insertions(+), 0 deletions(-)
 }}}

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7276#comment:3
GHC http://www.haskell.org/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] #7276: -fdefer-type-errors allows the types of quotations to be coerced, causing segmentation fault

2012-10-03 Thread GHC
#7276: -fdefer-type-errors allows the types of quotations to be coerced, causing
segmentation fault
-+--
Reporter:  parcs |   Owner:
Type:  bug   |  Status:  merge 
Priority:  normal|   Milestone:
   Component:  Compiler  | Version:  7.6.1 
Keywords:|  Os:  Unknown/Multiple  
Architecture:  Unknown/Multiple  | Failure:  Compile-time crash
  Difficulty:  Unknown   |Testcase:  th/T7276  
   Blockedby:|Blocking:
 Related:|  
-+--
Changes (by simonpj):

  * status:  new = merge
  * difficulty:  = Unknown
  * testcase:  = th/T7276


Comment:

 Excellent point, thank you.

 Worth merging this to 7.6 branch

 Simon

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7276#comment:4
GHC http://www.haskell.org/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] #7276: -fdefer-type-errors allows the types of quotations to be coerced, causing segmentation fault

2012-09-28 Thread GHC
#7276: -fdefer-type-errors allows the types of quotations to be coerced, causing
segmentation fault
+---
 Reporter:  parcs   |  Owner:  
 Type:  bug | Status:  new 
 Priority:  normal  |  Component:  Compiler
  Version:  7.6.1   |   Keywords:  
   Os:  Unknown/Multiple|   Architecture:  Unknown/Multiple
  Failure:  Compile-time crash  |   Testcase:  
Blockedby:  |   Blocking:  
  Related:  |  
+---

Comment(by guest):

 Just a note: since defering for expressions is off in GHCi by default, the
 error can be reproduced with

 {{{
 let x = $([d|a = ()|])
 }}}

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7276#comment:1
GHC http://www.haskell.org/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] #7276: -fdefer-type-errors allows the types of quotations to be coerced, causing segmentation fault

2012-09-28 Thread GHC
#7276: -fdefer-type-errors allows the types of quotations to be coerced, causing
segmentation fault
+---
 Reporter:  parcs   |  Owner:  
 Type:  bug | Status:  new 
 Priority:  normal  |  Component:  Compiler
  Version:  7.6.1   |   Keywords:  
   Os:  Unknown/Multiple|   Architecture:  Unknown/Multiple
  Failure:  Compile-time crash  |   Testcase:  
Blockedby:  |   Blocking:  
  Related:  |  
+---

Comment(by parcs):

 Oh right, thanks. I meant to say `:t $([d|a = ()|])`

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7276#comment:2
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler

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