cruby_crash_info 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f29b0cb1a4cc5c31db92f502766de56258eaa6ca9f937f14a907d8665716958
4
- data.tar.gz: 4a87849e370d8d9a811e92e6da8168ac479f3a63615faf7f1a198e1373f19408
3
+ metadata.gz: 4f732c33949e115155cb9cdb9d3de661129b62ca07ab2f9fd2c8cb2c0a07ca94
4
+ data.tar.gz: 3c9752b372eac058773e9a54ee0311cbdf21c431b711cb61d1fe81cdfe385fb2
5
5
  SHA512:
6
- metadata.gz: 2b2bdb10f42d138cacef8313a6931eafc6f1d2cebfa2847896131521945868102078b920afd0682ec73cbac56dc553c344c2a188d553ea2ea3303cf66be658bd
7
- data.tar.gz: aa56f4701eff796b0b5c5f468a4d6055f72c75725f7b275596c7aae6fad3cad665910d8517b7f6a935917def5719a37ceebcb11c01d965c184d5e484cff85673
6
+ metadata.gz: '09aecd7511234e36c5ab4d9c3b65540ee5e42cbcc786e747d1e47a2bd9526c11456ad986d13e4670b39e2a2ad5cc4772c08db16c1225a411e4ac8a69b01dc441'
7
+ data.tar.gz: ef1d4122794d1d6f2fe7a0090726179723d44351b99b10daea05221367a16d83ca8ef36618c27bf81e9c9528553c623e67c04146ba3e208a9cb3573f9e0bbfcc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cruby_crash_info (0.1.0)
4
+ cruby_crash_info (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -12,6 +12,7 @@ GEM
12
12
  rake
13
13
 
14
14
  PLATFORMS
15
+ arm64-darwin-21
15
16
  x86_64-linux
16
17
 
17
18
  DEPENDENCIES
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # CrubyCrashInfo
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/cruby_crash_info`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- Or install it yourself as:
17
+ ## Usage
20
18
 
21
- $ gem install cruby_crash_info
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
- ## Usage
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
- TODO: Write usage instructions here
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
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "cruby_crash_info"
5
- spec.version = "0.1.0"
5
+ spec.version = "0.1.1"
6
6
  spec.authors = ["John Hawthorn"]
7
7
  spec.email = ["john@hawthorn.email"]
8
8
 
@@ -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
@@ -2,4 +2,4 @@
2
2
 
3
3
  require "mkmf"
4
4
 
5
- create_makefile("cruby_crash_info/cruby_crash_info")
5
+ create_makefile("cruby_crash_info")
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.0
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-22 00:00:00.000000000 Z
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: