#1357: trouble using newForeignPtrEnv
-------------------------+--------------------------------------------------
Reporter: Frederik | Owner:
Type: bug | Status: new
Priority: high | Milestone:
Component: Compiler | Version: 6.6
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Os: Unknown | Testcase:
Architecture: Unknown |
-------------------------+--------------------------------------------------
Old description:
> I am attaching files to hopefully reproduce a problem I am having. I have
> not upgraded to 6.6.1 yet so let me know if it has been fixed.
>
> $ touch fpenv_c.c fpenv.hs && cc -g -Wall -c fpenv_c.c && ghc -fasm
> --make fpenv.hs fpenv_c.o -lc
> [1 of 1] Compiling Main ( fpenv.hs, fpenv.o )
> Linking fpenv ...
> $ ./fpenv
> (x,xFP)=(0x08090628,0x08090628)
> fin_test: env=0xa7900040, p=0x808e00c
> zsh: segmentation fault ./fpenv
> [139]$ ghc --version
> The Glorious Glasgow Haskell Compilation System, version 6.6.20070420
>
> Running in valgrind shows:
>
> ...
> fin_test: env=0x437c008, p=0x1
> ==12777==
> ==12777== Jump to the invalid address stated on the next line
> ==12777== at 0x1F: ???
> ==12777== Address 0x1F is not stack'd, malloc'd or (recently) free'd
>
> I think this is when fin_test exits. I am experiencing this problem in a
> much larger program, so I wrote this test case to figure out what is
> going wrong. Am I using the newForeignPtrEnv API incorrectly?
New description:
I am attaching files to hopefully reproduce a problem I am having. I have
not upgraded to 6.6.1 yet so let me know if it has been fixed.
{{{
$ touch fpenv_c.c fpenv.hs && cc -g -Wall -c fpenv_c.c && ghc -fasm --make
fpenv.hs fpenv_c.o -lc
[1 of 1] Compiling Main ( fpenv.hs, fpenv.o )
Linking fpenv ...
$ ./fpenv
(x,xFP)=(0x08090628,0x08090628)
fin_test: env=0xa7900040, p=0x808e00c
zsh: segmentation fault ./fpenv
[139]$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.6.20070420
}}}
Running in valgrind shows:
{{{
...
fin_test: env=0x437c008, p=0x1
==12777==
==12777== Jump to the invalid address stated on the next line
==12777== at 0x1F: ???
==12777== Address 0x1F is not stack'd, malloc'd or (recently) free'd
}}}
I think this is when fin_test exits. I am experiencing this problem in a
much larger program, so I wrote this test case to figure out what is going
wrong. Am I using the newForeignPtrEnv API incorrectly?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1357>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs