Re: [Haskell-cafe] Yesod double free or corruption

2012-12-12 Thread Manuel Gómez
On Wed, Dec 12, 2012 at 12:24 PM, Andras Gyomrey  wrote:
> Hi,
>
> i got the following error using "yesod devel" it happened after adding the
> file which seems to have invalid content (not true). What should i do?

The first bit of your error message indeed indicates
`./Handler/Model/Season.hs` isn’t encoded as `hGetContents` expects:

> yesod: ./Handler/Model/Season.hs: hGetContents: invalid argument (invalid 
> byte sequence)

`System.IO.hGetContents` converts into Unicode from the default
encoding configured in your system unless explicitly told otherwise
with `hSetEncoding`[1].  You can check what this encoding is with the
GHC primitive `GHC.IO.Encoding.getLocaleEncoding`[2], or with the
somewhat less reliable `System.IO.localeEncoding` runtime constant.

This StackOverflow answer has some good pointers on inference and
validation of file encoding: 

The simplest solution is, of course, to set your system encoding to
UTF‐8, and make sure your source code is encoded accordingly.  GNU
iconv is quite handy for encoding conversions.  Remember to tell your
editor to default to UTF‐8 in case it doesn’t detect the system
encoding — or better yet, switch to a better editor that does.

The heap corruption does indeed indicate a bug somewhere, though not
necessarily in Yesod code.  If I understand this correctly, the
exception is uncaught (and printed by the default uncaught exception
handler[4] that, in turn, calls `errorBelch` in the RTS[5]) and the
heap corruption becomes evident only later during the GHC runtime’s
cleanup, whatever that may be.

[1]: 

[2]: 

[3]: 

[4]: 

[5]: Lines 34 and 174–202 of  in the GHC source


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Yesod double free or corruption

2012-12-12 Thread Andras Gyomrey
Hi,

i got the following error using "yesod devel" it happened after adding the
file which seems to have invalid content (not true). What should i do?

