
Friends In a call with a bunch of type hackers, we were discussing https://ghc.haskell.org/trac/ghc/ticket/9858 This is a pretty serious bug. It allows a malicious person to construct his own unsafeCoerce, and so completely subverts Safe Haskell. Actually there are two bugs (see comment:19). The first is easily fixed. But the second is not. We explored various quick fixes, but the real solution is not far out of reach. It amounts to this: * Every data type is automatically in Typeable. No need to say "deriving(Typeable)" or "AutoDeriveTypeable" (which would become deprecated) * In implementation terms, the constraint solver treats Typeable specially, much as it already treats Coercible specially. It's not a huge job. It'd probably take a couple of days of implementation work, and some time for shaking out bugs and consequential changes. The biggest thing might be simply working out implementation design choices. (For example, there is a modest code-size cost to making everything Typeable, esp because that includes the data constructors of the type (which can be used in types, with DataKinds). Does that matter? Should we provide a way to suppress it? If so, we'd also need a way to express whether or not the Typable instance exists in the interface file.) But it is a substantial change that will touch a lot of lines of code. Moreover, someone has to do it, and Iavor (who heroically volunteered) happens to be travelling next week. So it's really not the kind of thing we would usually do after RC2. But (a) it's serious and, as it happens, (b) there is also the BBP Prelude debate going on. Hence the question: should we simply delay 7.10 by, say, a month? After all, the timetable is up to us. Doing so might give a bit more breathing space to the BBP debate, which might allow time for reflection and/or implementation of modest features to help the transition. (I know that several are under discussion.) Plus, anyone waiting for 7.10 can simply use RC2, which is pretty good. Would that be a relief to the BBP debate? Or any other opinions. Simon PS: I know, I know: there is endless pressure to delay releases to get stuff in. If we give in to that pressure, we never make a release. But we should know when to break our own rules. Perhaps this is such an occasion.

I think delaying is OK, but we should probably say something like "we're
delaying for X and Y, but that doesn't mean that you can not sneak in Z*".
* Unless Z is the StrictData language pragma and your name is Johan. ;)
On Thu, Jan 29, 2015 at 9:58 AM, Simon Peyton Jones
Friends
In a call with a bunch of type hackers, we were discussing
https://ghc.haskell.org/trac/ghc/ticket/9858
This is a pretty serious bug. It allows a malicious person to construct his own unsafeCoerce, and so completely subverts Safe Haskell.
Actually there are two bugs (see comment:19). The first is easily fixed. But the second is not.
We explored various quick fixes, but the real solution is not far out of reach. It amounts to this:
· Every data type is automatically in Typeable. No need to say “deriving(Typeable)” or “AutoDeriveTypeable” (which would become deprecated)
· In implementation terms, the constraint solver treats Typeable specially, much as it already treats Coercible specially.
It’s not a huge job. It’d probably take a couple of days of implementation work, and some time for shaking out bugs and consequential changes. The biggest thing might be simply working out implementation design choices. (For example, there is a modest code-size cost to making everything Typeable, esp because that includes the data constructors of the type (which can be used in types, with DataKinds). Does that matter? Should we provide a way to suppress it? If so, we’d also need a way to express whether or not the Typable instance exists in the interface file.)
But it is a substantial change that will touch a lot of lines of code. Moreover, someone has to do it, and Iavor (who heroically volunteered) happens to be travelling next week.
So it’s really not the kind of thing we would usually do after RC2.
But (a) it’s serious and, as it happens, (b) there is also the BBP Prelude debate going on.
Hence the question: should we simply delay 7.10 by, say, a month? After all, the timetable is up to us. Doing so might give a bit more breathing space to the BBP debate, which might allow time for reflection and/or implementation of modest features to help the transition. (I know that several are under discussion.) Plus, anyone waiting for 7.10 can simply use RC2, which is pretty good.
Would that be a relief to the BBP debate? Or any other opinions.
Simon
PS: I know, I know: there is endless pressure to delay releases to get stuff in. If we give in to that pressure, we never make a release. But we should know when to break our own rules. Perhaps this is such an occasion.
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

