ruby-oci8 2.2.12 → 2.2.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS +26 -0
- data/docs/hanging-after-inactivity.md +1 -1
- data/ext/oci8/extconf.rb +1 -0
- data/ext/oci8/oci8.c +2 -2
- data/ext/oci8/oci8.h +6 -5
- data/ext/oci8/oci8lib.c +14 -22
- data/ext/oci8/oraconf.rb +4 -0
- data/ext/oci8/oradate.c +0 -11
- data/ext/oci8/plthook.h +7 -1
- data/ext/oci8/plthook_elf.c +422 -197
- data/ext/oci8/plthook_osx.c +725 -91
- data/ext/oci8/plthook_win32.c +39 -25
- data/lib/oci8/oracle_version.rb +9 -1
- data/lib/oci8/version.rb +1 -1
- data/lib/oci8.rb +2 -0
- data/test/test_metadata.rb +1 -0
- data/test/test_oranumber.rb +3 -1
- data/test/test_package_type.rb +10 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e144a61c64f6856db08e6e473ac4531dd008c967bad30f48bf6a6852c7fc623
|
4
|
+
data.tar.gz: e35589ae71e41de3d0b77ca04dfa4bc0aa761272915c5e4d2cabcb955b4923d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 474b19d0d1a92f1cd52e0b12babeff15c4ccdeb076a3b523b61ad8d7fdc9b0bab99715af698b83cf841b114880f111e727f0dbd8e583ca4263b30fb28a2621f7
|
7
|
+
data.tar.gz: '079389be6f6662ae81795da0c0e4c7ba81bee27a1724032cf2c7de652f5282d0201d4f3ffec9eaa6e74d2e068abb96097912d3417d5c65cb084ed02c51e6d89b'
|
data/NEWS
CHANGED
@@ -1,5 +1,31 @@
|
|
1
1
|
# @markup markdown
|
2
2
|
|
3
|
+
2.2.14 (2024-08-06)
|
4
|
+
===================
|
5
|
+
|
6
|
+
Fixed issues
|
7
|
+
------------
|
8
|
+
|
9
|
+
- Fix SIGSEGV when nokogiri is loaded before oci8 (GH-263 - Linux only)
|
10
|
+
|
11
|
+
2.2.13 (2024-07-27)
|
12
|
+
===================
|
13
|
+
|
14
|
+
- Binary gems for Windows x64 and x86 supports ruby 2.7 - 3.3 inclusive.
|
15
|
+
|
16
|
+
Fixed issues
|
17
|
+
------------
|
18
|
+
|
19
|
+
- Fix various issues about `OCI8.properties[:tcp_keepalive_time]` on macOS arm64. The feature was removed on the platform
|
20
|
+
and it raises `NotImplementedError` instead now.
|
21
|
+
- Fix SIGSEGV when using truffleruby. It seems to be caused by `xfree()` outside of ruby threads.
|
22
|
+
|
23
|
+
Changes
|
24
|
+
-------
|
25
|
+
|
26
|
+
- Change the format of fifth numeral of Oracle version number as two digit zero-padding number
|
27
|
+
when the Oracle version is 23 or upper. For example "23.4.0.24.05".
|
28
|
+
|
3
29
|
2.2.12 (2022-12-30)
|
4
30
|
===================
|
5
31
|
|
data/ext/oci8/extconf.rb
CHANGED
data/ext/oci8/oci8.c
CHANGED
@@ -437,7 +437,7 @@ typedef struct {
|
|
437
437
|
|
438
438
|
static void *complex_logoff_prepare(oci8_svcctx_t *svcctx)
|
439
439
|
{
|
440
|
-
complex_logoff_arg_t *cla =
|
440
|
+
complex_logoff_arg_t *cla = malloc(sizeof(complex_logoff_arg_t));
|
441
441
|
cla->svchp = svcctx->base.hp.svc;
|
442
442
|
cla->usrhp = svcctx->usrhp;
|
443
443
|
cla->srvhp = svcctx->srvhp;
|
@@ -479,7 +479,7 @@ static void *complex_logoff_execute(void *arg)
|
|
479
479
|
if (cla->svchp != NULL) {
|
480
480
|
OCIHandleFree(cla->svchp, OCI_HTYPE_SVCCTX);
|
481
481
|
}
|
482
|
-
|
482
|
+
free(cla);
|
483
483
|
return (void*)(VALUE)rv;
|
484
484
|
}
|
485
485
|
|
data/ext/oci8/oci8.h
CHANGED
@@ -29,11 +29,12 @@ extern "C"
|
|
29
29
|
* hexadecimal -> dotted version number hexadecimal -> dotted version number
|
30
30
|
* 0c102304 -> 12.1.2.3.4 12012034 -> 18.1.2.3.4
|
31
31
|
* ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
|
32
|
-
* 0c ------------' | | | |
|
33
|
-
* 1 --------------' | | |
|
34
|
-
* 02 --------------' | |
|
35
|
-
* 3 ---------------' |
|
36
|
-
* 04 ---------------'
|
32
|
+
* 0c ------------' | | | | 8 bits 12 ------------' | | | | 8 bits
|
33
|
+
* 1 --------------' | | | 4 bits 01 -------------' | | | 8 bits
|
34
|
+
* 02 --------------' | | 8 bits 2 --------------' | | 4 bits
|
35
|
+
* 3 ---------------' | 4 bits 03 --------------' | 8 bits
|
36
|
+
* 04 ---------------' 8 bits 4 ---------------' 4 bits
|
37
|
+
* total 32 bits total 32 bits
|
37
38
|
*/
|
38
39
|
#define ORAVERNUM(major, minor, update, patch, port_update) \
|
39
40
|
(((major) >= 18) ? (((major) << 24) | ((minor) << 16) | ((update) << 12) | ((patch) << 4) | (port_update)) \
|
data/ext/oci8/oci8lib.c
CHANGED
@@ -9,6 +9,7 @@
|
|
9
9
|
#endif
|
10
10
|
#if defined(HAVE_PLTHOOK) && !defined(WIN32)
|
11
11
|
#include <dlfcn.h>
|
12
|
+
#include <sys/mman.h>
|
12
13
|
#include "plthook.h"
|
13
14
|
#endif
|
14
15
|
|
@@ -135,6 +136,8 @@ static void rebind_internal_symbols(void)
|
|
135
136
|
void **addr;
|
136
137
|
const char *prefix;
|
137
138
|
size_t prefix_len;
|
139
|
+
int prot;
|
140
|
+
size_t page_size = sysconf(_SC_PAGESIZE);
|
138
141
|
|
139
142
|
#ifdef RTLD_FIRST
|
140
143
|
flags |= RTLD_FIRST; /* for macOS */
|
@@ -161,7 +164,7 @@ static void rebind_internal_symbols(void)
|
|
161
164
|
plthook_close(ph);
|
162
165
|
return;
|
163
166
|
}
|
164
|
-
while (
|
167
|
+
while (plthook_enum_with_prot(ph, &pos, &name, &addr, &prot) == 0) {
|
165
168
|
void *funcaddr;
|
166
169
|
if (prefix_len != 0) {
|
167
170
|
if (strncmp(name, prefix, prefix_len) != 0) {
|
@@ -179,7 +182,17 @@ static void rebind_internal_symbols(void)
|
|
179
182
|
* PLT entries are forcedly modified to point to itself not
|
180
183
|
* to use functions in other libraries.
|
181
184
|
*/
|
185
|
+
#define ALIGN_ADDR(addr) ((void*)((size_t)(addr) & ~(page_size - 1)))
|
186
|
+
if ((prot & PROT_WRITE) == 0) {
|
187
|
+
/* when the region containing addr isn't writable, make it writable temporarily */
|
188
|
+
if (mprotect(ALIGN_ADDR(addr), page_size, PROT_READ | PROT_WRITE) != 0) {
|
189
|
+
continue;
|
190
|
+
}
|
191
|
+
}
|
182
192
|
*addr = funcaddr;
|
193
|
+
if ((prot & PROT_WRITE) == 0) {
|
194
|
+
mprotect(ALIGN_ADDR(addr), page_size, prot);
|
195
|
+
}
|
183
196
|
}
|
184
197
|
}
|
185
198
|
plthook_close(ph);
|
@@ -675,28 +688,7 @@ void *oci8_find_symbol(const char *symbol_name)
|
|
675
688
|
|
676
689
|
void *oci8_check_typeddata(VALUE obj, const oci8_handle_data_type_t *data_type, int error_if_closed)
|
677
690
|
{
|
678
|
-
#ifdef HAVE_RB_DATA_TYPE_T_FUNCTION
|
679
691
|
oci8_base_t *hp = Check_TypedStruct(obj, &data_type->rb_data_type);
|
680
|
-
#else
|
681
|
-
oci8_base_t *hp;
|
682
|
-
const char *expected_type_name = data_type->rb_data_type.wrap_struct_name;
|
683
|
-
const rb_data_type_t *rb_data_type;
|
684
|
-
const rb_data_type_t *expected_rb_data_type = &data_type->rb_data_type;
|
685
|
-
|
686
|
-
if (TYPE(obj) != T_DATA || !rb_obj_is_kind_of(obj, oci8_cOCIHandle)) {
|
687
|
-
rb_raise(rb_eTypeError, "wrong argument type %s (expected %s)",
|
688
|
-
rb_obj_classname(obj), expected_type_name);
|
689
|
-
}
|
690
|
-
hp = DATA_PTR(obj);
|
691
|
-
rb_data_type = &hp->data_type->rb_data_type;
|
692
|
-
while (rb_data_type != expected_rb_data_type) {
|
693
|
-
if (rb_data_type == NULL) {
|
694
|
-
rb_raise(rb_eTypeError, "wrong argument type %s (expected %s)",
|
695
|
-
rb_obj_classname(obj), expected_type_name);
|
696
|
-
}
|
697
|
-
rb_data_type = rb_data_type->parent;
|
698
|
-
}
|
699
|
-
#endif
|
700
692
|
if (error_if_closed && hp->closed) {
|
701
693
|
rb_raise(eOCIException, "%s was already closed.",
|
702
694
|
rb_obj_classname(obj));
|
data/ext/oci8/oraconf.rb
CHANGED
@@ -130,6 +130,8 @@ class MiniSOReader
|
|
130
130
|
@cpu = :ia64
|
131
131
|
when 62
|
132
132
|
@cpu = :x86_64
|
133
|
+
when 183
|
134
|
+
@cpu = :aarch64
|
133
135
|
else
|
134
136
|
raise "Invalid ELF archtype: #{archtype}"
|
135
137
|
end
|
@@ -379,6 +381,8 @@ EOS
|
|
379
381
|
@@ld_envs = %w[PATH]
|
380
382
|
so_ext = 'dll'
|
381
383
|
check_proc = make_proc_to_check_cpu(is_32bit ? :i386 : :x86_64)
|
384
|
+
when /aarch64-linux/
|
385
|
+
check_proc = make_proc_to_check_cpu(:aarch64)
|
382
386
|
when /i.86-linux/
|
383
387
|
check_proc = make_proc_to_check_cpu(:i386)
|
384
388
|
when /ia64-linux/
|
data/ext/oci8/oradate.c
CHANGED
@@ -61,18 +61,7 @@ typedef struct ora_date ora_date_t;
|
|
61
61
|
if (sec < 0 || 59 < sec) \
|
62
62
|
rb_raise(rb_eRangeError, "Out of range for second %d (expect 0 .. 59)", sec)
|
63
63
|
|
64
|
-
#ifdef HAVE_RB_DATA_TYPE_T_FUNCTION
|
65
64
|
#define check_oradate(obj) ((ora_date_t*)Check_TypedStruct((obj), &odate_data_type))
|
66
|
-
#else
|
67
|
-
static ora_date_t *check_oradate(VALUE obj)
|
68
|
-
{
|
69
|
-
if (!rb_obj_is_kind_of(obj, cOraDate)) {
|
70
|
-
rb_raise(rb_eTypeError, "wrong argument type %s (expected %s)",
|
71
|
-
rb_obj_classname(obj), rb_class2name(cOraDate));
|
72
|
-
}
|
73
|
-
return DATA_PTR(obj);
|
74
|
-
}
|
75
|
-
#endif
|
76
65
|
|
77
66
|
static size_t odate_memsize(const void *ptr)
|
78
67
|
{
|
data/ext/oci8/plthook.h
CHANGED
@@ -59,8 +59,14 @@ int plthook_replace(plthook_t *plthook, const char *funcname, void *funcaddr, vo
|
|
59
59
|
void plthook_close(plthook_t *plthook);
|
60
60
|
const char *plthook_error(void);
|
61
61
|
|
62
|
+
/* enumerate entries with memory protection information (bitwise-OR of PROT_READ, PROT_WRITE and PROT_EXEC)
|
63
|
+
*
|
64
|
+
* source: plthook_elf.c and plthook_osx.c
|
65
|
+
*/
|
66
|
+
int plthook_enum_with_prot(plthook_t *plthook, unsigned int *pos, const char **name_out, void ***addr_out, int *prot);
|
67
|
+
|
62
68
|
#ifdef __cplusplus
|
63
|
-
}
|
69
|
+
} /* extern "C" */
|
64
70
|
#endif
|
65
71
|
|
66
72
|
#endif
|