Andras Gyomrey
Yesod devel server. Press ENTER to quit
yesod: ./Handler/Model/Season.hs: hGetContents: invalid argument (invalid byte 
sequence)
*** glibc detected *** yesod: double free or corruption (out): 
0x2b5fe0006b10 ***
=== Backtrace: =
/lib64/libc.so.6(+0x75916)[0x2b5fda07b916]
/lib64/libc.so.6(+0x78443)[0x2b5fda07e443]
/lib64/libc.so.6(+0x203c6)[0x2b5fda0263c6]
/lib64/libc.so.6(iconv_close+0xf)[0x2b5fda02595f]
yesod[0x317d93a]
=== Memory map: 
0040-035a6000 r-xp  00:1b 112951588  
/home/paxer/.cabal/bin/yesod
037a5000-03bc1000 rwxp 031a5000 00:1b 112951588  
/home/paxer/.cabal/bin/yesod
03bc1000-03bca000 rwxp 03bc1000 00:00 0
05e7f000-05ec1000 rwxp 05e7f000 00:00 0  [heap]
2b5fd8ec1000-2b5fd8ee1000 r-xp  00:1b 99617724   
/lib64/ld-2.12.so
2b5fd8eef000-2b5fd8ef rwxp 2b5fd8eef000 00:00 0
2b5fd90e-2b5fd90e1000 r-xp 0001f000 00:1b 99617724   
/lib64/ld-2.12.so
2b5fd90e1000-2b5fd90e2000 rwxp 0002 00:1b 99617724   
/lib64/ld-2.12.so
2b5fd90e2000-2b5fd90e3000 rwxp 2b5fd90e2000 00:00 0
2b5fd90e3000-2b5fd90f8000 r-xp  00:1b 99617828   
/lib64/libz.so.1.2.3
2b5fd90f8000-2b5fd92f7000 ---p 00015000 00:1b 99617828   
/lib64/libz.so.1.2.3
2b5fd92f7000-2b5fd92f8000 r-xp 00014000 00:1b 99617828   
/lib64/libz.so.1.2.3
2b5fd92f8000-2b5fd92f9000 rwxp 00015000 00:1b 99617828   
/lib64/libz.so.1.2.3
2b5fd92f9000-2b5fd930 r-xp  00:1b 99628779   
/lib64/librt-2.12.so
2b5fd930-2b5fd94ff000 ---p 7000 00:1b 99628779   
/lib64/librt-2.12.so
2b5fd94ff000-2b5fd950 r-xp 6000 00:1b 99628779   
/lib64/librt-2.12.so
2b5fd950-2b5fd9501000 rwxp 7000 00:1b 99628779   
/lib64/librt-2.12.so
2b5fd9501000-2b5fd9503000 r-xp  00:1b 99625968   
/lib64/libutil-2.12.so
2b5fd9503000-2b5fd9702000 ---p 2000 00:1b 99625968   
/lib64/libutil-2.12.so
2b5fd9702000-2b5fd9703000 r-xp 1000 00:1b 99625968   
/lib64/libutil-2.12.so
2b5fd9703000-2b5fd9704000 rwxp 2000 00:1b 99625968   
/lib64/libutil-2.12.so
2b5fd9704000-2b5fd9705000 rwxp 2b5fd9704000 00:00 0
2b5fd9705000-2b5fd9707000 r-xp  00:1b 99623838   
/lib64/libdl-2.12.so
2b5fd9707000-2b5fd9907000 ---p 2000 00:1b 99623838   
/lib64/libdl-2.12.so
2b5fd9907000-2b5fd9908000 r-xp 2000 00:1b 99623838   
/lib64/libdl-2.12.so
2b5fd9908000-2b5fd9909000 rwxp 3000 00:1b 99623838   
/lib64/libdl-2.12.so
2b5fd9909000-2b5fd995f000 r-xp  00:1b 99624917   
/usr/lib64/libgmp.so.3.5.0
2b5fd995f000-2b5fd9b5f000 ---p 00056000 00:1b 99624917   
/usr/lib64/libgmp.so.3.5.0
2b5fd9b5f000-2b5fd9b64000 rwxp 00056000 00:1b 99624917   
/usr/lib64/libgmp.so.3.5.0
2b5fd9b64000-2b5fd9be7000 r-xp  00:1b 99625157   
/lib64/libm-2.12.so
2b5fd9be7000-2b5fd9de6000 ---p 00083000 00:1b 99625157   
/lib64/libm-2.12.so
2b5fd9de6000-2b5fd9de7000 r-xp 00082000 00:1b 99625157   
/lib64/libm-2.12.so
2b5fd9de7000-2b5fd9de8000 rwxp 00083000 00:1b 99625157   
/lib64/libm-2.12.so
2b5fd9de8000-2b5fd9de9000 rwxp 2b5fd9de8000 00:00 0
2b5fd9de9000-2b5fd9e0 r-xp  00:1b 99617779   
/lib64/libpthread-2.12.so
2b5fd9e0-2b5fda00 ---p 00017000 00:1b 99617779   
/lib64/libpthread-2.12.so
2b5fda00-2b5fda001000 r-xp 00017000 00:1b 99617779   
/lib64/libpthread-2.12.so
2b5fda001000-2b5fda002000 rwxp 00018000 00:1b 99617779   
/lib64/libpthread-2.12.so
2b5fda002000-2b5fda006000 rwxp 2b5fda002000 00:00 0
2b5fda006000-2b5fda18f000 r-xp  00:1b 99617771   
/lib64/libc-2.12.so
2b5fda18f000-2b5fda38f000 ---p 00189000 00:1b 99617771   
/lib64/libc-2.12.so
2b5fda38f000-2b5fda393000 r-xp 00189000 00:1b 99617771   
/lib64/libc-2.12.so
2b5fda393000-2b5fda394000 rwxp 0018d000 00:1b 99617771   
/lib64/libc-2.12.so
2b5fda394000-2b5fda39b000 rwxp 2b5fda394000 00:00 0
2b5fda40-2b5fda50 rwxp 2b5fda40 00:00 0
2b5fda50-2b5fda501000 ---p 2b5fda50 00:00 0
2b5fda501000-2b5fdaf01000 rwxp 2b5fda501000 00:00 0
2b5fdaf01000-2b5fdaf08000 r-xs  00:1b 99630484   
/usr/lib64/gconv/gconv-modules.cache
2b5fdaf08000-2b5fdaf0a000 r-xp  00:1b 99625937   
/usr/lib64/gconv/UTF-32.so
2b5fdaf0a000-2b5fdb109000 ---p 2000 00:1b 99625937   
/usr/lib64/gconv/UTF-3