Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 427838 - haskell/json - fails after [4 of 7] Compiling Text.JSON.Parsec ( Text/JSON/Parsec.hs, dist/build/Text/JSON/Parsec.o ) (no error message)
Summary: haskell/json - fails after [4 of 7] Compiling Text.JSON.Parsec ( Text/JSON/Pa...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo's Haskell Language team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-24 03:18 UTC by jinleileiking
Modified: 2012-12-26 07:51 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ghc741 build faild log (ghc741_build_failed,22.74 KB, text/plain)
2012-07-29 01:14 UTC, jinleileiking
Details
dev-haskell/json build log (dev-haskell_json-0.5_build.log,4.96 KB, text/plain)
2012-10-16 17:19 UTC, Peter Bleszynski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jinleileiking 2012-07-24 03:18:35 UTC
>>> Emerging (1 of 9) dev-haskell/json-0.5
 * json-0.5.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                                         [ ok ]
>>> Unpacking source...
>>> Unpacking json-0.5.tar.gz to /var/tmp/portage/dev-haskell/json-0.5/work
>>> Source unpacked in /var/tmp/portage/dev-haskell/json-0.5/work
>>> Preparing source in /var/tmp/portage/dev-haskell/json-0.5/work/json-0.5 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-haskell/json-0.5/work/json-0.5 ...
 * Using cabal-1.10.2.0.
/usr/bin/ghc -package Cabal-1.10.2.0 --make /var/tmp/portage/dev-haskell/json-0.5/work/json-0.5/Setup.hs -o setup
[1 of 1] Compiling Main             ( /var/tmp/portage/dev-haskell/json-0.5/work/json-0.5/Setup.hs, /var/tmp/portage/dev-haskell/json-0.5/work/json-0.5/Setup.o )
Linking setup ...
./setup configure --ghc --prefix=/usr --with-compiler=/usr/bin/ghc --with-hc-pkg=/usr/bin/ghc-pkg --prefix=/usr --libdir=/usr/lib64 --libsubdir=json-0.5/ghc-6.12.3 --datadir=/usr/share/ --datasubdir=json-0.5/ghc-6.12.3 --ghc-option=-optl-Wl,-O1 --ghc-option=-optl-Wl,--as-needed --disable-executable-stripping --docdir=/usr/share/doc/json-0.5 --verbose --flags=generic --flags=parsec --flags=pretty
Configuring json-0.5...
Flags chosen: mapdict=False, generic=True, pretty=True, parsec=True,
split-base=True
Dependency array -any: using array-0.3.0.1
Dependency base ==4.*: using base-4.2.0.2
Dependency bytestring -any: using bytestring-0.9.1.7
Dependency containers -any: using containers-0.3.0.0
Dependency mtl -any: using mtl-2.1.1
Dependency parsec -any: using parsec-3.1.3
Dependency pretty -any: using pretty-1.0.1.1
Dependency syb >=0.3.3: using syb-0.3.6.1
Using Cabal-1.10.2.0 compiled by ghc-6.12
Using compiler: ghc-6.12.3
Using install prefix: /usr
Binaries installed in: /usr/bin
Libraries installed in: /usr/lib64/json-0.5/ghc-6.12.3
Private binaries installed in: /usr/libexec
Data files installed in: /usr/share/json-0.5/ghc-6.12.3
Documentation installed in: /usr/share/doc/json-0.5
Using alex version 2.3.5 found on system at: /usr/bin/alex
Using ar found on system at: /usr/bin/ar
Using c2hs version 0.16.3 found on system at: /usr/bin/c2hs
No cpphs found
No ffihugs found
Using gcc version 4.5.3 found on system at: /usr/bin/gcc
Using ghc version 6.12.3 given by user at: /usr/bin/ghc
Using ghc-pkg version 6.12.3 given by user at: /usr/bin/ghc-pkg
No greencard found
No haddock found
Using happy version 1.18.2 found on system at: /usr/bin/happy
No hmake found
Using hsc2hs version 0.67 found on system at: /usr/bin/hsc2hs
No hscolour found
No hugs found
No jhc found
Using ld found on system at: /usr/bin/ld
No lhc found
No lhc-pkg found
No nhc98 found
Using pkg-config version 0.26 found on system at: /usr/bin/pkg-config
Using ranlib found on system at: /usr/bin/ranlib
Using strip found on system at: /usr/bin/strip
Using tar found on system at: /bin/tar
No uhc found
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-haskell/json-0.5/work/json-0.5 ...
./setup build
Preprocessing library json-0.5...
Building json-0.5...
[1 of 7] Compiling Text.JSON.Types  ( Text/JSON/Types.hs, dist/build/Text/JSON/Types.o )
[2 of 7] Compiling Text.JSON.Pretty ( Text/JSON/Pretty.hs, dist/build/Text/JSON/Pretty.o )
[3 of 7] Compiling Text.JSON.ReadP  ( Text/JSON/ReadP.hs, dist/build/Text/JSON/ReadP.o )
[4 of 7] Compiling Text.JSON.Parsec ( Text/JSON/Parsec.hs, dist/build/Text/JSON/Parsec.o )
 * ERROR: dev-haskell/json-0.5 failed (compile phase):
 *   setup build failed
 * 
 * Call stack:
 *     ebuild.sh, line   85:  Called src_compile
 *   environment, line 2616:  Called haskell-cabal_src_compile
 *   environment, line 1966:  Called cabal_src_compile
 *   environment, line  559:  Called cabal-build
 *   environment, line  417:  Called die
 * The specific snippet of code:
 *       ./setup "$@" || die "setup build failed"
 * 
 * If you need support, post the output of `emerge --info '=dev-haskell/json-0.5'`,
 * the complete build log and the output of `emerge -pqv '=dev-haskell/json-0.5'`.
 * The complete build log is located at '/var/tmp/portage/dev-haskell/json-0.5/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-haskell/json-0.5/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-haskell/json-0.5/work/json-0.5'
 * S: '/var/tmp/portage/dev-haskell/json-0.5/work/json-0.5'

>>> Failed to emerge dev-haskell/json-0.5, Log file:

>>>  '/var/tmp/portage/dev-haskell/json-0.5/temp/build.log'

 * Messages for package dev-haskell/json-0.5:

 * ERROR: dev-haskell/json-0.5 failed (compile phase):
 *   setup build failed
 * 
 * Call stack:
 *     ebuild.sh, line   85:  Called src_compile
 *   environment, line 2616:  Called haskell-cabal_src_compile
 *   environment, line 1966:  Called cabal_src_compile
 *   environment, line  559:  Called cabal-build
 *   environment, line  417:  Called die
 * The specific snippet of code:
 *       ./setup "$@" || die "setup build failed"
 * 
 * If you need support, post the output of `emerge --info '=dev-haskell/json-0.5'`,
 * the complete build log and the output of `emerge -pqv '=dev-haskell/json-0.5'`.
 * The complete build log is located at '/var/tmp/portage/dev-haskell/json-0.5/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-haskell/json-0.5/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-haskell/json-0.5/work/json-0.5'
 * S: '/var/tmp/portage/dev-haskell/json-0.5/work/json-0.5'
^[[A%                                                                                                                                                                      



➜  ~ git:(master) ✗ e pandoc

Password: 
Sorry, try again.
Password: 
sudo: 1 incorrect password attempt
➜  ~ git:(master) ✗ eix pandoc
* app-text/pandoc
     Available versions:  (~)1.8.1.1-r1!t (~)1.9.1.2 (~)1.9.2 (~)1.9.3 (~)1.9.4.1-r2!t {doc highlight hscolour pdf profile test}
     Homepage:            http://johnmacfarlane.net/pandoc
     Description:         Conversion between markup formats

[I] dev-haskell/pandoc-types
     Available versions:  ~1.8 (~)1.9.1 {doc hscolour profile}
     Installed versions:  1.9.1(10:49:47 AM 07/24/2012)(-doc -hscolour -profile)
     Homepage:            http://johnmacfarlane.net/pandoc
     Description:         Types for representing a structured document

Found 2 matches.
➜  ~ git:(master) ✗ epv pandoc

These are the packages that would be merged, in order:

Calculating dependencies \

... done!
[ebuild  N    ~] dev-haskell/json-0.5  USE="generic parsec pretty -doc -hscolour -profile" 0 kB
[ebuild  N    ~] dev-haskell/http-4000.2.3  USE="-doc -hscolour -profile -test" 0 kB
[ebuild  N    ~] dev-haskell/texmath-0.6.0.6  USE="-cgi -doc -hscolour -profile -test" 0 kB
[ebuild  N    ~] dev-haskell/blaze-markup-0.5.1.0  USE="-doc -hscolour -profile -test" 0 kB
[ebuild  N    ~] dev-haskell/regex-pcre-builtin-0.94.2.1.7.7  USE="-doc -hscolour -profile" 0 kB
[ebuild  N    ~] dev-haskell/blaze-html-0.5.0.0  USE="-doc -hscolour -profile -test" 0 kB
[ebuild  N    ~] dev-haskell/citeproc-hs-0.3.4  USE="bibutils network -doc -hscolour -profile" 0 kB
[ebuild  N    ~] dev-haskell/highlighting-kate-0.5.1  USE="-doc -executable -hscolour -pcre-light -profile" 0 kB
[ebuild  N    ~] app-text/pandoc-1.9.4.1-r2  USE="-doc -hscolour -profile -test" 0 kB

Total: 9 packages (9 new), Size of downloads: 0 kB

 * IMPORTANT: 8 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2012-07-24 19:56:14 UTC
Does not look good. Does 'dmesg' report any SIGSEGVs/OOM killers or something?
Comment 2 jinleileiking 2012-07-25 01:24:08 UTC
dmesg output:

[ 2679.749190] ghc invoked oom-killer: gfp_mask=0x280da, order=0, oom_adj=0, oom_score_adj=0
[ 2679.749194] ghc cpuset=/ mems_allowed=0
[ 2679.749197] Pid: 8524, comm: ghc Tainted: G           O 3.2.12-gentoo #12
[ 2679.749199] Call Trace:
[ 2679.749207]  [<ffffffff810969ec>] ? cpuset_print_task_mems_allowed+0x8c/0xa0
[ 2679.749213]  [<ffffffff810d507d>] dump_header.clone.7+0x7d/0x1c0
[ 2679.749218]  [<ffffffff8126ec52>] ? ___ratelimit+0x92/0x120
[ 2679.749221]  [<ffffffff810d538e>] oom_kill_process.clone.9+0x7e/0x290
[ 2679.749224]  [<ffffffff810d52b6>] ? oom_badness+0xf6/0x150
[ 2679.749226]  [<ffffffff810d5a9a>] out_of_memory+0x38a/0x4e0
[ 2679.749230]  [<ffffffff810d9877>] __alloc_pages_nodemask+0x797/0x7b0
[ 2679.749233]  [<ffffffff81064c00>] ? autoremove_wake_function+0x40/0x40
[ 2679.749239]  [<ffffffff8110ed74>] alloc_pages_vma+0x94/0x150
[ 2679.749245]  [<ffffffff810f4f8c>] handle_pte_fault+0x61c/0x820
[ 2679.749248]  [<ffffffff810f63eb>] handle_mm_fault+0x13b/0x240
[ 2679.749251]  [<ffffffff810f282f>] ? tlb_finish_mmu+0xf/0x40
[ 2679.749256]  [<ffffffff8163133b>] do_page_fault+0x17b/0x4b0
[ 2679.749259]  [<ffffffff8111356b>] ? kmem_cache_free+0x1b/0xf0
[ 2679.749262]  [<ffffffff810f8f29>] ? remove_vma+0x69/0x90
[ 2679.749264]  [<ffffffff810fa281>] ? do_munmap+0x2d1/0x360
[ 2679.749267]  [<ffffffff8162e42f>] page_fault+0x1f/0x30
[ 2679.749269] Mem-Info:
[ 2679.749271] Node 0 DMA per-cpu:
[ 2679.749273] CPU    0: hi:    0, btch:   1 usd:   0
[ 2679.749274] CPU    1: hi:    0, btch:   1 usd:   0
[ 2679.749276] CPU    2: hi:    0, btch:   1 usd:   0
[ 2679.749277] CPU    3: hi:    0, btch:   1 usd:   0
[ 2679.749278] Node 0 DMA32 per-cpu:
[ 2679.749280] CPU    0: hi:  186, btch:  31 usd:   0
[ 2679.749282] CPU    1: hi:  186, btch:  31 usd:   0
[ 2679.749283] CPU    2: hi:  186, btch:  31 usd:   0
[ 2679.749285] CPU    3: hi:  186, btch:  31 usd:   0
[ 2679.749286] Node 0 Normal per-cpu:
[ 2679.749288] CPU    0: hi:  186, btch:  31 usd:   0
[ 2679.749289] CPU    1: hi:  186, btch:  31 usd:   0
[ 2679.749291] CPU    2: hi:  186, btch:  31 usd:   0
[ 2679.749292] CPU    3: hi:  186, btch:  31 usd:   0
[ 2679.749296] active_anon:1662133 inactive_anon:295072 isolated_anon:0
[ 2679.749297]  active_file:54 inactive_file:88 isolated_file:0
[ 2679.749297]  unevictable:0 dirty:0 writeback:353 unstable:0
[ 2679.749298]  free:11897 slab_reclaimable:3470 slab_unreclaimable:5166
[ 2679.749299]  mapped:998 shmem:11844 pagetables:6444 bounce:0
[ 2679.749301] Node 0 DMA free:15892kB min:20kB low:24kB high:28kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15644kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:0kB slab_unreclaimable:8kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
[ 2679.749309] lowmem_reserve[]: 0 2661 7826 7826
[ 2679.749312] Node 0 DMA32 free:24328kB min:3844kB low:4804kB high:5764kB active_anon:2146840kB inactive_anon:536952kB active_file:32kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:2725000kB mlocked:0kB dirty:0kB writeback:372kB mapped:4kB shmem:24kB slab_reclaimable:0kB slab_unreclaimable:116kB kernel_stack:8kB pagetables:5924kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:48 all_unreclaimable? yes
[ 2679.749320] lowmem_reserve[]: 0 0 5165 5165
[ 2679.749323] Node 0 Normal free:7368kB min:7464kB low:9328kB high:11196kB active_anon:4501692kB inactive_anon:643336kB active_file:184kB inactive_file:352kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:5288960kB mlocked:0kB dirty:0kB writeback:1040kB mapped:3988kB shmem:47352kB slab_reclaimable:13880kB slab_unreclaimable:20540kB kernel_stack:1776kB pagetables:19852kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:21548 all_unreclaimable? yes
[ 2679.749331] lowmem_reserve[]: 0 0 0 0
[ 2679.749333] Node 0 DMA: 1*4kB 0*8kB 1*16kB 0*32kB 2*64kB 1*128kB 1*256kB 0*512kB 1*1024kB 1*2048kB 3*4096kB = 15892kB
[ 2679.749341] Node 0 DMA32: 27*4kB 26*8kB 18*16kB 10*32kB 5*64kB 2*128kB 2*256kB 2*512kB 3*1024kB 3*2048kB 3*4096kB = 24540kB
[ 2679.749347] Node 0 Normal: 866*4kB 4*8kB 1*16kB 1*32kB 1*64kB 1*128kB 1*256kB 1*512kB 1*1024kB 1*2048kB 0*4096kB = 7576kB
[ 2679.749354] 17336 total pagecache pages
[ 2679.749355] 5309 pages in swap cache
[ 2679.749357] Swap cache stats: add 173494, delete 168185, find 22076/25071
[ 2679.749359] Free swap  = 0kB
[ 2679.749360] Total swap = 522076kB
[ 2679.771510] 2080752 pages RAM
[ 2679.771512] 87647 pages reserved
[ 2679.771513] 9252 pages shared
[ 2679.771514] 1972269 pages non-shared
[ 2679.771516] [ pid ]   uid  tgid total_vm      rss cpu oom_adj oom_score_adj name
[ 2679.771527] [ 1183]     0  1183     4389        2   2     -17         -1000 udevd
[ 2679.771530] [ 1672]     0  1672     4546        1   0       0             0 mount.ntfs-3g
[ 2679.771533] [ 1675]     0  1675     4546        0   3       0             0 mount.ntfs-3g
[ 2679.771536] [ 2026]     0  2026     4388        8   0     -17         -1000 udevd
[ 2679.771538] [ 2351]     0  2351     7077       16   1       0             0 wpa_supplicant
[ 2679.771541] [ 2424]   101  2424     4881        0   1       0             0 dbus-daemon
[ 2679.771544] [ 2438]     0  2438     5635        8   1       0             0 syslog-ng
[ 2679.771547] [ 2439]     0  2439    14052       47   1       0             0 syslog-ng
[ 2679.771550] [ 2453]     0  2453    31306       36   2       0             0 console-kit-dae
[ 2679.771553] [ 2532]     0  2532    32160        0   3       0             0 polkitd
[ 2679.771556] [ 2708]     0  2708     2108       23   3       0             0 dhcpcd
[ 2679.771559] [ 3278]     0  3278     4388        0   0     -17         -1000 udevd
[ 2679.771562] [ 3415]     0  3415     2108       20   2       0             0 dhcpcd
[ 2679.771564] [ 3564]     0  3564    17250        1   2       0             0 login
[ 2679.771567] [ 3565]     0  3565     4841        1   2       0             0 agetty
[ 2679.771570] [ 3566]     0  3566     4841        1   1       0             0 agetty
[ 2679.771572] [ 3567]     0  3567     4841        1   3       0             0 agetty
[ 2679.771576] [ 3568]     0  3568     4841        1   0       0             0 agetty
[ 2679.771579] [ 3569]     0  3569     4841        1   2       0             0 agetty
[ 2679.771581] [ 3577]  1000  3577     3568        1   0       0             0 startx
[ 2679.771584] [ 3595]  1000  3595     3954        0   0       0             0 xinit
[ 2679.771587] [ 3596]  1000  3596    36054     1518   3       0             0 X
[ 2679.771590] [ 3641]  1000  3641     3173        0   0       0             0 ck-launch-sessi
[ 2679.771593] [ 3693]  1000  3693    40626     1787   2       0             0 awesome
[ 2679.771596] [ 3696]  1000  3696     6602        0   1       0             0 dbus-launch
[ 2679.771599] [ 3697]  1000  3697     4874       40   0       0             0 dbus-daemon
[ 2679.771602] [ 3700]  1000  3700   102749     1214   3       0             0 terminator
[ 2679.771604] [ 3706]  1000  3706   155074     3374   0       0             0 chrome
[ 2679.771607] [ 3708]  1000  3708    20394      114   3       0             0 python2.7
[ 2679.771611] [ 3714]  1000  3714    53039      144   0       0             0 fcitx
[ 2679.771613] [ 3728]  1000  3728    55742       82   1       0             0 chrome
[ 2679.771616] [ 3730]  1000  3730     1565        0   0       0             0 chrome-sandbox
[ 2679.771619] [ 3731]  1000  3731    63159      129   3       0             0 chrome
[ 2679.771622] [ 3750]  1000  3750    30526        0   0       0             0 nacl_helper_boo
[ 2679.771625] [ 3772]  1000  3772     3643        2   3       0             0 gnome-pty-helpe
[ 2679.771628] [ 3773]  1000  3773    10621      393   0       0             0 zsh
[ 2679.771631] [ 3820]  1000  3820   209512      951   2       4           300 chrome
[ 2679.771634] [ 3827]  1000  3827   207463     1083   1       4           300 chrome
[ 2679.771637] [ 3833]  1000  3833   208568     1214   3       4           300 chrome
[ 2679.771640] [ 3858]  1000  3858    72479       78   0       3           200 chrome
[ 2679.771643] [ 6069]  1000  6069   245199    20239   0       4           300 chrome
[ 2679.771645] [ 6089]  1000  6089    85657      565   1       1           100 chrome
[ 2679.771648] [ 6092]  1000  6092    14853      125   3       0             0 rdesktop
[ 2679.771651] [ 6114]  1000  6114   211028     1326   1       4           300 chrome
[ 2679.771654] [ 8155]     0  8155     9641       86   2       0             0 sudo
[ 2679.771657] [ 8156]     0  8156    42315    16707   0       0             0 emerge
[ 2679.771659] [ 8500]     0  8500     1030       35   3       0             0 sandbox
[ 2679.771662] [ 8501]     0  8501     6752      549   1       0             0 ebuild.sh
[ 2679.771665] [ 8518]     0  8518     6752      553   1       0             0 ebuild.sh
[ 2679.771668] [ 8523]     0  8523     8775     1495   0       0             0 setup
[ 2679.771671] [ 8524]     0  8524  1974545  1887059   0       0             0 ghc
[ 2679.771674] [ 8549]  1000  8549     9793      936   0       0             0 zsh
[ 2679.771676] Out of memory: Kill process 8524 (ghc) score 893 or sacrifice child
[ 2679.771679] Killed process 8524 (ghc) total-vm:7898180kB, anon-rss:7548128kB, file-rss:108kB
Comment 3 jinleileiking 2012-07-25 01:24:40 UTC
It occupied my 8g ram !!!!!!!!!!!!!!!!!!!!!!!!!!!!
Comment 4 jinleileiking 2012-07-25 01:24:58 UTC
➜  ~ git:(master) ✗ free
             total       used       free     shared    buffers     cached
Mem:       7972424     568100    7404324          0      18188     168624
-/+ buffers/cache:     381288    7591136
Swap:       522076     235428     286648
Comment 5 jinleileiking 2012-07-27 07:31:45 UTC
not a buggie?
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2012-07-28 12:07:44 UTC
Might be a ghc bug due to integer overflow in garbage collector.

Can you try unstable 7.4.1 one and check if it still fails for you?
I'm afraid that's a major upgrade.
Comment 7 jinleileiking 2012-07-29 01:14:59 UTC
Created attachment 319584 [details]
ghc741 build faild log
Comment 8 jinleileiking 2012-07-29 01:16:21 UTC
➜  ~ git:(master) ✗ epv ghc

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U ~] dev-lang/ghc-7.4.1-r1 [6.12.3-r2] USE="-binary -doc -ghcbootstrap -llvm% (-bash-completion%)" 0 kB

Total: 1 package (1 upgrade), Size of downloads: 0 kB

 * IMPORTANT: 8 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.
Comment 9 Sergei Trofimovich (RETIRED) gentoo-dev 2012-07-29 06:36:08 UTC
Can you post a dmesg output for it as well?
I'm interested hot much memory ghc managged to chew this time.

Can you also give memtest a try anf check if your RAM is healthy?
Comment 10 Aaron Webster 2012-07-29 10:32:43 UTC
I also have this problem.  Attempting to emerge dev-haskell/json-0.4.4 stalls on 

[4 of 7] Compiling Text.JSON.Parsec ( Text/JSON/Parsec.hs, 
dist/build/Text/JSON/Parsec.o )

it sits there until it eats up about 90% of my memory (~8GB), then I get scared and kill the process.
Comment 11 Aaron Webster 2012-07-29 10:33:50 UTC
Forgot to mention, I've seen this problem on two computers so far, so it's certainly not a ram health issue.
Comment 12 Sergei Trofimovich (RETIRED) gentoo-dev 2012-07-29 11:45:56 UTC
aha. what if you try to limit about of memory by booting kernel with mem= ?

Like, say mem=1G

        mem=nn[KMG]     [KNL,BOOT] Force usage of a specific amount of memory
                        Amount of memory to be used when the kernel is not able
                        to see the whole system memory or for test.
                        [X86-32] Use together with memmap= to avoid physical
                        address space collisions. Without memmap= PCI devices
                        could be placed at addresses belonging to unused RAM.
Comment 13 jinleileiking 2012-07-29 12:30:22 UTC
[ 5512.822468] ghc-stage1[5376] general protection ip:c10d34 sp:7fffb980c088 error:0 in ghc-stage1[400000+19ba000]
Comment 14 jinleileiking 2012-07-29 12:31:07 UTC
(In reply to comment #13)
> [ 5512.822468] ghc-stage1[5376] general protection ip:c10d34 sp:7fffb980c088
> error:0 in ghc-stage1[400000+19ba000]

This is dmesg output
Comment 15 Peter Bleszynski 2012-10-16 17:18:13 UTC
When trying to emerge pandoc, dev-haskell/json also fails after step [4 of 7]. I tested both the gentoo and haskell overlays. The process consumes 100% CPU and about 70-90% RAM until killed. dmesg reports a ghc segfault.

ghc[25492]: segfault at 1b5e681 ip 0000000001b5e681 sp 00007ffff8de3d80 error 15 in ghc[1b3c000+1d1000]

I was also trying to emerge pandoc. No previous haskell packages were installed. The system is a late 2011 iMac with 8GB RAM, runs amd64, and has no known hardware issues.

emerge pandoc successfully builds the following packages before hitting dev-haskell/json:

dev-lang:ghc-6.12.3-r2
app-admin:haskell-updater-1.2.0.5-r1
dev-haskell:cabal-1.14.0
dev-haskell:syb-0.3.7
dev-haskell:utf8-string-0.3.7
dev-haskell:time-1.2.0.3
dev-haskell:pandoc-types-1.9.1
dev-haskell:zlib-0.5.3.3
dev-haskell:base64-bytestring-1.0.0.0
dev-haskell:extensible-exceptions-0.1.1.4
dev-haskell:temporary-1.1.2.4
dev-haskell:binary-0.5.1.0
dev-haskell:digest-0.0.1.1
dev-haskell:deepseq-1.3.0.0
dev-haskell:dlist-0.5
dev-haskell:transformers-0.3.0.0
dev-haskell:hs-bibutils-4.15
dev-haskell:mtl-2.1.1
dev-haskell:text-0.11.2.2
dev-haskell:data-default-0.5.0
dev-haskell:random-1.0.1.1
dev-haskell:parsec-3.1.3
dev-haskell:xml-1.3.12
dev-haskell:blaze-builder-0.3.1.0
dev-haskell:tagsoup-0.12.8
dev-haskell:zip-archive-0.1.1.8
dev-haskell:regex-base-0.93.2
dev-haskell:network-2.3.0.14


ps showing the ghc process running for 11 hours:

root     24920 99.4 67.3 26417756 11063560 pts/2 Rl Oct15 661:44 /usr/lib64/ghc-6.12.3/ghc -B/usr/lib64/ghc-6.12.3 --make -package-name json-0.5 -hide-all-packages -fbuilding-cabal-package -no-user-package-conf -i -idist/build -i. -idist/build/autogen -Idist/build/autogen -Idist/build -optP-DBASE_4 -optP-include -optPdist/build/autogen/cabal_macros.h -odir dist/build -hidir dist/build -stubdir dist/build -package-id array-0.3.0.1-d386e6865e2443d798e250f58dda005d -package-id base-4.2.0.2-d09520f27d14dc38c6981fa942393083 -package-id bytestring-0.9.1.7-253db8fad875ae549d30aec0d8553adf -package-id containers-0.3.0.0-7be04792060ce1514c52e2cb13a5c18a -package-id mtl-2.1.1-a9e24d65906536a27ac045c961e9b46c -package-id parsec-3.1.3-28e3e3faab28ba67b0ab47cc5bdffde6 -package-id pretty-1.0.1.1-b6652d4fb1f996119a76dcaa986e9d70 -package-id syb-0.3.7-70e6673dba1eb6d1f3e4aee55a796e37 -O -Wall -O2 Text.JSON.Generic Text.JSON.Parsec Text.JSON.Pretty Text.JSON Text.JSON.Types Text.JSON.String Text.JSON.ReadP -optl-Wl,-O1 -optl-Wl,--as-needed
Comment 16 Peter Bleszynski 2012-10-16 17:19:43 UTC
Created attachment 326712 [details]
dev-haskell/json build log
Comment 17 Aaron Webster 2012-11-01 12:22:12 UTC
I have the same problem on my system.  Upon reaching "[4 of 7] Compiling Text.JSON.Parsec" ghc consumes all of the available system memory until my system becomes unresponsive or the process is killed.  I tried Sergei Trofimovich's suggestion of adding GHCRTS='-M2G' to my shell variables, but this results in the process being terminated with a "Memory Exhausted" error.

Adding 

dev-haskell/json -parsec

to my /etc/portage/package.use can temporarily solve the problem by avoiding parsec, but as some packages rely on it, it's not really a fix.
Comment 18 Sergei Trofimovich (RETIRED) gentoo-dev 2012-12-05 10:25:32 UTC
@all

Do you have a chance to test against ghc-7.4.2?
Comment 19 Sergei Trofimovich (RETIRED) gentoo-dev 2012-12-16 14:19:40 UTC
(In reply to comment #18)
> @all
> 
> Do you have a chance to test against ghc-7.4.2?

haskell overlay also has ghc-7.6.1. would be interesting
to see if it can reproduce the error as well.
Comment 20 Sergei Trofimovich (RETIRED) gentoo-dev 2012-12-26 07:51:36 UTC
Pushed workaround as:

> 26 Dec 2012; Sergei Trofimovich <slyfox@gentoo.org> json-0.4.3.ebuild,
> json-0.4.4.ebuild, json-0.5.ebuild, json-0.7.ebuild:
> Workaround bug #427838 where ghc-6.12.3 hangs building Text.JSON.Parsec by
> jinleileiking@gmail.com and others.

Thank you!