I agree with Johan although my Z is different and will be left unspecifed
:). In the meantime we should get out bindists for RC2 for all platforms
that we intend to do so.
On Thu, Jan 29, 2015 at 2:08 PM, Johan Tibell
I think delaying is OK, but we should probably say something like "we're delaying for X and Y, but that doesn't mean that you can not sneak in Z*".
* Unless Z is the StrictData language pragma and your name is Johan. ;)
On Thu, Jan 29, 2015 at 9:58 AM, Simon Peyton Jones
wrote:
Friends
In a call with a bunch of type hackers, we were discussing
https://ghc.haskell.org/trac/ghc/ticket/9858
This is a pretty serious bug. It allows a malicious person to construct his own unsafeCoerce, and so completely subverts Safe Haskell.
Actually there are two bugs (see comment:19). The first is easily fixed. But the second is not.
We explored various quick fixes, but the real solution is not far out of reach. It amounts to this:
· Every data type is automatically in Typeable. No need to say “deriving(Typeable)” or “AutoDeriveTypeable” (which would become deprecated)
· In implementation terms, the constraint solver treats Typeable specially, much as it already treats Coercible specially.
It’s not a huge job. It’d probably take a couple of days of implementation work, and some time for shaking out bugs and consequential changes. The biggest thing might be simply working out implementation design choices. (For example, there is a modest code-size cost to making everything Typeable, esp because that includes the data constructors of the type (which can be used in types, with DataKinds). Does that matter? Should we provide a way to suppress it? If so, we’d also need a way to express whether or not the Typable instance exists in the interface file.)
But it is a substantial change that will touch a lot of lines of code. Moreover, someone has to do it, and Iavor (who heroically volunteered) happens to be travelling next week.
So it’s really not the kind of thing we would usually do after RC2.
But (a) it’s serious and, as it happens, (b) there is also the BBP Prelude debate going on.
Hence the question: should we simply delay 7.10 by, say, a month? After all, the timetable is up to us. Doing so might give a bit more breathing space to the BBP debate, which might allow time for reflection and/or implementation of modest features to help the transition. (I know that several are under discussion.) Plus, anyone waiting for 7.10 can simply use RC2, which is pretty good.
Would that be a relief to the BBP debate? Or any other opinions.
Simon
PS: I know, I know: there is endless pressure to delay releases to get stuff in. If we give in to that pressure, we never make a release. But we should know when to break our own rules. Perhaps this is such an occasion.
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

Just wanted to add that I'm not really qualified to vote either and that we
can use this time to ask package maintainers to make sure their stuff at
least compiles on 7.10.RC2
On Thu, Jan 29, 2015 at 2:18 PM, George Colpitts
I agree with Johan although my Z is different and will be left unspecifed :). In the meantime we should get out bindists for RC2 for all platforms that we intend to do so.
On Thu, Jan 29, 2015 at 2:08 PM, Johan Tibell
wrote: I think delaying is OK, but we should probably say something like "we're delaying for X and Y, but that doesn't mean that you can not sneak in Z*".
* Unless Z is the StrictData language pragma and your name is Johan. ;)
On Thu, Jan 29, 2015 at 9:58 AM, Simon Peyton Jones < simonpj@microsoft.com> wrote:
Friends
In a call with a bunch of type hackers, we were discussing
https://ghc.haskell.org/trac/ghc/ticket/9858
This is a pretty serious bug. It allows a malicious person to construct his own unsafeCoerce, and so completely subverts Safe Haskell.
Actually there are two bugs (see comment:19). The first is easily fixed. But the second is not.
We explored various quick fixes, but the real solution is not far out of reach. It amounts to this:
· Every data type is automatically in Typeable. No need to say “deriving(Typeable)” or “AutoDeriveTypeable” (which would become deprecated)
· In implementation terms, the constraint solver treats Typeable specially, much as it already treats Coercible specially.
It’s not a huge job. It’d probably take a couple of days of implementation work, and some time for shaking out bugs and consequential changes. The biggest thing might be simply working out implementation design choices. (For example, there is a modest code-size cost to making everything Typeable, esp because that includes the data constructors of the type (which can be used in types, with DataKinds). Does that matter? Should we provide a way to suppress it? If so, we’d also need a way to express whether or not the Typable instance exists in the interface file.)
But it is a substantial change that will touch a lot of lines of code. Moreover, someone has to do it, and Iavor (who heroically volunteered) happens to be travelling next week.
So it’s really not the kind of thing we would usually do after RC2.
But (a) it’s serious and, as it happens, (b) there is also the BBP Prelude debate going on.
Hence the question: should we simply delay 7.10 by, say, a month? After all, the timetable is up to us. Doing so might give a bit more breathing space to the BBP debate, which might allow time for reflection and/or implementation of modest features to help the transition. (I know that several are under discussion.) Plus, anyone waiting for 7.10 can simply use RC2, which is pretty good.
Would that be a relief to the BBP debate? Or any other opinions.
Simon
PS: I know, I know: there is endless pressure to delay releases to get stuff in. If we give in to that pressure, we never make a release. But we should know when to break our own rules. Perhaps this is such an occasion.
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

