Package: ghc6 Version: 6.10.4-1 Severity: normal Hello,
The following program will run normally, but when it exits an error is reported: /--------------------------------- import System.Posix.Semaphore main = do s <- semOpen "c" (OpenSemFlags True False) 0666 1 semThreadWait s v <- semGetValue s putStrLn "Type!" a <- getLine putStrLn $ "OK, " ++ a semPost s \--------------------------------- When I run it: /--------------------------------- $ ghc sem.hs -lpthread -o sem $ ./sem Type! abc OK, abc sem: error: a C finalizer called back into Haskell. This was previously allowed, but is disallowed in GHC 6.10.2 and later. To create finalizers that may call back into Haskll, use Foreign.Concurrent.newForeignPtr instead of Foreign.newForeignPtr. \--------------------------------- It makes no difference if there is another instance of the program already using the semaphore (the error is produced regardless of wether the process slept or not). It also makes no difference wether the semaphore existed before the program started. The error seems to happen because a C function called via FFI tried to call back into Haskell code (at least it's what I understood). J. -- System Information: Debian Release: squeeze/sid APT prefers unstable APT policy: (500, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 2.6.31-rc7 (SMP w/2 CPU cores; PREEMPT) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages ghc6 depends on: ii gcc 4:4.3.3-9 The GNU C compiler ii libc6 2.9-25 GNU C Library: Shared libraries ii libffi-dev 3.0.7-1 Foreign Function Interface library ii libffi5 3.0.7-1 Foreign Function Interface library ii libgmp3-dev 2:4.3.1+dfsg-3 Multiprecision arithmetic library ii libgmp3c2 2:4.3.1+dfsg-3 Multiprecision arithmetic library ii perl [perl5] 5.10.0-25 Larry Wall's Practical Extraction ghc6 recommends no packages. Versions of packages ghc6 suggests: ii ghc6-doc 6.10.4-1 Documentation for the Glasgow Hask ii ghc6-prof 6.10.4-1 Profiling libraries for the Glasgo pn haskell-doc <none> (no description available) -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org