Using: dev-lang/ghc-6.10.4-r1 Segfaults when running cghi ~ $ ghci GHCi, version 6.10.4: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. Segmentation fault dmesg: [ 4723.424345] ghc[26382]: segfault at 0 ip 000000000138727a sp 00007fff043ab2f0 error 4 in ghc[400000+10e5000] [ 4725.844480] ghc[26385]: segfault at 0 ip 000000000138727a sp 00007fff1ef10e20 error 4 in ghc[400000+10e5000] Reproducible: Always
Created attachment 218935 [details] emerge --info
Created attachment 218937 [details] locale I noticed that the bugs for stabile packages mention this information
Please, try to build packages with symbols (add -ggdb into CFLAGS and split debug into FEATURES) and get backtrace as explained here: http://www.gentoo.org/proj/en/qa/backtraces.xml BTW, drop -fomit-frame-pointer from CFLAGS since it useless on amd64.
(In reply to comment #3) > Please, try to build packages with symbols (add -ggdb into CFLAGS and split > debug into FEATURES) and get backtrace as explained here: > http://www.gentoo.org/proj/en/qa/backtraces.xml > > BTW, drop -fomit-frame-pointer from CFLAGS since it useless on amd64. > Okay, I removed the fomit-frame-pointer (thanks by the way) and added -ggdb to my CFLAGS and recompiled. It seems like the /usr/bin/ghci and /usr/bin/ghc are shell scripts. Therefore I tried gdb /usr/lib64/ghc-6.10.4/ghc which gave me: Reading symbols from /usr/lib64/ghc-6.10.4/ghc...(no debugging symbols found)...done. So I guess I am doing something wrong. Do you want me to compile it in a different way (now I change the main CFLAGS in the /etc/make.conf file)?
Please, take a look at link I gave you. It provides all required information. Have you added splitdebug into FEATURES? If you failed to do that portage will strip symbols.
(In reply to comment #5) > Please, take a look at link I gave you. It provides all required information. > Have you added splitdebug into FEATURES? If you failed to do that portage will > strip symbols. > I have this in my /etc/make.conf file CFLAGS="-march=native -O2 -ggdb" CXXFLAGS="${CFLAGS}" FEATURES="splitdebug" # to keep the info This are my debug files ~ $ find /usr/lib/debug/ | grep ghc /usr/lib/debug/usr/lib64/ghc-6.10.4 /usr/lib/debug/usr/lib64/ghc-6.10.4/unlit.debug Here is what gdb looks like: gdb /usr/lib64/ghc-6.10.4/ghc warning: Can not parse XML syscalls information; XML support was disabled at compile time. GNU gdb (Gentoo 7.0 p1) 7.0 Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". For bug reporting instructions, please see: <http://bugs.gentoo.org/>... Reading symbols from /usr/lib64/ghc-6.10.4/ghc...(no debugging symbols found)...done. (gdb) ------- I did the same test of dia (another program I built later with the same settings (CFLAGS and FEATURES); this is what I got ~ $ find /usr/lib/debug/ | grep dia /usr/lib/debug/usr/lib64/dia /usr/lib/debug/usr/lib64/dia/libdia.so.debug /usr/lib/debug/usr/lib64/dia/libstandard_objects.so.debug /usr/lib/debug/usr/lib64/dia/libnetwork_objects.so.debug /usr/lib/debug/usr/lib64/dia/libuml_objects.so.debug /usr/lib/debug/usr/lib64/dia/liber_objects.so.debug /usr/lib/debug/usr/lib64/dia/libfs_objects.so.debug /usr/lib/debug/usr/lib64/dia/libflowchart_objects.so.debug /usr/lib/debug/usr/lib64/dia/libcustom_objects.so.debug /usr/lib/debug/usr/lib64/dia/libcustom_lines_objects.so.debug /usr/lib/debug/usr/lib64/dia/libgrafcet_objects.so.debug .... /usr/lib/debug/usr/bin/dia.debug gdb /usr/bin/dia warning: Can not parse XML syscalls information; XML support was disabled at compile time. GNU gdb (Gentoo 7.0 p1) 7.0 Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". For bug reporting instructions, please see: <http://bugs.gentoo.org/>... Reading symbols from /usr/bin/dia...Reading symbols from /usr/lib64/debug/usr/bin/dia.debug...done. (no debugging symbols found)...done. (gdb)
(In reply to comment #6) > I have this in my /etc/make.conf file > CFLAGS="-march=native -O2 -ggdb" > CXXFLAGS="${CFLAGS}" > FEATURES="splitdebug" # to keep the info I think the -ggdb in your CFLAGS might be the problem here; at times ghc does mangling of GCC output, and the inclusion of debugger output from GCC might be cauusing the GHC build process to do something wrong... Of course, I might have no idea what I'm talking about, since my knowledge of GCC internals and what GHC does with them are minimal...
(In reply to comment #7) > (In reply to comment #6) > > I have this in my /etc/make.conf file > > CFLAGS="-march=native -O2 -ggdb" > > CXXFLAGS="${CFLAGS}" > > FEATURES="splitdebug" # to keep the info > > I think the -ggdb in your CFLAGS might be the problem here; at times ghc does > mangling of GCC output, and the inclusion of debugger output from GCC might be > cauusing the GHC build process to do something wrong... > I do not know if I understood you correctly, because I originally got the segfault with these cflags: CFLAGS="-march=core2 -msse4.1 -O2 -pipe -fomit-frame-pointer" I change those to CFLAGS="-march=native -O2 -ggdb" for the debugging reasons. (I get segfault here as well).
dev-lang/ghc-6.10.4-r1 strips symbols (see bug 299492) that's why you are unable to get backtrace... That said, it looks like currently stable version 6.8.2-r1 does not have such bug. You could try to reproduce failure there.
(In reply to comment #9) > dev-lang/ghc-6.10.4-r1 strips symbols (see bug 299492) that's why you are > unable to get backtrace... That said, it looks like currently stable version > 6.8.2-r1 does not have such bug. You could try to reproduce failure there. > I tried the stable package first but was unable to compile, even after following the workaround found in the other bug reports: LC_ALL=C emerge ghc Maybe we should close this, and I will file a new bugreport for ghc-6.8.2-r1? (where I describe my problems to compile)
I tried again after cleaning a bit in my system and it worked fine! Emerging (1 of 2) dev-lang/ghc-6.10.4-r1 >>> Installing (1 of 2) dev-lang/g-6.10.4-r1 >>> Recording dev-lang/ghc in "world" favoritefile... I am starting to think that my haskell problems stems from my bad "locals" (character set). Howerver, is there anything I can provide that would help or should we close this.
Created attachment 228889 [details] emerge --info for system that works (compiles correctly)
We had problems with portage wrongly stripping HSffi.o module in ghc-6.12 branch, but not in ghc-6.10.x. (It might be upstream problem http://hackage.haskell.org/trac/ghc/ticket/3580) Niklas, can you locally patch your ebuild by adding following line to ghc-6.10.4-r1 ebuild: STRIP_MASK="*/HSffi.o" (you can look at ghc-6.12.3 to find exact place to plug this thing in) and verify it cures the problem comparing to unpatched one? Strace logs of SEGVing ghci are highly appreciated: $ strace -oghci-failure.log ghci -v
(In reply to comment #13) > We had problems with portage wrongly stripping HSffi.o module in ghc-6.12 > branch, but not in ghc-6.10.x. (It might be upstream problem > http://hackage.haskell.org/trac/ghc/ticket/3580) > > Niklas, can you locally patch your ebuild by adding following line to > ghc-6.10.4-r1 ebuild: > > STRIP_MASK="*/HSffi.o" > > (you can look at ghc-6.12.3 to find exact place to plug this thing in) > and verify it cures the problem comparing to unpatched one? > > > Strace logs of SEGVing ghci are highly appreciated: > > $ strace -oghci-failure.log ghci -v > Hey, I did the following: Deleted ghc-6.12.x Changed the .ebuild including the MASK as you wrote Emerged ghc-6.10.x successfully Staced it (I am a bit unsure if I did this correctly) Deleted ghc-6.10.x Changed the .ebuild back to be without MASK Emerged ghc-6.10.x successfully Deleted ghc-6.10.x Removed my ccache option Emerged ghc-6.10.x successfully --- So it seems that I can no longer reproduce the error, with or without MASK.
Created attachment 239379 [details] strace log file
Created attachment 239381 [details] emerge --info for working (with and without MASK for ghc-6.10.x)
Heh, you were expected to attach ghci-failure.log for SEGVing case, but if you can't reproduce the failure any more we don't need the log. Maybe portage changed stripping heuristics a little since that time or something was fixed in the toolchain. I'm closing it as WORKSFORME. Please reopen (or create another ticket if it's handier) if you will be able to reproduce an error. We will try to explore the crash in more detail then. Thank you for the feedback.
Thank you for your time and effort. Sorry I couldn't reproduce it anymore.