On 01/29/2015 06:58 PM, Simon Peyton Jones wrote:
Friends In a call with a bunch of type hackers, we were discussing https://ghc.haskell.org/trac/ghc/ticket/9858 This is a pretty serious bug. It allows a malicious person to construct his own unsafeCoerce, and so completely subverts Safe Haskell. Actually there are two bugs (see comment:19). The first is easily fixed. But the second is not. We explored various quick fixes, but the real solution is not far out of reach. It amounts to this:
I'm definitely not qualified to "vote" on this, but out of curiosity is this something which will affect *existing* and *deployed* (or, I guess, soon-to-be-deployed-after-being-recompiled-with-7.10-without-changes) code? It it something which will "just" affect Try Haskell and similar initiatives which must use Safe Haskell to avoid trivial DoS and exploitation? Would the "do not derive Typeable for polykinded type constructors" break huge amounts of existing pre-7.10 code, etc.? It's pretty hard to evaluate *consequences* of available choices from the Trac thread, so maybe a little write-up of what the current choices (and consequences) are would be in order.
But (a) it's serious and, as it happens, (b) there is also the BBP Prelude debate going on. Hence the question: should we simply delay 7.10 by, say, a month? After all, the timetable is up to us. Doing so might give a bit more breathing space to the BBP debate, which might allow time for reflection and/or implementation of modest features to help the transition. (I know that several are under discussion.) Plus, anyone waiting for 7.10 can simply use RC2, which is pretty good. Would that be a relief to the BBP debate? Or any other opinions. Simon PS: I know, I know: there is endless pressure to delay releases to get stuff in. If we give in to that pressure, we never make a release. But we should know when to break our own rules. Perhaps this is such an occasion.
As a mostly disinterested observer of the BBP debate, I'd say letting that influence a decision on this matter is veering somewhat close to "endless pressure to delay releases to get stuff in" -- either the issue is serious enough on its own or it isn't. I understand and acknowledge that there are valid arguments on either side and that reasonable people can disagree on these matters :). I'm just offering an opinion. Regards,

On Thu, Jan 29, 2015 at 6:27 PM, Bardur Arantsson
On 01/29/2015 06:58 PM, Simon Peyton Jones wrote:
Friends In a call with a bunch of type hackers, we were discussing https://ghc.haskell.org/trac/ghc/ticket/9858 This is a pretty serious bug. It allows a malicious person to construct his own unsafeCoerce, and so completely subverts Safe Haskell. Actually there are two bugs (see comment:19). The first is easily fixed. But the second is not. We explored various quick fixes, but the real solution is not far out of reach. It amounts to this:
I'm definitely not qualified to "vote" on this, but out of curiosity is this something which will affect *existing* and *deployed* (or, I guess, soon-to-be-deployed-after-being-recompiled-with-7.10-without-changes) code? It it something which will "just" affect Try Haskell and similar initiatives which must use Safe Haskell to avoid trivial DoS and exploitation?
Would the "do not derive Typeable for polykinded type constructors" break huge amounts of existing pre-7.10 code, etc.?
I am particularly afraid of that, yes. Not being able to derive Typeable for polykinded type constructors also means no SYB for those types. And many libraries have moved to generalise their type constructors to be polykinded whenever possible. Cheers, Pedro

Hi, Am Donnerstag, den 29.01.2015, 17:58 +0000 schrieb Simon Peyton Jones:
Hence the question: should we simply delay 7.10 by, say, a month?
am I right that the bug is also in 7.8, i.e. it is not a regression? In that case, on its own, it is not a good reason to delay the release if we want to release. (There were releases while we knew about the GND unsoundness bug.) But if it looks like there is a big benefit from having a release a bit later, such as a not-too-ugly work-around or even a fix, then of course we _can_ delay it. Personally, I’m not urgently waiting for this release – Debian is too much behind anyways :-) How well would a work-around or fix fit in a 7.8.2 release? Will the fix practically affect what code compiles and what code does not? If the fix would not break reasonable code, then it might be better aimed for 7.8.2. Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org

