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

Better debugging on segfault? #11

Open
luc-tielen opened this issue Jun 11, 2016 · 3 comments
Open

Better debugging on segfault? #11

luc-tielen opened this issue Jun 11, 2016 · 3 comments

Comments

@luc-tielen
Copy link
Owner

Currently it's possible to test C code by using the Lua FFI.
C code can however trigger a segfault when a bug is triggered in a program.
It would be useful to still be able to capture this output even after the segfault occurs, right now only the following shows up (in Linux):

zsh: segmentation fault (core dumped) LD_LIBRARY_PATH=spec/fixtures/ busted --helper=spec/fixtures/helper.lua

Possible options to improve this:

  • separate all C properties into a separate process, then monitor that process somehow for segfaults
  • let it coredump, investigate core file afterwards
@ligurio
Copy link
Contributor

ligurio commented Apr 8, 2021

"separate all C properties into a separate process, then monitor that process somehow for segfaults"

this way looks preferable :)

@luc-tielen
Copy link
Owner Author

Yeah, looking back at it this is the way to go. But I'm currently not using the library so I probably won't be adding it any time soon 😅

@ligurio
Copy link
Contributor

ligurio commented Apr 30, 2021

It's worth to look how it is implemented in theft (PBT library for C) - https://github.com/silentbicycle/theft/blob/master/doc/forking.md
theft uses timeouts and recommend to disabled crash reporter because it can slowdown testing process.

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