summary refs log tree commit diff stats
path: root/results/scraper/launchpad/1527765
blob: 8baba7418ca40df8959171d4dd6e3ed2251f9c39 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
sh4: ghc randomly segfaults on qemu-sh4-static

Hello!

I am currently in the process of bootstrapping ghc for the Debian sh4 port and ran into a strange problem with qemu-sh4-static which randomly segfaults when running ghc to compile a Haskell source:

root@jessie32:~/ghc-7.8.4/utils/ghc-pwd# ls
Main.hi  Main.hs  Setup.hs  ghc-pwd.cabal  ghc.mk
root@jessie32:~/ghc-7.8.4/utils/ghc-pwd# ghc Main.hs
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault
root@jessie32:~/ghc-7.8.4/utils/ghc-pwd# ghc Main.hs
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault
root@jessie32:~/ghc-7.8.4/utils/ghc-pwd# ghc Main.hs
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault
root@jessie32:~/ghc-7.8.4/utils/ghc-pwd# ghc Main.hs
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault
root@jessie32:~/ghc-7.8.4/utils/ghc-pwd# ghc Main.hs
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
[1 of 1] Compiling Main             ( Main.hs, Main.o )
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault
root@jessie32:~/ghc-7.8.4/utils/ghc-pwd# ghc Main.hs
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
[1 of 1] Compiling Main             ( Main.hs, Main.o )
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault
root@jessie32:~/ghc-7.8.4/utils/ghc-pwd# ghc Main.hs
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
[1 of 1] Compiling Main             ( Main.hs, Main.o )
Bad interface file: /usr/local/lib/sh4-unknown-linux-gnu-ghc-7.10.3/time/dist-install/build/Data/Time/Format/Parse.hi
    ghc: panic! (the 'impossible' happened)
  (GHC version 7.10.3 for sh4-unknown-linux):
	getSymtabName:unknown known-key unique
<<details unavailable>>

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

root@jessie32:~/ghc-7.8.4/utils/ghc-pwd# ghc Main.hs
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
[1 of 1] Compiling Main             ( Main.hs, Main.o )
Linking Main ...
root@jessie32:~/ghc-7.8.4/utils/ghc-pwd#

As seen above, compiling a Haskell source code often results in a segfault but simply by retrying to run ghc over and over again, the compile process will eventually succeed and no segfault occurs.

I have created a tarball which contains the sh4 chroot from the example above which also includes ghc, gcc and the source code in question (in /root/ghc-7.8.4/utils/ghc-pwd). To test, it's probably a good idea to replace the qemu-sh4-static binary in /usr/bin with a current git snapshot (which I tried but didn't help).

> http://users.physik.fu-berlin.de/~glaubitz/sid-sh4-sbuild-ghc.tgz

In case anyone wants to try ghc with their own sh4 chroot, here's my version of ghc:

> https://people.debian.org/~glaubitz/sh4-unknown-linux-gnu-ghc-7.10.3.tar.gz

Just extract in the chroot of the sh4 chroot.

Please note, that it might be advisable on sh4 to apply the patches from these two bug reports as otherwise qemu-sh4-static won't work properly on sh4 and misses syscall 186:

> https://bugs.launchpad.net/ubuntu/+source/qemu-linaro/+bug/1254824
> https://bugs.launchpad.net/qemu/+bug/1516408

The above issue is reproducible with the two patches applied and without. It's also reproducible with both libc6 2.19 and 2.21 in the chroot. Thus, I am currently out of ideas what else to test.

Cheers,
Adrian

Thank you for the 611 MB tar....

The behavior is a little bit different on my system:

root@Quad:~# ls
ghc-7.8.4			  ghc_7.8.4-9~bpo8+1.dsc
ghc_7.8.4-9~bpo8+1.debian.tar.xz  ghc_7.8.4.orig.tar.xz
root@Quad:~# cd ghc-7.8.4/utils/ghc-p
ghc-pkg/ ghc-pwd/ 
root@Quad:~# cd ghc-7.8.4/utils/ghc-p
ghc-pkg/ ghc-pwd/ 
root@Quad:~# cd ghc-7.8.4/utils/ghc-pwd/
root@Quad:~/ghc-7.8.4/utils/ghc-pwd# ls
Main  Main.hi  Main.hs	Main.o	Setup.hs  ghc-pwd.cabal  ghc.mk
root@Quad:~/ghc-7.8.4/utils/ghc-pwd# ghc Main
Main     Main.hi  Main.hs  Main.o   
root@Quad:~/ghc-7.8.4/utils/ghc-pwd# ghc Main.hs
root@Quad:~/ghc-7.8.4/utils/ghc-pwd# ghc Main.hs
root@Quad:~/ghc-7.8.4/utils/ghc-pwd# ghc Main.hs
root@Quad:~/ghc-7.8.4/utils/ghc-pwd# ghc Main.hs
root@Quad:~/ghc-7.8.4/utils/ghc-pwd# ghc Main.hs
root@Quad:~/ghc-7.8.4/utils/ghc-pwd# ghc Main.hs
ghc: pthread_mutex_lock.c:80: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted (core dumped)

The emulated "tas.b" instruction is not atomic, this is why sometimes the locking fails...


Interestingly, cmake also seems to crash in a similar way:

- Log: https://buildd.debian.org/status/fetch.php?pkg=apt-cacher-ng&arch=sh4&ver=0.8.8-1&stamp=1450985460
- Log: https://buildd.debian.org/status/fetch.php?pkg=texworks&arch=sh4&ver=0.5~svn1363-6%2Bb1&stamp=1450992669
- Log: https://buildd.debian.org/status/fetch.php?pkg=x265&arch=sh4&ver=1.8-6&stamp=1450995672
- Log: https://buildd.debian.org/status/fetch.php?pkg=libwebsockets&arch=sh4&ver=1.6.0-2&stamp=1450997039

Maybe those are related?

Just tested with the latest git snapshot of qemu, still no improvement:

...
checking for gfind... no
checking for find... /usr/bin/find
checking for sort... /usr/bin/sort
checking for GHC Git commit id... given 4986837f8168cacf95c24fecc84d7b36c47f3c11
checking version of ghc... 8.0.1
ghc: pthread_mutex_lock.c:81: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.
qemu: uncaught target signal 6 (Aborted) - core dumped
ghc: pthread_mutex_lock.c:81: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.
qemu: uncaught target signal 6 (Aborted) - core dumped
ghc: pthread_mutex_lock.c:81: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.
qemu: uncaught target signal 6 (Aborted) - core dumped
Bootstrapping GHC is a cross compiler. This probably isn't going to work
checking build system type... sh4-unknown-linux-gnu
checking host system type... sh4-unknown-linux-gnu
checking target system type... sh4-unknown-linux-gnu
Build platform inferred as: sh4-unknown-linux
Host platform inferred as: sh4-unknown-linux
Target platform inferred as: sh4-unknown-linux
GHC build  : sh4-unknown-linux
GHC host   : sh4-unknown-linux
GHC target : sh4-unknown-linux
configure: Building in-tree ghc-pwd
(hangs here)

The QEMU project is currently considering to move its bug tracking to
another system. For this we need to know which bugs are still valid
and which could be closed already. Thus we are setting older bugs to
"Incomplete" now.

If you still think this bug report here is valid, then please switch
the state back to "New" within the next 60 days, otherwise this report
will be marked as "Expired". Or please mark it as "Fix Released" if
the problem has been solved with a newer version of QEMU already.

Thank you and sorry for the inconvenience.


[Expired for QEMU because there has been no activity for 60 days.]