After thinking about it a little, I'm fine with pushing the release out to
March. I think #9858 is the more serious of our concerns vs a raging
debate, too.
My only concern really is dealing with the merging of such a patch. For
example, if the patch to fix this is actually as wide ranging as we believe
to the type hacker, I can definitely foresee a merge conflict, with, say,
the recent -fwarn-redundant-constraints, which I've managed to leave out of
7.10 so far.
In any case, with some more time, we can work those details out.
On Thursday, January 29, 2015, Simon Peyton Jones
Friends
In a call with a bunch of type hackers, we were discussing
https://ghc.haskell.org/trac/ghc/ticket/9858
This is a pretty serious bug. It allows a malicious person to construct his own unsafeCoerce, and so completely subverts Safe Haskell.
Actually there are two bugs (see comment:19). The first is easily fixed. But the second is not.
We explored various quick fixes, but the real solution is not far out of reach. It amounts to this:
· Every data type is automatically in Typeable. No need to say “deriving(Typeable)” or “AutoDeriveTypeable” (which would become deprecated)
· In implementation terms, the constraint solver treats Typeable specially, much as it already treats Coercible specially.
It’s not a huge job. It’d probably take a couple of days of implementation work, and some time for shaking out bugs and consequential changes. The biggest thing might be simply working out implementation design choices. (For example, there is a modest code-size cost to making everything Typeable, esp because that includes the data constructors of the type (which can be used in types, with DataKinds). Does that matter? Should we provide a way to suppress it? If so, we’d also need a way to express whether or not the Typable instance exists in the interface file.)
But it is a substantial change that will touch a lot of lines of code. Moreover, someone has to do it, and Iavor (who heroically volunteered) happens to be travelling next week.
So it’s really not the kind of thing we would usually do after RC2.
But (a) it’s serious and, as it happens, (b) there is also the BBP Prelude debate going on.
Hence the question: should we simply delay 7.10 by, say, a month? After all, the timetable is up to us. Doing so might give a bit more breathing space to the BBP debate, which might allow time for reflection and/or implementation of modest features to help the transition. (I know that several are under discussion.) Plus, anyone waiting for 7.10 can simply use RC2, which is pretty good.
Would that be a relief to the BBP debate? Or any other opinions.
Simon
PS: I know, I know: there is endless pressure to delay releases to get stuff in. If we give in to that pressure, we never make a release. But we should know when to break our own rules. Perhaps this is such an occasion.
-- Regards, Austin Seipp, Haskell Consultant Well-Typed LLP, http://www.well-typed.com/

On 01/29/2015 08:54 PM, Austin Seipp wrote:
After thinking about it a little, I'm fine with pushing the release out to March. I think #9858 is the more serious of our concerns vs a raging debate, too.
My only concern really is dealing with the merging of such a patch. For example, if the patch to fix this is actually as wide ranging as we believe to the type hacker, I can definitely foresee a merge conflict, with, say, the recent -fwarn-redundant-constraints, which I've managed to leave out of 7.10 so far.
In any case, with some more time, we can work those details out.
Oh, you silly implementers, you! :D Regards,

I personally would rather see this issue given the time to be resolved
correctly than rush to release 7.10 now because of a self-imposed deadline.
An unsafeCoerce bug, especially one which affects SafeHaskell, pretty much
trumps all in my eyes.
-Edward
On Thu, Jan 29, 2015 at 2:54 PM, Austin Seipp
After thinking about it a little, I'm fine with pushing the release out to March. I think #9858 is the more serious of our concerns vs a raging debate, too.
My only concern really is dealing with the merging of such a patch. For example, if the patch to fix this is actually as wide ranging as we believe to the type hacker, I can definitely foresee a merge conflict, with, say, the recent -fwarn-redundant-constraints, which I've managed to leave out of 7.10 so far.
In any case, with some more time, we can work those details out.
On Thursday, January 29, 2015, Simon Peyton Jones
wrote: Friends
In a call with a bunch of type hackers, we were discussing
https://ghc.haskell.org/trac/ghc/ticket/9858
This is a pretty serious bug. It allows a malicious person to construct his own unsafeCoerce, and so completely subverts Safe Haskell.
Actually there are two bugs (see comment:19). The first is easily fixed. But the second is not.
We explored various quick fixes, but the real solution is not far out of reach. It amounts to this:
· Every data type is automatically in Typeable. No need to say “deriving(Typeable)” or “AutoDeriveTypeable” (which would become deprecated)
· In implementation terms, the constraint solver treats Typeable specially, much as it already treats Coercible specially.
It’s not a huge job. It’d probably take a couple of days of implementation work, and some time for shaking out bugs and consequential changes. The biggest thing might be simply working out implementation design choices. (For example, there is a modest code-size cost to making everything Typeable, esp because that includes the data constructors of the type (which can be used in types, with DataKinds). Does that matter? Should we provide a way to suppress it? If so, we’d also need a way to express whether or not the Typable instance exists in the interface file.)
But it is a substantial change that will touch a lot of lines of code. Moreover, someone has to do it, and Iavor (who heroically volunteered) happens to be travelling next week.
So it’s really not the kind of thing we would usually do after RC2.
But (a) it’s serious and, as it happens, (b) there is also the BBP Prelude debate going on.
Hence the question: should we simply delay 7.10 by, say, a month? After all, the timetable is up to us. Doing so might give a bit more breathing space to the BBP debate, which might allow time for reflection and/or implementation of modest features to help the transition. (I know that several are under discussion.) Plus, anyone waiting for 7.10 can simply use RC2, which is pretty good.
Would that be a relief to the BBP debate? Or any other opinions.
Simon
PS: I know, I know: there is endless pressure to delay releases to get stuff in. If we give in to that pressure, we never make a release. But we should know when to break our own rules. Perhaps this is such an occasion.
-- Regards,
Austin Seipp, Haskell Consultant Well-Typed LLP, http://www.well-typed.com/
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

