Why do ghc-built binaries use timer_create?

This comes from an issue in haskell-beginner, although it have already been touched here. If you use recent versions of ghc to build a program and try the resulting binary on an old linux distro, you may get a message about timer_create receiving the wrong parameters. Curiously, as sugested in the other thread, it seems building with ghc -threaded solves the problem. So, I'm just curious: how is timer_create used, and why maybe it's not used with -threaded? Thanks, Maurício

On Mon, Jun 8, 2009 at 11:23 AM, Maurício
This comes from an issue in haskell-beginner, although it have already been touched here. If you use recent versions of ghc to build a program and try the resulting binary on an old linux distro, you may get a message about timer_create receiving the wrong parameters.
For better or worse, this is something that people should not be trying in the first place, and the problem you report is a representative example of why. Taking code compiled on a new system and trying to run it on an old system will often fail due to API or ABI incompatibilities. Sometimes those failures are easy to see, as in your case; other times, they'll result in more subtle problems. The timer_create issue is a bit of a red herring. If it wasn't that, something else would probably break instead.

This comes from an issue in haskell-beginner, (...)
For better or worse, this is something that people should not be trying in the first place, (...)
Sure! That's what I sugested in the original question. I'm actually just curious on why timer_create is used at all. This is probably just a small detail in program initialization, and maybe a link to some description of what happens on program initialization (specially ghc generated binaries) behind the naive user view would do it. Thanks, Maurício

On 08/06/2009 22:10, Maurício wrote:
This comes from an issue in haskell-beginner, (...)
For better or worse, this is something that people should not be trying in the first place, (...)
Sure! That's what I sugested in the original question. I'm actually just curious on why timer_create is used at all. This is probably just a small detail in program initialization, and maybe a link to some description of what happens on program initialization (specially ghc generated binaries) behind the naive user view would do it.
timer_create is used in the RTS to create a regular tick signal. The tick signal is used for various things: thread pre-emption, profiling, deadlock detection, and idle-time GC, Cheers, Simon
participants (3)
-
Bryan O'Sullivan
-
Maurício
-
Simon Marlow