pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: 10.99.12 and 9.3 both issue (Re: ruby 3.4.x Segfaults issue
In message <87wmdavhig.wl-makoto%if.t.u-tokyo.ac.jp@localhost>
on Fri, 28 Feb 2025 13:07:51 +0900,
Makoto Fujiwara <makoto%if.t.u-tokyo.ac.jp@localhost> wrote:
> I've tried the similar thing on NetBSD/amd64 9.3,
> and I've got the (probably) exact results.
I found out what is happennig. This problem exists not only NetBSD
current but 10.1_STABLE (and 9.x).
The problem exists in PRISM parser, Ruby 3.4 use it as default parser.
Old parser is still supported, using "--parser=parse.y" option solves
this problem.
(PRISM parser was introduced on Ruby 3.3 but it was experimental and
was not default parser. It could not be used for reading from stadard
input.)
Line 22617 from prism/prism.c:
static bool
pm_parse_stream_read(pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *fgets) {
#define LINE_SIZE 4096
char line[LINE_SIZE];
while (memset(line, '\n', LINE_SIZE), fgets(line, LINE_SIZE, stream) != NULL) {
This code expects call third parameter of pm_parse_stream_read() but
it calls standard fgets(3) as mef@ showed.
In message <87y0xqvib0.wl-makoto%if.t.u-tokyo.ac.jp@localhost>
on Fri, 28 Feb 2025 12:50:43 +0900,
Makoto Fujiwara <makoto%if.t.u-tokyo.ac.jp@localhost> wrote:
> | (gdb) bt
> | #0 0x00007dc205dd0961 in memchr () from /usr/lib/libc.so.12
> | #1 0x00007dc205d942ed in fgets () from /usr/lib/libc.so.12
> | #2 0x00007dc2063bb0d9 in pm_parse_stream_read.constprop () from /usr/pkg/lib/libruby34.so.34
> | #3 0x00007dc2063ec6df in pm_parse_stream () from /usr/pkg/lib/libruby34.so.34
> | #4 0x00007dc20619b32e in pm_parse_stdin () from /usr/pkg/lib/libruby34.so.34
> | #5 0x00007dc2062cfa7f in process_options () from /usr/pkg/lib/libruby34.so.34
This dose not happen on macOS 15.3.1 and maybe other systems and
I don't know what is the proper way to solve by compiler framework.
Anyway, I don't think it is *good* habbit to write such codes.
ruby34-3.4.2nb1 will be solve the problem.
Best regards.
--
Takahiro Kambe <taca%NetBSD.org@localhost>
Home |
Main Index |
Thread Index |
Old Index