https://github.com/peerlibrary/meteor-segfault-handler
Capture node.js stack trace on SIGSEGV and SIGBUS signals
https://github.com/peerlibrary/meteor-segfault-handler
Last synced: 7 months ago
JSON representation
Capture node.js stack trace on SIGSEGV and SIGBUS signals
- Host: GitHub
- URL: https://github.com/peerlibrary/meteor-segfault-handler
- Owner: peerlibrary
- License: other
- Created: 2014-07-06T05:51:31.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2015-01-17T16:47:29.000Z (over 11 years ago)
- Last Synced: 2025-02-22T16:14:53.645Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://github.com/ddopson/node-segfault-handler
- Size: 166 KB
- Stars: 0
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
segfault-handler package
========================
Meteor package for capturing Meteor stack trace on `SIGSEGV` and `SIGBUS` signals and receiving a callback
when they occur. It is built upon [node-segfault-handler](https://github.com/ddopson/node-segfault-handler)
node.js package.
Adding this package to your [Meteor](http://www.meteor.com/) application adds `SegfaultHandler` object into
the global scope.
You can use `SegfaultHandler.registerHandler` to register a callback which receives `stack`, `signal`, and
`address` arguments. You can use that callback to log the signal or in some other way handle the signal,
but you should be careful that code is not too complex. When `SIGSEGV` or `SIGBUS` signal is received by
your Meteor application it means that it did an illegal memory operation and its state is undefined.
Server side only.
Installation
------------
```
meteor add peerlibrary:segfault-handler
```
Example
-------
```coffee
SegfaultHandler.registerHandler (stack, signal, address) ->
message = "Received SIGSEGV/SIGBUS (#{ signal }) for address 0x#{ address.toString(16) }"
stack = stack.join '\n'
Log.error "#{ message }\n#{ stack }"
Errors.insert
message: message
stack: stack
```