cruby_crash_info 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -1
- data/README.md +36 -7
- data/cruby_crash_info.gemspec +1 -1
- data/ext/cruby_crash_info.c +5 -0
- data/ext/extconf.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f732c33949e115155cb9cdb9d3de661129b62ca07ab2f9fd2c8cb2c0a07ca94
|
4
|
+
data.tar.gz: 3c9752b372eac058773e9a54ee0311cbdf21c431b711cb61d1fe81cdfe385fb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09aecd7511234e36c5ab4d9c3b65540ee5e42cbcc786e747d1e47a2bd9526c11456ad986d13e4670b39e2a2ad5cc4772c08db16c1225a411e4ac8a69b01dc441'
|
7
|
+
data.tar.gz: ef1d4122794d1d6f2fe7a0090726179723d44351b99b10daea05221367a16d83ca8ef36618c27bf81e9c9528553c623e67c04146ba3e208a9cb3573f9e0bbfcc
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# CrubyCrashInfo
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
This adds the abilitiy to add extra info to the end of Ruby's bug/crash reports.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -16,13 +14,44 @@ And then execute:
|
|
16
14
|
|
17
15
|
$ bundle install
|
18
16
|
|
19
|
-
|
17
|
+
## Usage
|
20
18
|
|
21
|
-
|
19
|
+
Assign a String to `CRubyCrashInfo.info`.
|
20
|
+
This can be done multiple times and only the latest assigned info will be used.
|
22
21
|
|
23
|
-
|
22
|
+
```
|
23
|
+
CRubyCrashInfo.info = <<EOF
|
24
|
+
Extra info to print!
|
25
|
+
request_id: #{rand(9999999999)}
|
26
|
+
EOF
|
27
|
+
```
|
28
|
+
|
29
|
+
**DEMO:** cause a crash
|
30
|
+
|
31
|
+
``` ruby
|
32
|
+
require "fiddle"
|
33
|
+
Fiddle.dlunwrap(0x1234).to_s # SEGV
|
34
|
+
```
|
24
35
|
|
25
|
-
|
36
|
+
```
|
37
|
+
test.rb:9: [BUG] Segmentation fault at 0x0000000000001244
|
38
|
+
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-linux]
|
39
|
+
|
40
|
+
-- Control frame information -----------------------------------------------
|
41
|
+
c:0003 p:---- s:0010 e:000009 CFUNC :to_s
|
42
|
+
c:0002 p:0054 s:0006 e:000005 EVAL test.rb:9 [FINISH]
|
43
|
+
c:0001 p:0000 s:0003 E:0021a0 (none) [FINISH]
|
44
|
+
|
45
|
+
-------------------8<-----------------
|
46
|
+
7ffcc7f0b000-7ffcc7f0d000 r-xp 00000000 00:00 0 [vdso]
|
47
|
+
ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0 [vsyscall]
|
48
|
+
|
49
|
+
|
50
|
+
* Extra crash info:
|
51
|
+
Extra info to print!
|
52
|
+
request_id: 4843151088
|
53
|
+
|
54
|
+
```
|
26
55
|
|
27
56
|
## Development
|
28
57
|
|
data/cruby_crash_info.gemspec
CHANGED
data/ext/cruby_crash_info.c
CHANGED
@@ -12,6 +12,10 @@ static VALUE rb_set_extra_debug_info(VALUE self, VALUE str) {
|
|
12
12
|
return str;
|
13
13
|
}
|
14
14
|
|
15
|
+
static VALUE rb_get_extra_debug_info(VALUE self) {
|
16
|
+
return extra_debug_info;
|
17
|
+
}
|
18
|
+
|
15
19
|
static void report_extra_crash_info(FILE *f, void *data) {
|
16
20
|
if (!RTEST(extra_debug_info)) return;
|
17
21
|
|
@@ -25,6 +29,7 @@ Init_cruby_crash_info(void)
|
|
25
29
|
{
|
26
30
|
rb_mCrubyCrashInfo = rb_define_module("CRubyCrashInfo");
|
27
31
|
rb_define_singleton_method(rb_mCrubyCrashInfo, "info=", rb_set_extra_debug_info, 1);
|
32
|
+
rb_define_singleton_method(rb_mCrubyCrashInfo, "info", rb_get_extra_debug_info, 0);
|
28
33
|
rb_gc_register_address(&extra_debug_info);
|
29
34
|
rb_bug_reporter_add(report_extra_crash_info, NULL);
|
30
35
|
}
|
data/ext/extconf.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cruby_crash_info
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Hawthorn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Adds extra info to CRuby crash reports
|
14
14
|
email:
|