Beware: Bad I/O performance on Windows without -threaded

2010-12-21 Thread Simon Marlow
I just noticed that I/O performane on Windows without -threaded is pretty terrible. The following program: main = getConetnts >>= putStr tested with a 1MB file: $ rm cat.exe; ghc-7.0.1 --make -rtsopts cat.hs $ ./cat <1M >/dev/null +RTS -s Total time0.28s ( 0.49s elapsed) But if we

Re: build issue: * Missing header file: HsBase.h

2010-12-16 Thread Simon Marlow
On 10/12/2010 16:49, Karel Gardas wrote: Hello, I'm trying to recover my opensolaris builder machine after disk crash, but after reinstall I'm not able to build any GHC there. I'm trying head and now also 6.12.3 as a reference (as I'm able to build it on my workstation with the same OS). The pro

Re: [Haskell-cafe] Printing of asynchronous exceptions to stderr

2010-12-16 Thread Simon Marlow
On 07/12/2010 21:30, Mitar wrote: Hi! On Wed, Dec 1, 2010 at 10:50 AM, Simon Marlow wrote: Yes, but semantics are different. I want to tolerate some exception because they are saying I should do this and this (for example user interrupt, or timeout) but I do not want others, which somebody

Re: Oversized libraries

2010-12-14 Thread Simon Marlow
On 14/12/2010 16:33, Audrius Šaikūnas wrote: Hello, I've noticed that libraries that are compiled even with -dynamic are really huge: libHScairo-0.12.0-ghc6.12.1.so - 1.4 M libHSgio-0.12.0-ghc6.12.1.so - 1.6 M libHSgtk-0.12.0-ghc6.12.1.so - 14 M (ldd confirms that these libraries are really lin

New flag in GHC 7.0.1: --with-rtsopts

2010-12-09 Thread Simon Marlow
It seems we forgot to mention in the 7.0.1 release notes that there's a new compile-time flag, --with-rtsopts. From the documentation: 4.16.8. Linker flags to change RTS behaviour GHC lets you exercise rudimentary control over the RTS settings for any given program, by using the -with-rtsopt

Re: New codegen failing test-cases

2010-12-09 Thread Simon Marlow
On 09/12/2010 04:42, Edward Z. Yang wrote: Final status report for tonight, before I crash in bed; I've managed to make it compile all the way to hoopl. It seems like hoopl doesn't typecheck anymore? I haven't been following the typechecker changes too closely so some guidance would be appreciate

Re: [darcs-users] How to develop on a (GHC) branch with darcs

2010-12-09 Thread Simon Marlow
On 08/12/2010 17:39, Yitzchak Gale wrote: Some of those are already in the works, and all except possibly (5) are known to be within reach. So the answer is yes, this problem is now on the verge of being solved in Darcs. I think that might be a little overoptimistic. The fundamental problem

Re: New codegen failing test-cases

2010-12-08 Thread Simon Marlow
I did a bit more merging of your branch. My current state is here: http://darcs.haskell.org/ghc-cmm-15Sep10/ it doesn't actually build, but the failure is somewhere in hoopl I think. This branch is 400-odd patches behind the current HEAD. I don't think I borked anything too badly during the

Re: How to develop on a (GHC) branch with darcs

2010-12-07 Thread Simon Marlow
On 06/12/2010 01:57, Iavor Diatchki wrote: Hello, I am doing some work on a GHC branch and I am having a lot of troubles (and spending a lot of time) trying to keep my branch up to date with HEAD, so I would be very grateful for any suggestions by fellow developers of how I might improve the pro

Re: [Haskell-cafe] Printing of asynchronous exceptions to stderr

2010-12-02 Thread Simon Marlow
On 13/11/2010 19:08, Bit Connor wrote: On Wed, Nov 10, 2010 at 5:48 PM, Simon Marlow wrote: [...] So we should say there are a few things that you can do that guarantee not to call any interruptible operations: - IORef operations - STM transactions that do not use retry - everything

Re: [Haskell-cafe] Printing of asynchronous exceptions to stderr

2010-12-01 Thread Simon Marlow
On 01/12/2010 03:02, Mitar wrote: Hi! On Thu, Nov 18, 2010 at 2:19 PM, Simon Marlow wrote: then it isn't uninterruptible, because the timeout can interrupt it. If you can tolerate a timeout exception, then you can tolerate other kinds of async exception too. Yes, but semantic

Re: Problems with openFd and -threaded

2010-11-30 Thread Simon Marlow
nfirmed that this is a bug, I'm just looking for a ticket number or a version where it's fixed. And fix it I did: Wed Jan 27 11:46:00 GMT 2010 Simon Marlow * check for EINTR in openFd M ./System/Posix/Error.hs -2 +26 M ./System/Posix/IO.hsc -1 +1 The fix is in unix

Re: SpecConstr number of specializations (-fspec-constr-count)

