[GHC] #12636: ProfHeap's printf modifiers are incorrect

Siddharth Bhat siddu.druid at gmail.com
Sat Feb 11 10:34:11 UTC 2017


I believe the guarantee at that chunk of code is that void_total of the era
will be >= 0.

I could add an asset at those sections of code if need be.

If not, what is the correct type to be used here? I think size_t is
reasonable as none of them are supposed to be negative in the first place.

On Sat 11 Feb, 2017, 3:51 PM GHC, <ghc-devs at haskell.org> wrote:

> #12636: ProfHeap's printf modifiers are incorrect
> -------------------------------------+-------------------------------------
>         Reporter:  Phyx-             |                Owner:  bollu
>             Type:  bug               |               Status:  new
>         Priority:  normal            |            Milestone:
>        Component:  Runtime System    |              Version:  8.0.1
>       Resolution:                    |             Keywords:  newcomer
> Operating System:  Windows           |         Architecture:
>                                      |  Unknown/Multiple
>  Type of failure:  None/Unknown      |            Test Case:
>       Blocked By:                    |             Blocking:
>  Related Tickets:                    |  Differential Rev(s):
>        Wiki Page:                    |
> -------------------------------------+-------------------------------------
>
> Comment (by Phyx-):
>
>  I actually question the use of `ssize_t` at all for these values. I think
>  the calculations violate the expected value ranges of `ssize_t` namely
>  with
>
>  {{{
>  censuses[t].void_total   += size;
>  censuses[era].void_total -= size;
>  }}}
>
>  So I think the types in `_counter` are wrong and have the potential to do
>  an unsigned underflow as `ssize_t` is only guaranteed to be able to store
>  values between `[-1, {SSIZE_MAX}]`[1]
>
>  [1]
> http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html
>
> --
> Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12636#comment:5>
> GHC <http://www.haskell.org/ghc/>
> The Glasgow Haskell Compiler
>
-- 
Sending this from my phone, please excuse any typos!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20170211/7241b88b/attachment-0001.html>


More information about the ghc-devs mailing list