darcs

Issue 979 2.0.2 configure on FreeBSD fails with "Couldnt figure out how to call GHC.Handle.openFd"

Title 2.0.2 configure on FreeBSD fails with "Couldnt figure out how to call GHC.Handle.openFd"
Priority not-our-bug Status resolved
Milestone Resolved in
Superseder Nosy List Serware, darcs-devel, dmitry.kurochkin, kowey, markstos, thorkilnaur, tommy
Assigned To
Topics Devel

Created on 2008-08-07.13:00:28 by markstos, last changed 2009-10-23.23:29:36 by admin.

Files
File name Uploaded Type Edit Remove
config.log markstos, 2008-08-07.13:14:24 application/octet-stream
Messages
msg5308 (view) Author: markstos Date: 2008-08-07.13:00:22
I tried to build the FreeBSD port of 2.0.2 on FreeBSD 6.2 today, it eventually
failed as given below. The same symptom appeared once before on Linux, and the
following thread documents patches available to address in the Debian bug
tracker.  I'm not sure of the current state of things. 

Thanks again to the developers for your work on darcs! In continues to be a 
valuable and enjoyable tool to use.

Reference:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=470376

####
checking for ghc... ghc
found The Glorious Glasgow Haskell Compilation System, version 6.8.2
checking whether to profile... no
checking whether to use the threaded runtime... yes
checking GHC.Handle.openFd... NOT old API
checking GHC.Handle.openFd new API... NOT 'new' API
checking GHC.Handle.fdToHandle' API... Segmentation fault (core dumped)
failed
configure: error: Couldnt figure out how to call GHC.Handle.openFd!
msg5309 (view) Author: kowey Date: 2008-08-07.13:07:55
Hi Mark, could you attach your config.log?
It seems to be a different issue than the one you posted in your link.
msg5310 (view) Author: markstos Date: 2008-08-07.13:14:24
Attaching config.log. I can also try again with 6.8.3, as another way to
potentially resolve the issue. I'm not sure if compatibility with 6.8.2 remains
important. 

Thanks for the blazing fast response, Eric!
Attachments
msg5311 (view) Author: kowey Date: 2008-08-07.13:20:51
If I understand the log correctly, the following test program segfaults when you
run it under FreeBSD (compiled via GHC 6.8.2, e.g. ghc --make conftest), is that
correct?

--conftest.hs
import GHC.Handle ( openFd )
import IO ( IOMode(..))

main = openFd 1 Nothing False "stdout" WriteMode True
msg5312 (view) Author: markstos Date: 2008-08-07.13:57:16
On Thu, 07 Aug 2008 13:20:54 -0000
Eric Kow <bugs@darcs.net> wrote:

> 
> Eric Kow <eric.kow@gmail.com> added the comment:
> 
> If I understand the log correctly, the following test program segfaults when you
> run it under FreeBSD (compiled via GHC 6.8.2, e.g. ghc --make conftest), is that
> correct?
> 
> --conftest.hs
> import GHC.Handle ( openFd )
> import IO ( IOMode(..))
> 
> main = openFd 1 Nothing False "stdout" WriteMode True

The result is this:

$ghc --make conftest
[1 of 1] Compiling Main             ( conftest.hs, conftest.o )

conftest.hs:1:20: Module `GHC.Handle' does not export `openFd'

####    

    Mark (who is compiling 6.8.3 now)
msg5314 (view) Author: kowey Date: 2008-08-07.14:00:34
Whoops! I meant