2010-11-29 Thread Simon Marlow
On 25/11/2010 20:01, Roman Leshchinskiy wrote: On 25/11/2010, at 10:33, José Pedro Magalhães wrote: Is this a bug, or is the value of spec-constr-count being manipulated in some way for certain passes? spec-constr-count decreases for nested specialisations. For instance, if spec-constr-count

Re: Documentation of System.Process

2010-11-29 Thread Simon Marlow
On 26/11/2010 10:00, Jean-Marie Gaillourdet wrote: Hi all, I've been searching information regarding file handles to pipes created by System.Process.createProcess. The documentation does not state whether they are in binary mode, i.e. whether they have line ending conversion or an encoding en

Re: How to activate DEBUG in Data.HashTable?

2010-11-29 Thread Simon Marlow
On 29/11/2010 02:05, Wolfram Kahl wrote: Hello, with a large Agda development, I have a reproducible segmentation fault that I have been able to localise to the serialisation (Agda.TypeChecking.Serialise.encode), which heavily relies on Data.HashTable. Now I find that Data.HashTable (from GH

Re: Eq instance for Chan

2010-11-25 Thread Simon Marlow
On 25/11/2010 00:48, Mitar wrote: Why is there no Eq instance for Chan? There is Eq for MVar so it is quite possible to define also Eq for Chan? It's just an oversight. Send us a patch, or make a ticket for it? Cheers, Simon ___ Glasgow-has

Re: libffi was:Re: ANNOUNCE: GHC version 7.0.1

2010-11-25 Thread Simon Marlow
On 18/11/2010 18:21, Tyson Whitehead wrote: On November 18, 2010 05:12:11 Simon Marlow wrote: On 17/11/2010 14:34, Christian Maeder wrote: ghc can be built without and with libffi. Which build option are you referring to here? libffi is required for FFI support in GHCi, and for FFI "wr

Re: [Haskell-cafe] Printing of asynchronous exceptions to stderr

2010-11-18 Thread Simon Marlow
On 18/11/2010 11:31, Mitar wrote: Hi! On Wed, Nov 17, 2010 at 12:00 PM, Simon Marlow wrote: That's hard to do, because the runtime system has no knowledge of exception types, and I'm not sure I like the idea of baking that knowledge into the RTS. But currently it does have a kn

Re: libffi was:Re: ANNOUNCE: GHC version 7.0.1

2010-11-18 Thread Simon Marlow
On 18/11/2010 11:24, Christian Maeder wrote: Am 18.11.2010 11:12, schrieb Simon Marlow: On 17/11/2010 14:34, Christian Maeder wrote: ghc can be built without and with libffi. Which build option are you referring to here? I did not use any explicit build option, but just created a binary

Re: libffi was:Re: ANNOUNCE: GHC version 7.0.1

2010-11-18 Thread Simon Marlow
On 17/11/2010 14:34, Christian Maeder wrote: ghc can be built without and with libffi. Which build option are you referring to here? libffi is required for FFI support in GHCi, and for FFI "wrapper" imports. However on x86 and x86_64 we don't normally use libffi for wrappers, because we hav

Re: Terminate unused worker threads

2010-11-18 Thread Simon Marlow
On 17/11/2010 18:55, Ryan Newton wrote: Hi all, Apologies for commenting before understanding Capability.c very well. But it seems that this file uses locking quite heavily. Has there been an analysis of whether atomic memory ops and lock free algorithms could play any role here? The locks

Re: Terminate unused worker threads

2010-11-17 Thread Simon Marlow
Hi Edward, Sorry for taking so long to get around to reviewing this one. On 07/11/2010 14:29, Edward Z. Yang wrote: I finally got some spare time to do some GHC hacking, and after feeling my way around http://hackage.haskell.org/trac/ghc/ticket/4262 I came up with the following patch, which app

Re: [Haskell-cafe] Printing of asynchronous exceptions to stderr

2010-11-17 Thread Simon Marlow
On 12/11/2010 07:49, Mitar wrote: On Wed, Nov 10, 2010 at 4:48 PM, Simon Marlow wrote: You can use maskUninterruptible in GHC 7, but that is not generally recommended, Maybe there should be some function like maskUninterruptibleExceptUser which would mask everything except UserInterrupt

Re: Odd behavior of ncurses with -threaded

2010-11-15 Thread Simon Marlow
On 12/11/2010 17:25, Donn Cave wrote: Quoth Simon Marlow, ... Is there anything that we could do in GHC to improve the situation? I suppose we could have a dedicated OS thread who's job it was to sit around and run the signal handler every Nth of a second. Since the -threade

Re: Odd behavior of ncurses with -threaded

2010-11-12 Thread Simon Marlow
On 11/11/2010 22:41, Bryan O'Sullivan wrote: On Thu, Nov 11, 2010 at 2:32 PM, Edward Z. Yang mailto:ezy...@mit.edu>> wrote: I was under the impression we fixed this: http://hackage.haskell.org/trac/ghc/ticket/850 That is, we should be using SIGVTALRM, not SIGALRM, these days, excep

Re: [Glasgow-haskell-users] os x 64-bit?

2010-11-11 Thread Simon Marlow
On 11/11/2010 11:17, John Lato wrote: Hi Greg, Thanks very much for all your work on this, and Barney Stratford too. This is great news. I'm doing a lot of numerical work with Doubles at the moment, so progress is quite welcome! FYI, GHC 7.0.1 has -msse2 which makes floating-point arithmeti

Re: [Haskell-cafe] Printing of asynchronous exceptions to stderr

2010-11-11 Thread Simon Marlow
On 10/11/2010 17:52, Mitar wrote: Hi! On Wed, Nov 10, 2010 at 4:16 PM, Simon Marlow wrote: The right way to fix it is like this: Optimist. ;-) let run = unblock doSomething `catches` [ Handler (\(_ :: MyTerminateException) -> return ()), Handler (

Re: Loop optimisation with identical counters

2010-11-10 Thread Simon Marlow
On 08/11/2010 15:44, Max Bolingbroke wrote: On 6 November 2010 04:47, David Peixotto wrote: Are you sure about R1 aliasing Sp? AFAIK, R1 points to a closure on the heap, not to a stack location. That is, it can alias pointers on the stack or Hp but it can't alias the Sp itself. I don't think

Re: [Haskell-cafe] Printing of asynchronous exceptions to stderr

2010-11-10 Thread Simon Marlow
On 10/11/2010 13:39, Mitar wrote: I know that (I read one post from you some time ago). It is in TODO commend before this code. I am waiting for GHC 7.0 for this because I do not like current block/unblock approach. Because blocked parts can still be interrupted, good example of that is takeMVa

Re: [Haskell-cafe] Printing of asynchronous exceptions to stderr

2010-11-10 Thread Simon Marlow
onous exception is raised. Hopefully one of the GHC devs (probably Simon Marlow) can confirm this behavior and shed some more light on it. I think it's behaving as expected - there's a short window during which exceptions are unblocked and a second exception can be thrown. The program has

Re: Wadler space leak

2010-11-08 Thread Simon Marlow
On 07/11/2010 17:47, Jan Christiansen wrote: On 02.11.2010, at 10:20, Simon Marlow wrote: It's not really a question of priority, rather that we don't know of a good way to fix it! I would not have guessed that there exists a Haskell related problem that cannot immediately be fi

Re: Loop optimisation with identical counters

2010-11-08 Thread Simon Marlow
performance of | stream fusion code quite a bit. It's very easy to do in Core. | | Roman | | On 3 Nov 2010, at 10:45, Christian Hoener zu Siederdissen | wrote: | |> Thanks, I'll do some measurements on this with ghc7. |> |> Gruss, |> Christian |> |> On 11/02/

Re: Unicode windows console output.

2010-11-04 Thread Simon Marlow
On 04/11/2010 02:35, David Sankel wrote: On Wed, Nov 3, 2010 at 9:00 AM, Simon Marlow mailto:marlo...@gmail.com>> wrote: On 03/11/2010 10:36, Bulat Ziganshin wrote: Hello Max, Wednesday, November 3, 2010, 1:26:50 PM, you wrote: 1. You need to use "

Re: Unicode windows console output.

2010-11-03 Thread Simon Marlow
On 03/11/2010 10:36, Bulat Ziganshin wrote: Hello Max, Wednesday, November 3, 2010, 1:26:50 PM, you wrote: 1. You need to use "chcp 65001" to set the console code page to UTF8 2. It is very likely that your Windows console won't have the fonts required to actually make sense of the output. Pip

Re: Loop optimisation with identical counters

2010-11-02 Thread Simon Marlow
On 02/11/2010 08:17, Christian Höner zu Siederdissen wrote: Hi, is the following problem a job for ghc or the code generation backend (llvm)? We are given this program: {-# LANGUAGE BangPatterns #-} module Main where f :: Int -> Int -> Int -> Int -> Int f !i !j !s !m | i == 0= s+m

Re: MonoLocalBinds and darcs

2010-11-02 Thread Simon Marlow
On 02/11/2010 07:37, Sittampalam, Ganesh wrote: I've just been updating darcs 2.5 for GHC 7.0. I had to add about 40 signatures for MonoLocalBinds in about 140 files/30K LOC. Is that about normal? darcs does make fairly heavy use of rank 2 polymorphism which leads to quite a lot of local definiti

Re: Wadler space leak

2010-11-02 Thread Simon Marlow
On 01/11/2010 16:52, Jan Christiansen wrote: On 01.11.2010, at 10:38, Simon Marlow wrote: On 28/10/2010 14:21, Bertram Felgenhauer wrote: Right. The optimization works by producing special thunks for tuple selectors which the garbage collector can recognize and evaluate during GC. However

haskell98 package not linked by default in 7.0.1 (was: Re: making 7.01-pre)

2010-11-01 Thread Simon Marlow
On 30/10/2010 16:52, David Fox wrote: On Sat, Oct 30, 2010 at 4:43 AM, Serge D. Mechveliani wrote: Dear GHC developers, I am testing this fresh ghc-7.0.0.20101028 on Debian Linux, i386-family. Making it from source by ghc-6.12.3 is all right. Then, making it from source by itself reports (

Re: Wadler space leak

2010-11-01 Thread Simon Marlow
On 28/10/2010 14:21, Bertram Felgenhauer wrote: Hi, let (first,rest) = break (const False) input in print (length (first ++ rest)) When I compile this program using -O2 and use a large text file as input the code runs in constant space. If I understand correctly, the program runs in c

Re: Unaligned word-sized reads on ByteArray#

2010-10-27 Thread Simon Marlow
On 26/10/10 07:10, Antoine Latter wrote: On Tue, Oct 26, 2010 at 12:21 AM, Johan Tibell wrote: On Sun, Oct 24, 2010 at 2:02 AM, Johan Tibell wrote: I noticed that indexWordArray# only allows for aligned reads (by forcing the offset to be in words, rather than in bytes.) Is it possible to perf

Re: ghc-6.12.3 package base - build failure on ubuntu10.10 (works with 10.4)

2010-10-19 Thread Simon Marlow
On 15/10/2010 16:35, Mischa Dieterle wrote: Hi, I'm getting a build failure when I try to compile ghc-6.12 from the http://darcs.haskell.org/ghc-6.12 repo. ghc-cabal: Missing dependency on a foreign library: * Missing C library: iconv This problem can usually be solved by installing the s

Re: Has something about -prof -auto-all changed in GHC 7?

2010-10-12 Thread Simon Marlow
On 12/10/2010 06:22, Bryan O'Sullivan wrote: I've been trying to use a library compiled with profiling in 7.0.1rc1, where I'm compiling the library with -auto-all, but I'm getting output when I run an app linked against the library that contains almost no information from inside the library: basi

Re: GHC static binaries with glibc-2.12?

2010-10-11 Thread Simon Marlow
On 10/10/2010 05:22, Alexander Dunlap wrote: On Fri, Oct 8, 2010 at 12:46 AM, Simon Marlow wrote: On 08/10/2010 03:23, Alexander Dunlap wrote: I recently upgraded my Arch Linux system to glibc 2.12 and static binaries compiled with GHC 6.12.3 all fail with the message "mkTextEnc

Re: GHC static binaries with glibc-2.12?

2010-10-08 Thread Simon Marlow
On 08/10/2010 03:23, Alexander Dunlap wrote: I recently upgraded my Arch Linux system to glibc 2.12 and static binaries compiled with GHC 6.12.3 all fail with the message "mkTextEncoding: invalid argument (Invalid argument)". This did not happen with glibc 2.11. Has anyone else had this problem?

Re: Bringing back Monad Comprehensions (in style)

2010-10-06 Thread Simon Marlow
On 06/10/2010 00:26, Max Bolingbroke wrote: On 5 October 2010 15:41, George Giorgidze wrote: One can also look at how recently introduced 'order by' and 'group by' constructs generalise to monad comprehensions. If that works, one could implement even more "stylish" monad comprehension notation.

Re: Profiling: 0 entries but high costs

2010-10-06 Thread Simon Marlow
On 05/10/2010 16:54, Stefan Wehr wrote: here is some profiling output which shows strange behavior: COST CENTRE MODULE no. entries %time %alloc %time %alloc MAIN MAIN 1 00.0

Re: clearing GHCi (and, by extension, hint) loaded module dependencies

2010-10-05 Thread Simon Marlow
On 05/10/2010 14:32, Alex Suraci wrote: On Oct 5, 2010, at 9:25 AM, Simon Marlow wrote: On 26/09/2010 18:14, Alex Suraci wrote: On Sep 23, 2010, at 7:11 AM, Simon Marlow wrote: If you are making separate runGhc calls and still don't see the memory being reclaimed, then there might be a

Re: clearing GHCi (and, by extension, hint) loaded module dependencies

2010-10-05 Thread Simon Marlow
On 26/09/2010 18:14, Alex Suraci wrote: On Sep 23, 2010, at 7:11 AM, Simon Marlow wrote: If you are making separate runGhc calls and still don't see the memory being reclaimed, then there might be a leak - but it's hard to see where, since everything is reachable from the Sessi

Re: Cabal constraint solver

2010-10-05 Thread Simon Marlow
On 03/10/2010 00:12, Brandon S Allbery KF8NH wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/2/10 18:07 , Christian Höner zu Siederdissen wrote: cd syb-0.2.1 * remove base<4.3 constraint from syb.cabal cabal install * syb-0.2.1 is now installed and works! $ cabal install parsec-3.1.

Re: ANNOUNCE: GHC 7.0.1 Release Candidate 1

2010-10-05 Thread Simon Marlow
On 29/09/2010 07:25, Vivian McPhail wrote: Trying to build rc1 from source linux x86_64 BuildFlavour = perf It seems that the -fPIC flag is set, but an error still occurs ( /usr/bin/ld: libraries/integer-gmp/gmp/objs/abs.o: relocation R_X86_64_32 against `.text' can not be used when making a sh

Re: Hashcode for reference

2010-09-29 Thread Simon Marlow
On 29/09/10 04:54, Mathieu Giorgino wrote: Hi all, I'm wondering if there is a way to get an hashcode from references (IORef or STRef)? I have looked in the library and a little in the sources of GHC but haven't found anything allowing to do this. I'm generating Haskell code from the Isabelle/H

Re: Version 7.0.1-rc1 bootstrapping

2010-09-28 Thread Simon Marlow
On 28/09/10 11:08, Ian Lynagh wrote: On Sun, Sep 26, 2010 at 02:52:30PM -0700, David Fox wrote: In order to bootstrap with the compiler we are using, I had to rename the function at line 13 of compiler/utils/Exception.hs from mask_ to mask. Hmm, curious. mask_ has mask's type, which seems wron

Re: ANNOUNCE: GHC 7.0.1 Release Candidate 1

2010-09-27 Thread Simon Marlow
On 27/09/10 12:19, Ganesh Sittampalam wrote: On Sun, 26 Sep 2010, Ian Lynagh wrote: We are pleased to announce the first release candidate for GHC 7.0.1: http://new-www.haskell.org/ghc/dist/7.0.1-rc1/ This includes the source tarball, installers for OS X and Windows, and bindists for amd64/Li

Re: Version 7.0.1-rc1 bootstrapping

2010-09-27 Thread Simon Marlow
On 26/09/10 17:52, David Fox wrote: In order to bootstrap with the compiler we are using, I had to rename the function at line 13 of compiler/utils/Exception.hs from mask_ to mask. Sorry I didn't reply to the announcement, I just found out I wasn't subscribed to this list. (I also had to change

Re: GHCi 6.12.3 stdout redirection works for :type, but not for :info

2010-09-23 Thread Simon Marlow
output in order to get proper Unicode encoding. Since then, the IO library has gained support for Unicode encoding, so we don't need to do this any more. It looks like I tried to modify GHCi to bypass Haskeline for output, but didn't do a complete job: Fri Sep 18 15:40:41 BST 2

Re: clearing GHCi (and, by extension, hint) loaded module dependencies

2010-09-23 Thread Simon Marlow
On 22/09/2010 01:19, Alex Suraci wrote: On Tue, Sep 21, 2010 at 10:30 AM, Daniel Gorín wrote: Hi What I make of this is that you should run a new interpreter (i.e. use runInterpreter(T)) instead of calling reset. Could you try this this approach and see if it works? Daniel Every "load:" c

Re: clearing GHCi (and, by extension, hint) loaded module dependencies

2010-09-21 Thread Simon Marlow
On 18/09/2010 03:03, Alex Suraci wrote: Context: My language uses hint to interpret Haskell code at runtime, via `load: "path/to/file.hs"`. Hint works similar to ":load foo.hs" in GHCi (it uses the GHC API). After the source is interpreted the module's `load` function is executed in the language'

Re: Cost Centre MAIN

2010-09-21 Thread Simon Marlow
On 19/09/2010 13:11, Stefan Wehr wrote: Hi all, I'm profiling a Haskell program and now getting that the program spents 56% of its individual time in the cost centre MAIN (note the capital letters). I searched the documentation for this cost centre, with no success. In all profiling results so

Re: Directory-backed Handle?

2010-09-15 Thread Simon Marlow
On 14/09/2010 20:00, Dimitry Golubovsky wrote: In the GHC I/O system, a Handle may be backed by a "device" (IODevice instance) with IODeviceType = Directory There doesn't seem to be any (at least Google search did not give anything) code that uses this; however, what is supposed to be read from

Re: ghc_rts_options (defalting RTS flags)

2010-09-15 Thread Simon Marlow
On 14/09/2010 02:09, Thomas DuBuisson wrote: All, A recent SO question [1] led me to do a quick test on hard-coding RTS options as suggested in the manual rts-hooks section [2]. Unfortunately the timing tests indicate "ghc_rts_opts" isn't being used; tests with flags besides -N (ex: "-H1024m") a

Re: Allocation break-down by type

2010-09-15 Thread Simon Marlow
On 15/09/2010 03:49, Bruno Martínez Aguerre wrote: To understand better whether ghc is taking advantage of my UNPACK pragmas, I want to profile my program and sort the allocations by type. I couldn't find an option to do this. -p is only by cost-center, and -hy only works for live data, and I wa

Re: Interruptible GHC

2010-09-15 Thread Simon Marlow
On 15/09/2010 03:33, Edward Z. Yang wrote: Excerpts from Simon Marlow's message of Mon Sep 13 05:10:13 -0400 2010: The idea of having user-definable cancellation mechanisms seems quite sensible, given that we have so many ways to do this. However it seems quite hard in practice: for pthread_can

Re: Interruptible GHC

2010-09-13 Thread Simon Marlow
On 11/09/2010 07:59, Edward Z. Yang wrote: So I did a writeup of what I thought might be the next direction to go with the interruptible patch: http://blog.ezyang.com/2010/09/towards-platform-agnostic-interruptibility/ The really interesting bit (which I didn't cover) is what information t

Re: how to terminate an external program after timeout?

2010-09-13 Thread Simon Marlow
On 09/09/2010 17:18, Christian Maeder wrote: David Peixotto schrieb: On Sep 9, 2010, at 6:37 AM, Simon Marlow wrote: On 09/09/2010 10:39, Christian Maeder wrote: Christian Maeder schrieb: Hi, we call from our haskell application the metis prover via

Re: HEAD: Deterioration in ByteString I/O

2010-09-09 Thread Simon Marlow
On 09/09/2010 15:08, Daniel Fischer wrote: On Thursday 09 September 2010 13:19:23, Simon Marlow wrote: I think I've found the problem, GHC.IO.Handle.Text: bufReadNBEmpty :: Handle__ -> Buffer Word8 -> Ptr Word8 -> Int -> Int -> IO Int bufReadNBEmpty h...@handle__{..}

Re: how to terminate an external program after timeout?

2010-09-09 Thread Simon Marlow
On 09/09/2010 10:39, Christian Maeder wrote: Christian Maeder schrieb: Hi, we call from our haskell application the metis prover via System.Process.readProcessWithExitCode "metis" filename "" However, we are not able to get rid of this process if metis does not terminate by itself. In parti

Re: HEAD: Deterioration in ByteString I/O

2010-09-09 Thread Simon Marlow
On 09/09/2010 00:28, Daniel Fischer wrote: On Wednesday 08 September 2010 23:55:35, Don Stewart wrote: simonpj: |> ghc-6.12.3: |>89,330,672 bytes allocated in the heap |>15,092 bytes copied during GC |>35,980 bytes maximum residency (1 sample(s)) |>2

Re: alignment and the evil gc assertion failure

2010-09-09 Thread Simon Marlow
On 06/09/2010 19:03, Evan Laforge wrote: So a long time ago (I think when 6.10 first came out, the problem didn't happen with the previous version, and I think 6.10 changed how the FFI used alignment) I filed a ghc ticket about a gc assertion failure. Unfortunately it was so hard to reproduce an

Re: SIGALRM, SIGVTALRM, and third party libraries

2010-09-09 Thread Simon Marlow
On 08/09/2010 15:57, Edward Z. Yang wrote: Excerpts from Simon Marlow's message of Wed Sep 08 03:40:42 -0400 2010: Maybe. As a first step I think we could just document what happens when a call is interrupted (pthread_cancel() on POSIX, ??? on Windows) and let the user handle it. Is there even

Re: SIGALRM, SIGVTALRM, and third party libraries

2010-09-08 Thread Simon Marlow
On 06/09/10 19:16, Edward Z. Yang wrote: Excerpts from Simon Marlow's message of Mon Sep 06 05:57:59 -0400 2010: What did you have in mind with respect to "portable equivalents of pthread functions"? I'm not sure we need to do anything along these lines at all, and I'd much rather we didn't enf

Re: Compiling base with custom compilation script

2010-09-06 Thread Simon Marlow
On 01/09/2010 12:08, Victor Nazarov wrote: I have some custom compilation script that uses GHC API The aim is to extract some info from every module in dependency graph and to write this information to the file lying near module-file. Script goes like this: main :: IO () main = do args<- getA

Re: SIGALRM, SIGVTALRM, and third party libraries

2010-09-06 Thread Simon Marlow
ity of GHC with native libraries, and if this approach actually turns out to be safe in practice, that would be wonderful. I think the primary downside is that it's not portable (yet) to Windows. Simon Marlow and I have been working on "interruptible FFI calls", and one of the things th

Re: SIGALRM, SIGVTALRM, and third party libraries

2010-09-06 Thread Simon Marlow
On 03/09/2010 22:00, Bryan O'Sullivan wrote: I spent some time this morning trying to use HDBC-mysql to talk to a database. It uses the C mysql bindings, which talks over a blocking socket to the database server. Not surprisingly, it fails reliably when the thread it's running in is hit by an RTS

Re: FFI, signals and exceptions

2010-09-01 Thread Simon Marlow
On 01/09/2010 04:22, Edward Z. Yang wrote: Not sure what you mean here: what's a bound FFI call? Good point: we don’t distinguish between FFI calls that require thread local state and which ones don’t: this might be a good thing to allow annotating. If we did know, then we could simply arrang

Re: FFI, signals and exceptions

2010-08-31 Thread Simon Marlow
On 28/08/2010 07:45, Edward Z. Yang wrote: Excerpts from Simon Marlow's message of Fri Aug 27 04:05:46 -0400 2010: You should walk cap->suspended_ccalls instead, no lock is required for that. For stress testing, you want to construct an example that has lots of threads making foreign cals and o

Re: FFI, signals and exceptions

2010-08-27 Thread Simon Marlow
On 26/08/2010 18:20, Edward Z. Yang wrote: Ahem, the logic in that last iteration was not quite correct. Here is the more correct version: case BlockedOnCCall: case BlockedOnCCall_NoUnblockExc: { #ifdef THREADED_RTS Task *task = NULL; if (!target->bound) {

Re: FFI, signals and exceptions

2010-08-26 Thread Simon Marlow
On 26/08/2010 08:10, Edward Z. Yang wrote: Here is a possible implementation: Task *task = NULL; blockedThrowTo(cap,target,msg); if (target->bound) { // maybe not supposed to kill bound threads, but it // seems to work ok (as long as they don't want to try

Re: FFI, signals and exceptions

2010-08-26 Thread Simon Marlow
On 26/08/2010 06:57, Edward Z. Yang wrote: Excerpts from Edward Z. Yang's message of Thu Aug 26 01:22:22 -0400 2010: I spent some time looking at the code, and I've been having a difficult time finding the thread ID of the worker thread that is performing the safe FFI call. The target TSO is th

Re: __emutls_get_address link problem

2010-08-25 Thread Simon Marlow
On 25/08/2010 16:37, Christian Maeder wrote: Christian Maeder schrieb: Simon Marlow schrieb: On 23/08/2010 17:45, Brandon S Allbery KF8NH wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 8/23/10 11:57 , Christian Maeder wrote: However, when I try to compile the simplest source with

Re: __emutls_get_address link problem

2010-08-25 Thread Simon Marlow
On 23/08/2010 17:45, Brandon S Allbery KF8NH wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 8/23/10 11:57 , Christian Maeder wrote: However, when I try to compile the simplest source with on older gcc-3.4.4 I get the link error below, but only for the threaded rts! With ghc-6.12.1 and

Re: GHC-HEAD 19.Aug.2010, llvm, threaded [Memory Exhaustion]

2010-08-23 Thread Simon Marlow
On 20/08/2010 20:13, Christian Höner zu Siederdissen wrote: Hi, using: http://www.haskell.org/ghc/dist/current/dist/ghc-6.13.20100819-x86_64-unknown-linux.tar.bz2 parallel-3.1.0.0 and the most-common test program ... ever: module Main where import Control.Parallel.Strategies fib :: Int -> In

Re: Using associated data types to create unpacked data structures

2010-08-12 Thread Simon Marlow
On 12/08/2010 12:28, Johan Tibell wrote: This doesn't quite work though as two MapIntDouble defined in two different libraries are incompatible. This is essentially the same problem as with instance collisions. But you get to choose the module name, so you can avoi

Re: Using associated data types to create unpacked data structures

2010-08-12 Thread Simon Marlow
On 12/08/2010 11:13, Johan Tibell wrote: There needs to be some amount of code generation, but much of the implementation can still be shared. I previously tried to defined the type class as {-# LANGUAGE MultiParamTypeClasses, TypeFamilies #-} module Ex2 where import Prelude hid

Re: how to link a minimal executable?

2010-08-12 Thread Simon Marlow
On 11/08/2010 22:31, Greg Fitzgerald wrote: Is there any documentation or examples available that shows what needs to be linked to get a haskell executable to print "hello world"? Instead of using GHC to link, I'm interested in using gcc, ar, or link directly. For starters, what implements the

Re: Using associated data types to create unpacked data structures

2010-08-12 Thread Simon Marlow
On 11/08/2010 17:03, Johan Tibell wrote: Inspired by the generic maps example at http://www.haskell.org/haskellwiki/GHC/Indexed_types I tried to use associated data types to create a generic finite map that unpacks both the key and value into the leaf data constructor. What you're trying to d

Re: FFI, signals and exceptions

2010-08-09 Thread Simon Marlow
On 06/08/2010 21:16, Edward Z. Yang wrote: Excerpts from Corey O'Connor's message of Fri Aug 06 16:15:21 -0400 2010: In your test cases that fail are your C computations foreign unsafe imports? First thing I checked. :-) They were safe imports, and the Haskell code did get called--just the C c

Re: Error building head on OS X

2010-07-21 Thread Simon Marlow
On 20/07/10 22:08, Ian Lynagh wrote: On Tue, Jul 20, 2010 at 10:45:36PM +0200, Johan Tibell wrote: Building from a clean checkout of HEAD (from today) I get: ghc-stage2: internal error: Invalid Mach-O file:Address out of bounds while relocating object file (GHC version 6.13.20100720 for i3

Re: hot-refreshing a package (same version number, new content)

2010-07-19 Thread Simon Marlow
On 15/07/2010 23:41, Albert Y. C. Lai wrote: Suppose I start ghci, use a value from a package, causing it to be linked, then I modify the package and reinstall, same version number, without quitting my ghci session. Is there a way to tell the ghci session to refresh and use the modified package?

Re: new qualified operators

2010-07-16 Thread Simon Marlow
On 15/07/2010 13:46, Christian Maeder wrote: Hi, seeing http://www.haskell.org/ghc/docs/6.12.2/html/users_guide/syntax-extns.html#new-qualified-operators Could you add: "Spaces are not allowed in new qualified operators!" For {-# LANGUAGE NewQualifiedOperators #-} f1 = (+) f2 = ( +) f3 =

Re: [Gtk2hs-devel] behaviour of ghci on .c modules that are part of a library

2010-07-16 Thread Simon Marlow
On 16/07/2010 14:04, Axel Simon wrote: Hi Simon, On 16.07.2010, at 14:29, Simon Marlow wrote: On 16/07/2010 12:36, Axel Simon wrote: Dear Haskell maintainers, I've progressed a little and found that the problem is down to accessing global variables that are declared in dynamic librarie

Re: [Gtk2hs-devel] behaviour of ghci on .c modules that are part of a library

2010-07-16 Thread Simon Marlow
On 16/07/2010 12:36, Axel Simon wrote: Dear Haskell maintainers, I've progressed a little and found that the problem is down to accessing global variables that are declared in dynamic libraries. In a nutshell, this doesn't as the addresses of these global variables are all wrong when ghci is exe

Re: mallocForeignPtr vs. C

2010-07-13 Thread Simon Marlow
On 13/07/2010 05:49, Evan Laforge wrote: On Mon, Jul 12, 2010 at 6:54 PM, John Meacham wrote: Hi, is a StablePtr what you are after? Indeed, it looks like StablePtr will get me what I want. It's a little less convenient than FunPtr because I'm already doing some finalization of FunPtrs and I

Re: Lazy IO and asynchronous callbacks?

2010-07-09 Thread Simon Marlow
On 08/07/2010 23:25, J. Garrett Morris wrote: Hello everyone, I'm currently in the process of wrapping a C API, and I've run across an interesting possibility. Basically, the C API exposes non-blocking versions of some potentially long-running operations, and will invoke a callback to indicate

Re: unsafeCoerce# between integral and floating point types

2010-07-09 Thread Simon Marlow
On 08/07/2010 17:56, Daniel Fischer wrote: On Thursday 08 July 2010 18:15:44, Ian Lynagh wrote: On Thu, Jul 08, 2010 at 04:49:00PM +0200, Daniel Fischer wrote: unsafeCoerce# :: Word64# -> Double# ? By the docs, that isn't supposed to work. Is it not supposed to work only because it's not valu

Re: BlockedIndefinitelyOnMVar exception

2010-07-05 Thread Simon Marlow
On 04/07/2010 21:51, Neil Mitchell wrote: http://hackage.haskell.org/trac/ghc/ticket/4154 Yup, that's a bug. Not clear if it's fixable. http://hackage.haskell.org/trac/ghc/ticket/3527 That too. A very similar bug in fact, if there is a fix it will probably fix both of them. The problem i

Re: BlockedIndefinitelyOnMVar exception

2010-07-04 Thread Simon Marlow
On 04/07/10 10:30, Neil Mitchell wrote: Hi Simon, My suspicion for the root cause of the problem is that Concurrent.Chan is incorrect. In the course of debugging this problem we found 2 bugs in Chan, and while I never tracked down any other bugs in Chan, I no longer trust it. By rewriting parts

Re: BlockedIndefinitelyOnMVar exception

2010-07-02 Thread Simon Marlow
On 01/07/2010 21:10, Neil Mitchell wrote: Hi Simon, Thanks for the excellent information. I've now debugged my problem, and think I've got the last of the MVar blocking problems out. * How confident are people that this exception does really mean that it is in a blocked state? Is there any cha

Re: Help with Win64 port

2010-07-01 Thread Simon Marlow
On 30/06/2010 22:15, George Brewster wrote: Hey, I'd really like to see ghc working on 64-bit Windows, so I've decided to take at least a quick stab at getting it going. Having talked to some of the people on #ghc, it sounds like the first thing to do is get an unregisterised build going, which s

Re: [Haskell-cafe] Space leak with unsafePerformIO

2010-07-01 Thread Simon Marlow
On 30/06/2010 18:13, Yitzchak Gale wrote: Henning Thielemann wrote on Haskell Cafe: Attached is a program with a space leak... I have coded a simple 'map' function, once using unsafePerformIO and once without. UnsafePerformIO has a space leak in some circumstances. In the main program I demonstr

Re: GHC.IO.Device and "ready" method?

2010-06-29 Thread Simon Marlow
On 25/06/10 16:06, Dimitry Golubovsky wrote: Should an implementation of GHC.IO.Device expect the `ready' method to be called from a thread different than one waiting for an I/O operation on a handle to complete, while that operation is in progress? As a more general question, are GHC Handles (a

<    1   2   3   4   5   6   7   8   9   10   >