Project

General

Profile

Actions

Bug #17794

closed

addr2line.c can free(3) an invalid pointer without zlib

Added by xtkoba (Tee KOBAYASHI) over 3 years ago. Updated almost 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:103390]

Description

When built without zlib (./configure ac_cv_lib_z_uncompress=no), ruby aborts immediately after C level backtrace information is printed.

$ ruby -e 'Process.kill :SEGV, $$'
-e:1: [BUG] Segmentation fault at 0x000003e8000052ac
(...snip...)
-- C level backtrace information -------------------------------------------
/var/tmp/build.debug/x86_64-linux-gcc/lib/libruby.so.3.1(0x7f8abe871147) [0x7f8abe871147]
[0x7f8abe871179]
(...snip...)
[0x7f8abe65b5fa]
/var/tmp/build.debug/x86_64-linux-gcc/bin/ruby(main+0x7f) [0x55d1e2fd1234] ../main.c:47
free(): invalid pointer
Aborted

This happens because at addr2line.c:2344 s->ptr can be an invalid pointer.

A patch is attached for a workaround that makes s->ptr either valid or NULL.


Files

ruby-addr2line-free-invalid-pointer.patch (490 Bytes) ruby-addr2line-free-invalid-pointer.patch xtkoba (Tee KOBAYASHI), 04/12/2021 04:20 AM

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #17991: [TEST, CRASH] TestBugReporter#test_bug_reporter_add ClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0