import GHC.Handle ( fdToHandle' )
import IO ( IOMode(..) )

main = fdToHandle' 1 Nothing False "stdout" WriteMode True
msg5315 (view) Author: markstos Date: 2008-08-07.14:05:13
On Thu, 07 Aug 2008 14:00:36 -0000
Eric Kow <bugs@darcs.net> wrote:

> 
> Eric Kow <eric.kow@gmail.com> added the comment:
> 
> Whoops! I meant
> 
> import GHC.Handle ( fdToHandle' )
> import IO ( IOMode(..) )
> 
> main = fdToHandle' 1 Nothing False "stdout" WriteMode True

Actually, that passed:

$ ghc --make conftest
[1 of 1] Compiling Main             ( conftest.hs, conftest.o )
Linking conftest ...

####

/me scratches head.
msg5317 (view) Author: kowey Date: 2008-08-07.14:06:08
And what happens when you run it?
msg5318 (view) Author: markstos Date: 2008-08-07.14:07:01
6.8.3 has finished the 'make' process now. I can proceed with 'make install',
but can keep 6.8.2 if it continues to be interesting to debug.
msg5320 (view) Author: markstos Date: 2008-08-07.14:28:39
> And what happens when you run it?

It produces no output, but doesn't otherwise "die" in any visible way.
msg5322 (view) Author: kowey Date: 2008-08-07.15:26:31
Weird:
- so you still segfault when configuring on GHC 6.8.2
- what about 6.8.3?
msg5323 (view) Author: kowey Date: 2008-08-07.15:28:18
Another thought, perhaps the segfaulting can be reproduced if you use the same
compile options as the configure script:
 ghc  -threaded  -optl-L/usr/local/lib -optl-L/usr/local/lib/ -optl-pthread -o
conftest conftest.hs
msg5324 (view) Author: markstos Date: 2008-08-07.15:34:56
On Thu, 07 Aug 2008 15:28:21 -0000
Eric Kow <bugs@darcs.net> wrote:

> 
> Eric Kow <eric.kow@gmail.com> added the comment:
> 
> Another thought, perhaps the segfaulting can be reproduced if you use the same
> compile options as the configure script:
>  ghc  -threaded  -optl-L/usr/local/lib -optl-L/usr/local/lib/ -optl-pthread -o
> conftest conftest.hs

Bingo. That compiles, but segfaults when I run it.

So, is there is more to test with 6.8.2 at this point, or should I proceed
with the upgrade to 6.8.3 (at which point, I doubt 6.8.2 will continue
to be available ).

Clearly it's a GHC/FreeBSD issue at this point and not a darcs bug.

    Mark
msg5326 (view) Author: kowey Date: 2008-08-07.15:37:28
Hurrah!  Please try with ghc 6.8.3

If it fails too, I guess we should bump this ticket up to Ian (by virtue of him
being a GHC guy).

Or maybe the GHC folks would just rather you filed a report on
  http://hackage.haskell.org/trac/ghc/report
msg5327 (view) Author: markstos Date: 2008-08-07.15:48:05
> Hurrah!  Please try with ghc 6.8.3
> 
> If it fails too, I guess we should bump this ticket up to Ian (by virtue of him
> being a GHC guy).
> 
> Or maybe the GHC folks would just rather you filed a report on
>   http://hackage.haskell.org/trac/ghc/report

It fails the same way with 6.8.3.

I compiled darcs 2.0.0 on the same machine with the 6.8.2 compiler, so maybe
something changed in darcs recently with triggered it, although it continues to
look like a GHC bug.

    Mark
msg5329 (view) Author: kowey Date: 2008-08-07.15:56:10
Hmm. Ticket filed, then:
  http://hackage.haskell.org/trac/ghc/ticket/2502

Adding Ian anyway.
msg5336 (view) Author: markstos Date: 2008-08-08.14:09:55
I think I've found the fix, but need to test it. There was a patch in the
FreeBSD port of 1.0.9 for what appears to the same issue. When the port was
updated for 2.0.0, the patches were removed the port. I believe this is because
it builds fine on FreeBSD 7.x. I suspect bringing those old patches back to life
for my 6.2 machime may fix it. 

Reference:
http://www.freshports.org/commit.php?category=devel&port=darcs&files=yes&message_id=200801041844.m04IiHSo034439@repoman.freebsd.org
msg5337 (view) Author: markstos Date: 2008-08-08.18:12:16
I looked at this a little more today, but couldn't recreate a patch to
autoconf.mk.in that applied cleanly. I was trying to put back this patch:

-GHCFLAGS         := @GHCFLAGS@ @CPPFLAGS@ @DEFS@
+GHCFLAGS         := -package containers @GHCFLAGS@ @CPPFLAGS@ @DEFS@

I don't really know what that does. I think I may stop at this point and wait
for feedback that I'm on the right track, or ask the FreeBSD port maintainer for
help.
msg5350 (view) Author: kowey Date: 2008-08-09.22:41:07
The use of -package containers does not seem particularly relevant here.

By the way, have you also tried building darcs from the darcs repository?
msg5373 (view) Author: markstos Date: 2008-08-11.13:35:18
> The use of -package containers does not seem particularly relevant here.
> 
> By the way, have you also tried building darcs from the darcs repository?

I have not. I'll consider that well. Thanks for the suggestion!

    Mark
msg5376 (view) Author: markstos Date: 2008-08-11.15:07:58
Building straight from the repo, actually worked cleanly and successfully, with
the exception that I had to tell the makefile that autoconf was named
"autoconf-2.61" on my system. 

That makes this squarely a FreeBSD packaging issue in my eyes. I have already
notified the package maintainer about this, and pointed him back to this ticket.
msg8290 (view) Author: kowey Date: 2009-08-19.11:45:57
If I understand correctly, this is no longer an issue since we've switched to
Cabal entirely.
History
Date User Action Args
2008-08-07 13:00:28markstoscreate
2008-08-07 13:07:57koweysetstatus: unread -> unknown
nosy: + kowey
messages: + msg5309
2008-08-07 13:14:28markstossetfiles: + config.log
nosy: tommy, beschmi, kowey, markstos, dagit, Serware
messages: + msg5310
2008-08-07 13:20:54koweysetnosy: tommy, beschmi, kowey, markstos, dagit, Serware
messages: + msg5311
2008-08-07 13:57:20markstossetnosy: tommy, beschmi, kowey, markstos, dagit, Serware
messages: + msg5312
2008-08-07 14:00:36koweysetnosy: tommy, beschmi, kowey, markstos, dagit, Serware
messages: + msg5314
2008-08-07 14:05:17markstossetnosy: tommy, beschmi, kowey, markstos, dagit, Serware
messages: + msg5315
2008-08-07 14:06:11koweysetnosy: tommy, beschmi, kowey, markstos, dagit, Serware
messages: + msg5317
2008-08-07 14:07:03markstossetnosy: tommy, beschmi, kowey, markstos, dagit, Serware
messages: + msg5318
2008-08-07 14:28:43markstossetnosy: tommy, beschmi, kowey, markstos, dagit, Serware
messages: + msg5320
2008-08-07 15:26:35koweysetnosy: tommy, beschmi, kowey, markstos, dagit, Serware
messages: + msg5322
2008-08-07 15:28:21koweysetnosy: tommy, beschmi, kowey, markstos, dagit, Serware
messages: + msg5323
2008-08-07 15:35:00markstossetnosy: tommy, beschmi, kowey, markstos, dagit, Serware
messages: + msg5324
2008-08-07 15:37:32koweysetnosy: tommy, beschmi, kowey, markstos, dagit, Serware
messages: + msg5326
2008-08-07 15:48:09markstossetnosy: tommy, beschmi, kowey, markstos, dagit, Serware
messages: + msg5327
2008-08-07 15:56:14koweysetpriority: urgent -> not-our-bug
nosy: + igloo
messages: + msg5329
2008-08-08 14:09:58markstossetnosy: tommy, beschmi, kowey, markstos, dagit, igloo, Serware
messages: + msg5336
2008-08-08 18:12:19markstossetnosy: tommy, beschmi, kowey, markstos, dagit, igloo, Serware
messages: + msg5337
2008-08-09 22:41:10koweysetnosy: tommy, beschmi, kowey, markstos, dagit, igloo, Serware
messages: + msg5350
2008-08-11 13:35:22markstossetnosy: tommy, beschmi, kowey, markstos, dagit, igloo, Serware
messages: + msg5373
2008-08-11 15:08:02markstossetnosy: tommy, beschmi, kowey, markstos, dagit, igloo, Serware
messages: + msg5376
2009-08-06 21:10:17adminsetnosy: + dmitry.kurochkin, simon, thorkilnaur, - beschmi
2009-08-11 00:19:44adminsetnosy: - dagit
2009-08-19 11:46:01koweysetstatus: unknown -> resolved
nosy: tommy, kowey, markstos, igloo, simon, thorkilnaur, dmitry.kurochkin, Serware
topic: + Devel, - Darcs2
messages: + msg8290
2009-08-25 17:18:37adminsetnosy: + darcs-devel, - igloo
2009-08-25 18:13:56adminsetnosy: - simon
2009-08-27 14:28:10adminsetnosy: tommy, kowey, markstos, darcs-devel, thorkilnaur, dmitry.kurochkin, Serware
2009-10-23 22:43:45adminsetnosy: + serware, - Serware
2009-10-23 23:29:36adminsetnosy: + Serware, - serware