additionally, the bug seems to work in GHC 7.8.4 too.
On Thu, Jan 29, 2015 at 5:07 PM, Edward Kmett
I personally would rather see this issue given the time to be resolved correctly than rush to release 7.10 now because of a self-imposed deadline.
An unsafeCoerce bug, especially one which affects SafeHaskell, pretty much trumps all in my eyes.
-Edward
On Thu, Jan 29, 2015 at 2:54 PM, Austin Seipp
wrote: After thinking about it a little, I'm fine with pushing the release out to March. I think #9858 is the more serious of our concerns vs a raging debate, too.
My only concern really is dealing with the merging of such a patch. For example, if the patch to fix this is actually as wide ranging as we believe to the type hacker, I can definitely foresee a merge conflict, with, say, the recent -fwarn-redundant-constraints, which I've managed to leave out of 7.10 so far.
In any case, with some more time, we can work those details out.
On Thursday, January 29, 2015, Simon Peyton Jones
wrote: Friends
In a call with a bunch of type hackers, we were discussing
https://ghc.haskell.org/trac/ghc/ticket/9858
This is a pretty serious bug. It allows a malicious person to construct his own unsafeCoerce, and so completely subverts Safe Haskell.
Actually there are two bugs (see comment:19). The first is easily fixed. But the second is not.
We explored various quick fixes, but the real solution is not far out of reach. It amounts to this:
· Every data type is automatically in Typeable. No need to say “deriving(Typeable)” or “AutoDeriveTypeable” (which would become deprecated)
· In implementation terms, the constraint solver treats Typeable specially, much as it already treats Coercible specially.
It’s not a huge job. It’d probably take a couple of days of implementation work, and some time for shaking out bugs and consequential changes. The biggest thing might be simply working out implementation design choices. (For example, there is a modest code-size cost to making everything Typeable, esp because that includes the data constructors of the type (which can be used in types, with DataKinds). Does that matter? Should we provide a way to suppress it? If so, we’d also need a way to express whether or not the Typable instance exists in the interface file.)
But it is a substantial change that will touch a lot of lines of code. Moreover, someone has to do it, and Iavor (who heroically volunteered) happens to be travelling next week.
So it’s really not the kind of thing we would usually do after RC2.
But (a) it’s serious and, as it happens, (b) there is also the BBP Prelude debate going on.
Hence the question: should we simply delay 7.10 by, say, a month? After all, the timetable is up to us. Doing so might give a bit more breathing space to the BBP debate, which might allow time for reflection and/or implementation of modest features to help the transition. (I know that several are under discussion.) Plus, anyone waiting for 7.10 can simply use RC2, which is pretty good.
Would that be a relief to the BBP debate? Or any other opinions.
Simon
PS: I know, I know: there is endless pressure to delay releases to get stuff in. If we give in to that pressure, we never make a release. But we should know when to break our own rules. Perhaps this is such an occasion.
-- Regards,
Austin Seipp, Haskell Consultant Well-Typed LLP, http://www.well-typed.com/
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

