Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault on "DynFlags" "rawSettings" field #16

Open
bitc opened this issue Apr 7, 2021 · 1 comment
Open

Segmentation fault on "DynFlags" "rawSettings" field #16

bitc opened this issue Apr 7, 2021 · 1 comment

Comments

@bitc
Copy link

bitc commented Apr 7, 2021

When I run anythingToString on DynFlags (from GHC api) I get a crash.

Specifically, the problem is with the "rawSettings" field. This is interesting because the type of "rawSettings" is [(String, String)]

Doing a regular print works fine, but anythingToString causes a segfault. I tried running through GDB but did not get any useful backtrace or extra helpful information.

All the other fields of DynFlags work great with anythingToString

test :: DynFlags -> IO ()
test df = do
  print (rawSettings df)                          -- This successfully prints the value
  putStrLn (anythingToString (rawSettings df))    -- This  crashes

Thank you

@edsko
Copy link
Collaborator

edsko commented Apr 8, 2021

Hmm, this is really strange! Could you do me a favour? I've just pushed a tiny commit to master that exposes Debug.RecoverRTTI.ClosureTree. Could you use showClosureTree (with some suitable depth) to print the full closure tree? That might give a clue about what is going on.

Thanks for the report, again! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants