Ticket #7621 (new bug)
Cross-build for QNX ARM smashes stack when using FunPtr wrappers
| Reported by: | singpolyma | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.8.1 |
| Component: | Compiler (FFI) | Version: | 7.7 |
| Keywords: | qnx unregisterised cross-compile | Cc: | nathan.huesken@…, 0@… |
| Operating System: | QNX | Architecture: | arm |
| Type of failure: | Runtime crash | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | #7610 | Related Tickets: |
Description
I have built an unregistered LLVM cross-compiler for arm-unknown-nto-qnx8.0.0eabi, which I finally got to build using the attached patch. Simple programs no longer crash like they do in registered ARM cross-compilers (as reported on mailing list at http://www.haskell.org/pipermail/ghc-devs/2013-January/000005.html and other places), however the following code does crash:
{-# LANGUAGE ForeignFunctionInterface #-}
module Main (main) where
import Foreign.Ptr
foreign import ccall "wrapper" wrap_refresh :: ( IO ()) -> IO (FunPtr ( IO ()))
main :: IO ()
main = do
wrap_refresh (return ())
return ()
It seems, from experiments, that any code using the "wrapper" imports causes this error:
$ ./Main *** stack smashing detected ***: Main terminated Abort (core dumped)
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