I'm worried about the code-size regression. We should definitely measure how bad it is before making a decision on whether to enable Typeable by default. +1 to delaying the release. Cheers, Simon On 29/01/2015 17:58, Simon Peyton Jones wrote:
Friends
In a call with a bunch of type hackers, we were discussing
https://ghc.haskell.org/trac/ghc/ticket/9858
This is a pretty serious bug. It allows a malicious person to construct his own unsafeCoerce, and so completely subverts Safe Haskell.
Actually there are two bugs (see comment:19). The first is easily fixed. But the second is not.
We explored various quick fixes, but the real solution is not far out of reach. It amounts to this:
·Every data type is automatically in Typeable. No need to say “deriving(Typeable)” or “AutoDeriveTypeable” (which would become deprecated)
·In implementation terms, the constraint solver treats Typeable specially, much as it already treats Coercible specially.
It’s not a huge job. It’d probably take a couple of days of implementation work, and some time for shaking out bugs and consequential changes. The biggest thing might be simply working out implementation design choices. (For example, there is a modest code-size cost to making everything Typeable, esp because that includes the data constructors of the type (which can be used in types, with DataKinds). Does that matter? Should we provide a way to suppress it? If so, we’d also need a way to express whether or not the Typable instance exists in the interface file.)
But it is a substantial change that will touch a lot of lines of code. Moreover, someone has to do it, and Iavor (who heroically volunteered) happens to be travelling next week.
So it’s really not the kind of thing we would usually do after RC2.
But (a) it’s serious and, as it happens, (b) there is also the BBP Prelude debate going on.
Hence the question: should we simply delay 7.10 by, say, a month? After all, the timetable is up to us. Doing so might give a bit more breathing space to the BBP debate, which might allow time for reflection and/or implementation of modest features to help the transition. (I know that several are under discussion.) Plus, anyone waiting for 7.10 can simply use RC2, which is pretty good.
Would that be a relief to the BBP debate? Or any other opinions.
Simon
PS: I know, I know: there is endless pressure to delay releases to get stuff in. If we give in to that pressure, we never make a release. But we should know when to break our own rules. Perhaps this is such an occasion.
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

A safety issue of that magnitude is a valid reason to hold up a release at the last minute IMHO. Manuel
Simon Peyton Jones
: Friends
In a call with a bunch of type hackers, we were discussing
https://ghc.haskell.org/trac/ghc/ticket/9858 https://ghc.haskell.org/trac/ghc/ticket/9858 This is a pretty serious bug. It allows a malicious person to construct his own unsafeCoerce, and so completely subverts Safe Haskell.
Actually there are two bugs (see comment:19). The first is easily fixed. But the second is not.
We explored various quick fixes, but the real solution is not far out of reach. It amounts to this:
· Every data type is automatically in Typeable. No need to say “deriving(Typeable)” or “AutoDeriveTypeable” (which would become deprecated)
· In implementation terms, the constraint solver treats Typeable specially, much as it already treats Coercible specially.
It’s not a huge job. It’d probably take a couple of days of implementation work, and some time for shaking out bugs and consequential changes. The biggest thing might be simply working out implementation design choices. (For example, there is a modest code-size cost to making everything Typeable, esp because that includes the data constructors of the type (which can be used in types, with DataKinds). Does that matter? Should we provide a way to suppress it? If so, we’d also need a way to express whether or not the Typable instance exists in the interface file.)
But it is a substantial change that will touch a lot of lines of code. Moreover, someone has to do it, and Iavor (who heroically volunteered) happens to be travelling next week.
So it’s really not the kind of thing we would usually do after RC2.
But (a) it’s serious and, as it happens, (b) there is also the BBP Prelude debate going on.
Hence the question: should we simply delay 7.10 by, say, a month? After all, the timetable is up to us. Doing so might give a bit more breathing space to the BBP debate, which might allow time for reflection and/or implementation of modest features to help the transition. (I know that several are under discussion.) Plus, anyone waiting for 7.10 can simply use RC2, which is pretty good.
Would that be a relief to the BBP debate? Or any other opinions.
Simon
PS: I know, I know: there is endless pressure to delay releases to get stuff in. If we give in to that pressure, we never make a release. But we should know when to break our own rules. Perhaps this is such an occasion.
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org mailto:ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs http://www.haskell.org/mailman/listinfo/ghc-devs
participants (11)
-
Austin Seipp
-
Bardur Arantsson
-
Carter Schonwald
-
Edward Kmett
-
George Colpitts
-
Joachim Breitner
-
Johan Tibell
-
José Pedro Magalhães
-
Manuel M T Chakravarty
-
Simon Marlow
-
Simon Peyton Jones