tiny_tds 3.4.0-x86_64-linux-gnu → 3.4.1-x86_64-linux-gnu

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: 2e35fd3530562d904fb546b7e42316bf07985dced0fae8580bcd6ea546f2a341
4
- data.tar.gz: f5862f9b6af4442d0287f4ba8602e13f55f44e0fa6eca0c7c64b4e6109a2c09b
3
+ metadata.gz: 0fb974568785447c7f854ac2c096cd52d402379cffc2fd006968d2993d7f8325
4
+ data.tar.gz: d061b95f9d523afc4f4240167427f126fe95bd786a27d651245c19219a065985
5
5
  SHA512:
6
- metadata.gz: 12380310bd3ec7cc9966741c6fa991bc0068e35d5bda38168c247ff72ad8e6b04affb72a6f9162fe8cf1fcbbb667f403ec30801bdf9b1b78308b268c777dbbc3
7
- data.tar.gz: 4559b68cd048cee80174006624269679e949c403dba79c0fc59d7aacc574d84d4321d07cca0c6eb3e4ba219d52076a7ad8ae166b2e6e1cad801e384e9921a853
6
+ metadata.gz: ed66f184d8894af0e2061a142e67f9dd3e9e3ae00bcc28af6b0112b6c838dcfa97d34a8caef801eb07fa494e9c8de17fe9f3fe422e01e8604fbed1b7bc0926bc
7
+ data.tar.gz: d1bb510afb9492a12be593372f0d45355abcdaa4c3c6891e14ea16b1730b504861b75690349db8ea9fe1db6f19f323c6a2aed3fd9c54237bfd87086d0b44b96e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## (unreleased)
2
2
 
3
+ ## 3.4.1
4
+
5
+ * Register the C globals that hold Ruby classes and modules with the GC, so raising `TinyTds::Error` after GC compaction no longer crashes with a segmentation fault. Fixes #608.
6
+ * Use freetds v1.5.19 and OpenSSL v3.6.5 for Windows and Linux builds.
7
+
3
8
  ## 3.4.0
4
9
 
5
10
  * Add Ruby 4.0 to the cross compile list
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.4.0
1
+ 3.4.1
@@ -541,6 +541,7 @@ static VALUE rb_tinytds_connect(VALUE self, VALUE opts)
541
541
  void init_tinytds_client()
542
542
  {
543
543
  cTinyTdsClient = rb_define_class_under(mTinyTds, "Client", rb_cObject);
544
+ rb_global_variable(&cTinyTdsClient);
544
545
  rb_define_alloc_func(cTinyTdsClient, allocate);
545
546
  /* Define TinyTds::Client Public Methods */
546
547
  rb_define_method(cTinyTdsClient, "tds_version", rb_tinytds_tds_version, 0);
@@ -1,8 +1,8 @@
1
1
  ICONV_VERSION = ENV["TINYTDS_ICONV_VERSION"] || "1.18"
2
2
  ICONV_SOURCE_URI = "http://ftp.gnu.org/pub/gnu/libiconv/libiconv-#{ICONV_VERSION}.tar.gz"
3
3
 
4
- OPENSSL_VERSION = ENV["TINYTDS_OPENSSL_VERSION"] || "3.6.0"
4
+ OPENSSL_VERSION = ENV["TINYTDS_OPENSSL_VERSION"] || "3.6.5"
5
5
  OPENSSL_SOURCE_URI = "https://www.openssl.org/source/openssl-#{OPENSSL_VERSION}.tar.gz"
6
6
 
7
- FREETDS_VERSION = ENV["TINYTDS_FREETDS_VERSION"] || "1.5.10"
7
+ FREETDS_VERSION = ENV["TINYTDS_FREETDS_VERSION"] || "1.5.19"
8
8
  FREETDS_SOURCE_URI = "http://www.freetds.org/files/stable/freetds-#{FREETDS_VERSION}.tar.bz2"
@@ -702,9 +702,12 @@ void init_tinytds_result()
702
702
  {
703
703
  /* Data Classes */
704
704
  cKernel = rb_const_get(rb_cObject, rb_intern("Kernel"));
705
+ rb_global_variable(&cKernel);
705
706
  cDate = rb_const_get(rb_cObject, rb_intern("Date"));
707
+ rb_global_variable(&cDate);
706
708
  /* Define TinyTds::Result */
707
709
  cTinyTdsResult = rb_define_class_under(mTinyTds, "Result", rb_cObject);
710
+ rb_global_variable(&cTinyTdsResult);
708
711
  rb_undef_alloc_func(cTinyTdsResult);
709
712
  /* Define TinyTds::Result Public Methods */
710
713
  rb_define_method(cTinyTdsResult, "fields", rb_tinytds_result_fields, 0);
@@ -8,8 +8,10 @@ VALUE mTinyTds, cTinyTdsError;
8
8
 
9
9
  void Init_tiny_tds()
10
10
  {
11
- mTinyTds = rb_define_module("TinyTds");
11
+ mTinyTds = rb_define_module("TinyTds");
12
+ rb_global_variable(&mTinyTds);
12
13
  cTinyTdsError = rb_const_get(mTinyTds, rb_intern("Error"));
14
+ rb_global_variable(&cTinyTdsError);
13
15
  init_tinytds_client();
14
16
  init_tinytds_result();
15
17
  }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,37 @@
1
+ require "test_helper"
2
+ require "open3"
3
+ require "rbconfig"
4
+
5
+ class GcCompactionTest < Minitest::Spec
6
+ describe "after GC compaction" do
7
+ it "raises TinyTds::Error instead of crashing when a connection fails" do
8
+ skip "GC compaction is not supported on this platform" if !GC.respond_to?(:verify_compaction_references)
9
+
10
+ # Ruby 3.2 renamed the double_heap: keyword to expand_heap:
11
+ heap_keyword =
12
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.2")
13
+ "expand_heap"
14
+ else
15
+ "double_heap"
16
+ end
17
+
18
+ script = <<~RUBY
19
+ require "tiny_tds"
20
+
21
+ GC.verify_compaction_references(#{heap_keyword}: true, toward: :empty)
22
+
23
+ begin
24
+ TinyTds::Client.new(host: "127.0.0.1", port: 1, username: "unused", password: "unused", login_timeout: 1)
25
+ rescue TinyTds::Error
26
+ exit 0
27
+ end
28
+
29
+ exit 1
30
+ RUBY
31
+
32
+ output, status = Open3.capture2e(RbConfig.ruby, "-I", File.expand_path("../lib", __dir__), "-e", script)
33
+
34
+ assert status.success?, "expected TinyTds::Error to be raised, got #{status.inspect}:\n#{output}"
35
+ end
36
+ end
37
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiny_tds
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.4.1
5
5
  platform: x86_64-linux-gnu
6
6
  authors:
7
7
  - Ken Collins
@@ -245,6 +245,7 @@ files:
245
245
  - test/bin/install-freetds.sh
246
246
  - test/bin/restore-from-native-gem.ps1
247
247
  - test/client_test.rb
248
+ - test/gc_compaction_test.rb
248
249
  - test/gem_test.rb
249
250
  - test/result_test.rb
250
251
  - test/schema/1px.gif