Git Product home page Git Product logo

hiredis-rb's Introduction

This README is just a fast quick start document. You can find more detailed documentation at redis.io.

What is Redis?

Redis is often referred to as a data structures server. What this means is that Redis provides access to mutable data structures via a set of commands, which are sent using a server-client model with TCP sockets and a simple protocol. So different processes can query and modify the same data structures in a shared way.

Data structures implemented into Redis have a few special properties:

  • Redis cares to store them on disk, even if they are always served and modified into the server memory. This means that Redis is fast, but that it is also non-volatile.
  • The implementation of data structures emphasizes memory efficiency, so data structures inside Redis will likely use less memory compared to the same data structure modelled using a high-level programming language.
  • Redis offers a number of features that are natural to find in a database, like replication, tunable levels of durability, clustering, and high availability.

Another good example is to think of Redis as a more complex version of memcached, where the operations are not just SETs and GETs, but operations that work with complex data types like Lists, Sets, ordered data structures, and so forth.

If you want to know more, this is a list of selected starting points:

Building Redis

Redis can be compiled and used on Linux, OSX, OpenBSD, NetBSD, FreeBSD. We support big endian and little endian architectures, and both 32 bit and 64 bit systems.

It may compile on Solaris derived systems (for instance SmartOS) but our support for this platform is best effort and Redis is not guaranteed to work as well as in Linux, OSX, and *BSD.

It is as simple as:

% make

To build with TLS support, you'll need OpenSSL development libraries (e.g. libssl-dev on Debian/Ubuntu) and run:

% make BUILD_TLS=yes

To build with systemd support, you'll need systemd development libraries (such as libsystemd-dev on Debian/Ubuntu or systemd-devel on CentOS) and run:

% make USE_SYSTEMD=yes

To append a suffix to Redis program names, use:

% make PROG_SUFFIX="-alt"

You can build a 32 bit Redis binary using:

% make 32bit

After building Redis, it is a good idea to test it using:

% make test

If TLS is built, running the tests with TLS enabled (you will need tcl-tls installed):

% ./utils/gen-test-certs.sh
% ./runtest --tls

Fixing build problems with dependencies or cached build options

Redis has some dependencies which are included in the deps directory. make does not automatically rebuild dependencies even if something in the source code of dependencies changes.

When you update the source code with git pull or when code inside the dependencies tree is modified in any other way, make sure to use the following command in order to really clean everything and rebuild from scratch:

% make distclean

This will clean: jemalloc, lua, hiredis, linenoise and other dependencies.

Also if you force certain build options like 32bit target, no C compiler optimizations (for debugging purposes), and other similar build time options, those options are cached indefinitely until you issue a make distclean command.

Fixing problems building 32 bit binaries

If after building Redis with a 32 bit target you need to rebuild it with a 64 bit target, or the other way around, you need to perform a make distclean in the root directory of the Redis distribution.

In case of build errors when trying to build a 32 bit binary of Redis, try the following steps:

  • Install the package libc6-dev-i386 (also try g++-multilib).
  • Try using the following command line instead of make 32bit: make CFLAGS="-m32 -march=native" LDFLAGS="-m32"

Allocator

Selecting a non-default memory allocator when building Redis is done by setting the MALLOC environment variable. Redis is compiled and linked against libc malloc by default, with the exception of jemalloc being the default on Linux systems. This default was picked because jemalloc has proven to have fewer fragmentation problems than libc malloc.

To force compiling against libc malloc, use:

% make MALLOC=libc

To compile against jemalloc on Mac OS X systems, use:

% make MALLOC=jemalloc

Monotonic clock

By default, Redis will build using the POSIX clock_gettime function as the monotonic clock source. On most modern systems, the internal processor clock can be used to improve performance. Cautions can be found here: http://oliveryang.net/2015/09/pitfalls-of-TSC-usage/

To build with support for the processor's internal instruction clock, use:

% make CFLAGS="-DUSE_PROCESSOR_CLOCK"

Verbose build

Redis will build with a user-friendly colorized output by default. If you want to see a more verbose output, use the following:

% make V=1

Running Redis

To run Redis with the default configuration, just type:

% cd src
% ./redis-server

If you want to provide your redis.conf, you have to run it using an additional parameter (the path of the configuration file):

% cd src
% ./redis-server /path/to/redis.conf

It is possible to alter the Redis configuration by passing parameters directly as options using the command line. Examples:

% ./redis-server --port 9999 --replicaof 127.0.0.1 6379
% ./redis-server /etc/redis/6379.conf --loglevel debug

All the options in redis.conf are also supported as options using the command line, with exactly the same name.

Running Redis with TLS:

Please consult the TLS.md file for more information on how to use Redis with TLS.

Playing with Redis

You can use redis-cli to play with Redis. Start a redis-server instance, then in another terminal try the following:

% cd src
% ./redis-cli
redis> ping
PONG
redis> set foo bar
OK
redis> get foo
"bar"
redis> incr mycounter
(integer) 1
redis> incr mycounter
(integer) 2
redis>

You can find the list of all the available commands at https://redis.io/commands.

Installing Redis

In order to install Redis binaries into /usr/local/bin, just use:

% make install

You can use make PREFIX=/some/other/directory install if you wish to use a different destination.

make install will just install binaries in your system, but will not configure init scripts and configuration files in the appropriate place. This is not needed if you just want to play a bit with Redis, but if you are installing it the proper way for a production system, we have a script that does this for Ubuntu and Debian systems:

% cd utils
% ./install_server.sh

Note: install_server.sh will not work on Mac OSX; it is built for Linux only.

The script will ask you a few questions and will setup everything you need to run Redis properly as a background daemon that will start again on system reboots.

You'll be able to stop and start Redis using the script named /etc/init.d/redis_<portnumber>, for instance /etc/init.d/redis_6379.

Code contributions

By contributing code to the Redis project in any form, including sending a pull request via GitHub, a code fragment or patch via private email or public discussion groups, you agree to release your code under the terms of the Redis Software Grant and Contributor License Agreement. Redis software contains contributions to the original Redis core project, which are owned by their contributors and licensed under the 3BSD license. Any copy of that license in this repository applies only to those contributions. Redis releases all Redis project versions from 7.4.x and thereafter under the RSALv2/SSPL dual-license as described in the LICENSE.txt file included in the Redis source distribution.

Please see the CONTRIBUTING.md file in this source distribution for more information. For security bugs and vulnerabilities, please see SECURITY.md.

Redis Trademarks

The purpose of a trademark is to identify the goods and services of a person or company without causing confusion. As the registered owner of its name and logo, Redis accepts certain limited uses of its trademarks but it has requirements that must be followed as described in its Trademark Guidelines available at: https://redis.com/legal/trademark-guidelines/.

Redis internals

If you are reading this README you are likely in front of a Github page or you just untarred the Redis distribution tar ball. In both the cases you are basically one step away from the source code, so here we explain the Redis source code layout, what is in each file as a general idea, the most important functions and structures inside the Redis server and so forth. We keep all the discussion at a high level without digging into the details since this document would be huge otherwise and our code base changes continuously, but a general idea should be a good starting point to understand more. Moreover most of the code is heavily commented and easy to follow.

Source code layout

The Redis root directory just contains this README, the Makefile which calls the real Makefile inside the src directory and an example configuration for Redis and Sentinel. You can find a few shell scripts that are used in order to execute the Redis, Redis Cluster and Redis Sentinel unit tests, which are implemented inside the tests directory.

Inside the root are the following important directories:

  • src: contains the Redis implementation, written in C.
  • tests: contains the unit tests, implemented in Tcl.
  • deps: contains libraries Redis uses. Everything needed to compile Redis is inside this directory; your system just needs to provide libc, a POSIX compatible interface and a C compiler. Notably deps contains a copy of jemalloc, which is the default allocator of Redis under Linux. Note that under deps there are also things which started with the Redis project, but for which the main repository is not redis/redis.

There are a few more directories but they are not very important for our goals here. We'll focus mostly on src, where the Redis implementation is contained, exploring what there is inside each file. The order in which files are exposed is the logical one to follow in order to disclose different layers of complexity incrementally.

Note: lately Redis was refactored quite a bit. Function names and file names have been changed, so you may find that this documentation reflects the unstable branch more closely. For instance, in Redis 3.0 the server.c and server.h files were named redis.c and redis.h. However the overall structure is the same. Keep in mind that all the new developments and pull requests should be performed against the unstable branch.

server.h

The simplest way to understand how a program works is to understand the data structures it uses. So we'll start from the main header file of Redis, which is server.h.

All the server configuration and in general all the shared state is defined in a global structure called server, of type struct redisServer. A few important fields in this structure are:

  • server.db is an array of Redis databases, where data is stored.
  • server.commands is the command table.
  • server.clients is a linked list of clients connected to the server.
  • server.master is a special client, the master, if the instance is a replica.

There are tons of other fields. Most fields are commented directly inside the structure definition.

Another important Redis data structure is the one defining a client. In the past it was called redisClient, now just client. The structure has many fields, here we'll just show the main ones:

struct client {
    int fd;
    sds querybuf;
    int argc;
    robj **argv;
    redisDb *db;
    int flags;
    list *reply;
    // ... many other fields ...
    char buf[PROTO_REPLY_CHUNK_BYTES];
}

The client structure defines a connected client:

  • The fd field is the client socket file descriptor.
  • argc and argv are populated with the command the client is executing, so that functions implementing a given Redis command can read the arguments.
  • querybuf accumulates the requests from the client, which are parsed by the Redis server according to the Redis protocol and executed by calling the implementations of the commands the client is executing.
  • reply and buf are dynamic and static buffers that accumulate the replies the server sends to the client. These buffers are incrementally written to the socket as soon as the file descriptor is writable.

As you can see in the client structure above, arguments in a command are described as robj structures. The following is the full robj structure, which defines a Redis object:

struct redisObject {
    unsigned type:4;
    unsigned encoding:4;
    unsigned lru:LRU_BITS; /* LRU time (relative to global lru_clock) or
                            * LFU data (least significant 8 bits frequency
                            * and most significant 16 bits access time). */
    int refcount;
    void *ptr;
};

Basically this structure can represent all the basic Redis data types like strings, lists, sets, sorted sets and so forth. The interesting thing is that it has a type field, so that it is possible to know what type a given object has, and a refcount, so that the same object can be referenced in multiple places without allocating it multiple times. Finally the ptr field points to the actual representation of the object, which might vary even for the same type, depending on the encoding used.

Redis objects are used extensively in the Redis internals, however in order to avoid the overhead of indirect accesses, recently in many places we just use plain dynamic strings not wrapped inside a Redis object.

server.c

This is the entry point of the Redis server, where the main() function is defined. The following are the most important steps in order to startup the Redis server.

  • initServerConfig() sets up the default values of the server structure.
  • initServer() allocates the data structures needed to operate, setup the listening socket, and so forth.
  • aeMain() starts the event loop which listens for new connections.

There are two special functions called periodically by the event loop:

  1. serverCron() is called periodically (according to server.hz frequency), and performs tasks that must be performed from time to time, like checking for timed out clients.
  2. beforeSleep() is called every time the event loop fired, Redis served a few requests, and is returning back into the event loop.

Inside server.c you can find code that handles other vital things of the Redis server:

  • call() is used in order to call a given command in the context of a given client.
  • activeExpireCycle() handles eviction of keys with a time to live set via the EXPIRE command.
  • performEvictions() is called when a new write command should be performed but Redis is out of memory according to the maxmemory directive.
  • The global variable redisCommandTable defines all the Redis commands, specifying the name of the command, the function implementing the command, the number of arguments required, and other properties of each command.

commands.c

This file is auto generated by utils/generate-command-code.py, the content is based on the JSON files in the src/commands folder. These are meant to be the single source of truth about the Redis commands, and all the metadata about them. These JSON files are not meant to be used by anyone directly, instead that metadata can be obtained via the COMMAND command.

networking.c

This file defines all the I/O functions with clients, masters and replicas (which in Redis are just special clients):

  • createClient() allocates and initializes a new client.
  • The addReply*() family of functions are used by command implementations in order to append data to the client structure, that will be transmitted to the client as a reply for a given command executed.
  • writeToClient() transmits the data pending in the output buffers to the client and is called by the writable event handler sendReplyToClient().
  • readQueryFromClient() is the readable event handler and accumulates data read from the client into the query buffer.
  • processInputBuffer() is the entry point in order to parse the client query buffer according to the Redis protocol. Once commands are ready to be processed, it calls processCommand() which is defined inside server.c in order to actually execute the command.
  • freeClient() deallocates, disconnects and removes a client.

aof.c and rdb.c

As you can guess from the names, these files implement the RDB and AOF persistence for Redis. Redis uses a persistence model based on the fork() system call in order to create a process with the same (shared) memory content of the main Redis process. This secondary process dumps the content of the memory on disk. This is used by rdb.c to create the snapshots on disk and by aof.c in order to perform the AOF rewrite when the append only file gets too big.

The implementation inside aof.c has additional functions in order to implement an API that allows commands to append new commands into the AOF file as clients execute them.

The call() function defined inside server.c is responsible for calling the functions that in turn will write the commands into the AOF.

db.c

Certain Redis commands operate on specific data types; others are general. Examples of generic commands are DEL and EXPIRE. They operate on keys and not on their values specifically. All those generic commands are defined inside db.c.

Moreover db.c implements an API in order to perform certain operations on the Redis dataset without directly accessing the internal data structures.

The most important functions inside db.c which are used in many command implementations are the following:

  • lookupKeyRead() and lookupKeyWrite() are used in order to get a pointer to the value associated to a given key, or NULL if the key does not exist.
  • dbAdd() and its higher level counterpart setKey() create a new key in a Redis database.
  • dbDelete() removes a key and its associated value.
  • emptyData() removes an entire single database or all the databases defined.

The rest of the file implements the generic commands exposed to the client.

object.c

The robj structure defining Redis objects was already described. Inside object.c there are all the functions that operate with Redis objects at a basic level, like functions to allocate new objects, handle the reference counting and so forth. Notable functions inside this file:

  • incrRefCount() and decrRefCount() are used in order to increment or decrement an object reference count. When it drops to 0 the object is finally freed.
  • createObject() allocates a new object. There are also specialized functions to allocate string objects having a specific content, like createStringObjectFromLongLong() and similar functions.

This file also implements the OBJECT command.

replication.c

This is one of the most complex files inside Redis, it is recommended to approach it only after getting a bit familiar with the rest of the code base. In this file there is the implementation of both the master and replica role of Redis.

One of the most important functions inside this file is replicationFeedSlaves() that writes commands to the clients representing replica instances connected to our master, so that the replicas can get the writes performed by the clients: this way their data set will remain synchronized with the one in the master.

This file also implements both the SYNC and PSYNC commands that are used in order to perform the first synchronization between masters and replicas, or to continue the replication after a disconnection.

Script

The script unit is composed of 3 units:

  • script.c - integration of scripts with Redis (commands execution, set replication/resp, ...)
  • script_lua.c - responsible to execute Lua code, uses script.c to interact with Redis from within the Lua code.
  • function_lua.c - contains the Lua engine implementation, uses script_lua.c to execute the Lua code.
  • functions.c - contains Redis Functions implementation (FUNCTION command), uses functions_lua.c if the function it wants to invoke needs the Lua engine.
  • eval.c - contains the eval implementation using script_lua.c to invoke the Lua code.

Other C files

  • t_hash.c, t_list.c, t_set.c, t_string.c, t_zset.c and t_stream.c contains the implementation of the Redis data types. They implement both an API to access a given data type, and the client command implementations for these data types.
  • ae.c implements the Redis event loop, it's a self contained library which is simple to read and understand.
  • sds.c is the Redis string library, check https://github.com/antirez/sds for more information.
  • anet.c is a library to use POSIX networking in a simpler way compared to the raw interface exposed by the kernel.
  • dict.c is an implementation of a non-blocking hash table which rehashes incrementally.
  • cluster.c implements the Redis Cluster. Probably a good read only after being very familiar with the rest of the Redis code base. If you want to read cluster.c make sure to read the Redis Cluster specification.

Anatomy of a Redis command

All the Redis commands are defined in the following way:

void foobarCommand(client *c) {
    printf("%s",c->argv[1]->ptr); /* Do something with the argument. */
    addReply(c,shared.ok); /* Reply something to the client. */
}

The command function is referenced by a JSON file, together with its metadata, see commands.c described above for details. The command flags are documented in the comment above the struct redisCommand in server.h. For other details, please refer to the COMMAND command. https://redis.io/commands/command/

After the command operates in some way, it returns a reply to the client, usually using addReply() or a similar function defined inside networking.c.

There are tons of command implementations inside the Redis source code that can serve as examples of actual commands implementations (e.g. pingCommand). Writing a few toy commands can be a good exercise to get familiar with the code base.

There are also many other files not described here, but it is useless to cover everything. We just want to help you with the first steps. Eventually you'll find your way inside the Redis code base :-)

Enjoy!

hiredis-rb's People

Contributors

artygus avatar badboy avatar byroot avatar chayim avatar chulkilee avatar dbussink avatar mathieujobin avatar michael-grunder avatar mloughran avatar ohler55 avatar olleolleolle avatar pietern avatar pvalena avatar rafaelfranca avatar royaltm avatar sgrif avatar soveran avatar stanhu avatar thedrow avatar y-yagi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hiredis-rb's Issues

Hiredis issue when using with redis.rb and sentinel

Hi, when using hiredis with redis.rb sentinel connections I get the following error:

/Library/Ruby/Gems/2.0.0/gems/redis-3.0.7/lib/redis/connection/hiredis.rb:16:in connect': nodename nor servname provided, or not known (RuntimeError) from /Library/Ruby/Gems/2.0.0/gems/redis-3.0.7/lib/redis/connection/hiredis.rb:16:inconnect'
from /Library/Ruby/Gems/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:285:in establish_connection' from /Library/Ruby/Gems/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:79:inblock in connect'
from /Library/Ruby/Gems/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:257:in with_reconnect' from /Library/Ruby/Gems/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:78:inconnect'
from /Library/Ruby/Gems/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:304:in ensure_connected' from /Library/Ruby/Gems/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:191:inblock in process'
from /Library/Ruby/Gems/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:270:in logging' from /Library/Ruby/Gems/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:190:inprocess'
from /Library/Ruby/Gems/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:96:in call' from /Library/Ruby/Gems/2.0.0/gems/redis-3.0.7/lib/redis.rb:426:inblock in exists'
from /Library/Ruby/Gems/2.0.0/gems/redis-3.0.7/lib/redis.rb:37:in block in synchronize' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/monitor.rb:211:inmon_synchronize'
from /Library/Ruby/Gems/2.0.0/gems/redis-3.0.7/lib/redis.rb:37:in synchronize' from /Library/Ruby/Gems/2.0.0/gems/redis-3.0.7/lib/redis.rb:425:inexists'
from /Library/Ruby/Gems/2.0.0/gems/redis-namespace-1.5.1/lib/redis/namespace.rb:392:in call_with_namespace' from /Library/Ruby/Gems/2.0.0/gems/redis-namespace-1.5.1/lib/redis/namespace.rb:289:inmethod_missing'
from /Users/ll/.gem/ruby/2.0.0/gems/resque-scheduler-4.0.0/lib/resque/scheduler/scheduling_extensions.rb:55:in schedule=' from /Users/ll/riff-rails/config/initializers/resque.rb:7:in<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:223:in load' from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:223:inblock in load'
from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:214:in load_dependency' from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:223:inload'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.5/lib/rails/engine.rb:609:in block (2 levels) in <class:Engine>' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.5/lib/rails/engine.rb:608:ineach'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.5/lib/rails/engine.rb:608:in block in <class:Engine>' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.5/lib/rails/initializable.rb:30:ininstance_exec'
from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.5/lib/rails/initializable.rb:30:in run' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.5/lib/rails/initializable.rb:55:inblock in run_initializers'

Does hiredis support sentinels?

Errno::EINVAL: Invalid argument when using hiredis

When I connect to a server with authentication, I get the following error:

Errno::EINVAL: Invalid argument
from /home/dan/.rvm/gems/ruby-2.5.3@gemset/gems/redis-4.1.0/lib/redis/connection/hiredis.rb:19:in `connect'
/home/dan/.rvm/gems/ruby-2.5.3@gemset/gems/redis-4.1.0/lib/redis/connection/hiredis.rb:19:in `connect'
/home/dan/.rvm/gems/ruby-2.5.3@gemset/gems/redis-4.1.0/lib/redis/client.rb:342:in `establish_connection'
/home/dan/.rvm/gems/ruby-2.5.3@gemset/gems/redis-4.1.0/lib/redis/client.rb:104:in `block in connect'
/home/dan/.rvm/gems/ruby-2.5.3@gemset/gems/redis-4.1.0/lib/redis/client.rb:299:in `with_reconnect'
/home/dan/.rvm/gems/ruby-2.5.3@gemset/gems/redis-4.1.0/lib/redis/client.rb:103:in `connect'
/home/dan/.rvm/gems/ruby-2.5.3@gemset/gems/redis-4.1.0/lib/redis/client.rb:372:in `ensure_connected'
/home/dan/.rvm/gems/ruby-2.5.3@gemset/gems/redis-4.1.0/lib/redis/client.rb:224:in `block in process'
/home/dan/.rvm/gems/ruby-2.5.3@gemset/gems/redis-4.1.0/lib/redis/client.rb:312:in `logging'
/home/dan/.rvm/gems/ruby-2.5.3@gemset/gems/redis-4.1.0/lib/redis/client.rb:223:in `process'
/home/dan/.rvm/gems/ruby-2.5.3@gemset/gems/redis-4.1.0/lib/redis/client.rb:123:in `call'
/home/dan/.rvm/gems/ruby-2.5.3@gemset/gems/redis-4.1.0/lib/redis.rb:561:in `block in keys'
/home/dan/.rvm/gems/ruby-2.5.3@gemset/gems/redis-4.1.0/lib/redis.rb:50:in `block in synchronize'
/home/dan/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
/home/dan/.rvm/gems/ruby-2.5.3@gemset/gems/redis-4.1.0/lib/redis.rb:50:in `synchronize'
/home/dan/.rvm/gems/ruby-2.5.3@gemset/gems/redis-4.1.0/lib/redis.rb:560:in `keys'
(pry):7:in `__pry__'

Steps to reproduce:

$ pry
[1] pry(main)> require 'redis'
=> true
[2] pry(main)> require 'hiredis'
=> true
[3] pry(main)> conn = Redis.new(url: 'redis://:[email protected]:16900')
=> #<Redis client v4.1.0 for redis://redacted.ec2.cloud.redislabs.com:16900/0>
[4] pry(main)> conn.get 'queues'
=> nil
[5] pry(main)> conn2 = Redis.new(url: 'redis://:REDACTED
@redacted.ec2.cloud.redislabs.com:16900', driver: :hiredis)
=> #<Redis client v4.1.0 for redis://redacted.ec2.cloud.redislabs.com:16900/0>
[7] pry(main)> conn2.keys '*'
Errno::EINVAL: Invalid argument
from /home/dan/.rvm/gems/ruby-2.5.3@gemset/gems/redis-4.1.0/lib/redis/connection/hiredis.rb:19:in `connect'

Note that although I've redacted our server URL and credentials for obvious reasons, the arguments are the same. Only the driver is different.

My environment:

$ uname -a
Linux arcturus 4.4.0-17763-Microsoft #253-Microsoft Mon Dec 31 17:49:00 PST 2018 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:        18.04
Codename:       bionic

I suspect it might be related to my environment, since I have not experienced this error on macOS. However, I have not had issues with any of the other development tools I've used, including many with native extensions as hiredis has.

Native extension build failing

I'm having this problem with the just released version 0.6.2. The output of the mkmf.log is below.
FWIW I'm hitting this problem on travis-ci as well.

have_header: checking for sys/socket.h... -------------------- yes

"gcc -o conftest -I/Users/cjcolvar/.rvm/rubies/ruby-2.4.1/include/ruby-2.4.0/x86_64-darwin15 -I/Users/cjcolvar/.rvm/rubies/ruby-2.4.1/include/ruby-2.4.0/ruby/backward -I/Users/cjcolvar/.rvm/rubies/ruby-2.4.1/include/ruby-2.4.0 -I.  -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/[email protected]/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens  -fno-common -pipe conftest.c  -L. -L/Users/cjcolvar/.rvm/rubies/ruby-2.4.1/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/[email protected]/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/[email protected]/lib     -lruby.2.4.1  -lpthread -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

"gcc -E -I/Users/cjcolvar/.rvm/rubies/ruby-2.4.1/include/ruby-2.4.0/x86_64-darwin15 -I/Users/cjcolvar/.rvm/rubies/ruby-2.4.1/include/ruby-2.4.0/ruby/backward -I/Users/cjcolvar/.rvm/rubies/ruby-2.4.1/include/ruby-2.4.0 -I.  -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/[email protected]/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens  -fno-common -pipe  conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <sys/socket.h>
/* end */

--------------------

Cannot load `redis/connection/hiredis` on application start

Environment

  • rails 7.0.4.2
  • redis 5.0.6
  • hiredis 0.6.3

Backtrace

/Users/viet/.rvm/gems/ruby-3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require': cannot load such file -- redis/connection/hiredis (LoadError)
        from /Users/viet/.rvm/gems/ruby-3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
        from /Users/viet/.rvm/gems/ruby-3.2.0/gems/bundler-2.4.3/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
        from /Users/viet/.rvm/gems/ruby-3.2.0/gems/bundler-2.4.3/lib/bundler/runtime.rb:55:in `each'
        from /Users/viet/.rvm/gems/ruby-3.2.0/gems/bundler-2.4.3/lib/bundler/runtime.rb:55:in `block in require'
        from /Users/viet/.rvm/gems/ruby-3.2.0/gems/bundler-2.4.3/lib/bundler/runtime.rb:44:in `each'
        from /Users/viet/.rvm/gems/ruby-3.2.0/gems/bundler-2.4.3/lib/bundler/runtime.rb:44:in `require'
        from /Users/viet/.rvm/gems/ruby-3.2.0/gems/bundler-2.4.3/lib/bundler.rb:195:in `require'
        from /Users/viet/Workspaces/wanikani/config/application.rb:24:in `<main>'
        from /Users/viet/.rvm/gems/ruby-3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /Users/viet/.rvm/gems/ruby-3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /Users/viet/.rvm/gems/ruby-3.2.0/gems/railties-7.0.4.2/lib/rails/commands/server/server_command.rb:137:in `block in perform'
        from <internal:kernel>:90:in `tap'
        from /Users/viet/.rvm/gems/ruby-3.2.0/gems/railties-7.0.4.2/lib/rails/commands/server/server_command.rb:134:in `perform'
        from /Users/viet/.rvm/gems/ruby-3.2.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
        from /Users/viet/.rvm/gems/ruby-3.2.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
        from /Users/viet/.rvm/gems/ruby-3.2.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
        from /Users/viet/.rvm/gems/ruby-3.2.0/gems/railties-7.0.4.2/lib/rails/command/base.rb:87:in `perform'
        from /Users/viet/.rvm/gems/ruby-3.2.0/gems/railties-7.0.4.2/lib/rails/command.rb:48:in `invoke'
        from /Users/viet/.rvm/gems/ruby-3.2.0/gems/railties-7.0.4.2/lib/rails/commands.rb:18:in `<main>'
        from /Users/viet/.rvm/gems/ruby-3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /Users/viet/.rvm/gems/ruby-3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'

Observation

I am coming off a redis update from 4.8.0. Prior to the upgrade to 5.0.6 my application loads without issue.

The error appears when I boot up my application using rails s

I have tried looking at the https://github.com/redis/redis-rb for issues pertaining to loading hiredis in the new major version 5 update, but I couldn't source anything.

In the application's Gemfile hiredis is required as such,

gem 'redis', require: ['redis', 'redis/connection/hiredis']

Any guidance on figuring out this issue is appreciated.

cannot load such file -- redis/connection/hiredis

Hello!

I'm trying to set this up for the first time on my machine, and getting trouble in any app I try and use the gem. Easily repro'd (for me) with the demo instructions (section 7) here: https://github.com/kigster/simple-feed#7-running-the-examples-and-specs

Following those steps, I get:

LoadError:
  cannot load such file -- redis/connection/hiredis
# ./lib/simplefeed/providers/redis/driver.rb:4:in `<top (required)>'

I get the same error with this in my Gemfile:

gem "hiredis", "~> 0.6.0"
gem "redis", ">= 3.2.0", require: %w[redis redis/connection/hiredis]

When starting my server:

22:07:01 css.1  | rails aborted!
22:07:01 css.1  | LoadError: cannot load such file -- redis/connection/hiredis
22:07:01 css.1  | <internal:/Users/peterehrlich/.rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'

Have tried a few steps to no effect - such as installing hiredis via homebrew (although I saw in another thread that that's not necessary as the rubygem is self contained). Any tips for troubleshooting this? Thanks!

Specs:

ruby 3.2.2
gem -v --> 3.4.10
bundler --version --> 2.4.10
OSX Ventura 13.1 M2

No sys/socket.h in connection.c on Mingw

It is a well-known limitation that one has to use winsock2.h instead sys/socket.h for Mingw, so I would like to see this issue addressed.

Update note: Using cygwin rather than vanilla XP Command Prompt allows me to install the gem.

Unable to install on latest master

Hi, I'm trying to use hiredis with the native SSL support, which seems to be available on the master branch of the repo, but I'm unable to install the gem when specifying gem 'hiredis', github: 'redis/hiredis-rb' in my Gemfile.

I'm using Ruby 2.7.5., M1 Max MacBook, but this also happens on a Ubuntu 20.04 machine. The stacktrace is quite mysterious, so I wasn't able to figure out where or why it's failing. I have hiredis installed via brew.

Any pointers appreciated!

Here are the stacktrace and related files:

bundle install
> bundle install

...
Using hiredis 0.6.3 from https://github.com/redis/hiredis-rb.git (at master@a66f527)
/Users/gyfis/.rbenv/versions/2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:167: warning: conflicting chdir during another chdir block
/Users/gyfis/.rbenv/versions/2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:175: warning: conflicting chdir during another chdir block
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/gyfis/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/bundler/gems/hiredis-rb-a66f527d7661/ext/hiredis_ext
/Users/gyfis/.rbenv/versions/2.7.5/bin/ruby -I /Users/gyfis/.rbenv/versions/2.7.5/lib/ruby/2.7.0 -r ./siteconf20220211-34460-1bi0xss.rb extconf.rb --with-cflags\=-std\=c99
checking for sys/socket.h... yes
make: *** No rule to make target `static'.  Stop.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/Users/gyfis/.rbenv/versions/2.7.5/bin/$(RUBY_BASE_NAME)
        --with-sys-dir
        --without-sys-dir
        --with-sys-include
        --without-sys-include=${sys-dir}/include
        --with-sys-lib
        --without-sys-lib=${sys-dir}/lib
extconf.rb:33:in `block in <main>': Building hiredis failed (RuntimeError)
        from extconf.rb:31:in `chdir'
        from extconf.rb:31:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/gyfis/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/bundler/gems/extensions/arm64-darwin-21/2.7.0/hiredis-rb-a66f527d7661/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/gyfis/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/bundler/gems/hiredis-rb-a66f527d7661 for inspection.
Results logged to /Users/gyfis/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/bundler/gems/extensions/arm64-darwin-21/2.7.0/hiredis-rb-a66f527d7661/gem_make.out

An error occurred while installing hiredis (0.6.3), and Bundler cannot continue.

In Gemfile:
  hiredis
Here's the` hiredis-rb-a66f527d7661/mkmf.log`:
have_header: checking for sys/socket.h... -------------------- yes

"clang -o conftest -I/Users/gyfis/.rbenv/versions/2.7.5/include/ruby-2.7.0/arm64-darwin21 -I/Users/gyfis/.rbenv/versions/2.7.5/include/ruby-2.7.0/ruby/backward -I/Users/gyfis/.rbenv/versions/2.7.5/include/ruby-2.7.0 -I. -I/Users/gyfis/.rbenv/versions/2.7.5/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -std=c99 conftest.c  -L. -L/Users/gyfis/.rbenv/versions/2.7.5/lib -L. -L/Users/gyfis/.rbenv/versions/2.7.5/lib  -fstack-protector-strong  -m64   -lruby.2.7   "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

"clang -E -I/Users/gyfis/.rbenv/versions/2.7.5/include/ruby-2.7.0/arm64-darwin21 -I/Users/gyfis/.rbenv/versions/2.7.5/include/ruby-2.7.0/ruby/backward -I/Users/gyfis/.rbenv/versions/2.7.5/include/ruby-2.7.0 -I. -I/Users/gyfis/.rbenv/versions/2.7.5/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -std=c99  conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <sys/socket.h>
/* end */

--------------------

And here's the `gem_make.out`:
current directory: /Users/gyfis/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/bundler/gems/hiredis-rb-a66f527d7661/ext/hiredis_ext
/Users/gyfis/.rbenv/versions/2.7.5/bin/ruby -I /Users/gyfis/.rbenv/versions/2.7.5/lib/ruby/2.7.0 -r ./siteconf20220211-34460-1bi0xss.rb extconf.rb --with-cflags\=-std\=c99
checking for sys/socket.h... yes
make: *** No rule to make target `static'.  Stop.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/Users/gyfis/.rbenv/versions/2.7.5/bin/$(RUBY_BASE_NAME)
	--with-sys-dir
	--without-sys-dir
	--with-sys-include
	--without-sys-include=${sys-dir}/include
	--with-sys-lib
	--without-sys-lib=${sys-dir}/lib
extconf.rb:33:in `block in <main>': Building hiredis failed (RuntimeError)
	from extconf.rb:31:in `chdir'
	from extconf.rb:31:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/gyfis/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/bundler/gems/extensions/arm64-darwin-21/2.7.0/hiredis-rb-a66f527d7661/mkmf.log

extconf failed, exit code 1

Does not work with fakeredis

Tests still use my local redis connection when hiredis is included, not the fake store created by fakeredis.
Using the regular redis gem or redis-rails does not have this problem.

rb_wait_for_single_fd() should probably be used instead of rb_thread_fd_select()

I've noticed this gem is using rb_thread_fd_select() in

#define _thread_fd_select(n, r, w, e, t) rb_thread_fd_select(n, r, w, e, t)

And it's used by
if (_thread_fd_select(fd + 1, &fds, NULL, NULL, toptr) < 0) {

and
if (_thread_fd_select(fd + 1, NULL, &fds, NULL, toptr) < 0) {

to wait for a single file descriptor, either read or write.

rb_thread_fd_select() uses select(2) internally which is rather inefficient, especially with a large number of open file descriptors.
So int rb_wait_for_single_fd(int fd, int events, struct timeval *tv); seems a better fit there, and that uses poll() internally which is much more efficient.


As Ruby APIs there is also IO#wait_readable and IO#wait_writable. That's probably less easy to use from C as it takes a Float and not a struct timeval for the timeout.

Error compiling on freeBSD 10.0

I have problem compiling the hiredis :

        /usr/local/bin/ruby19 extconf.rb
make: "/usr/local/lib/ruby/gems/1.9/gems/hiredis-0.5.1/vendor/hiredis/Makefile" line 32: Missing dependency operator
make: "/usr/local/lib/ruby/gems/1.9/gems/hiredis-0.5.1/vendor/hiredis/Makefile" line 36: Need an operator
make: "/usr/local/lib/ruby/gems/1.9/gems/hiredis-0.5.1/vendor/hiredis/Makefile" line 37: Missing dependency operator
make: "/usr/local/lib/ruby/gems/1.9/gems/hiredis-0.5.1/vendor/hiredis/Makefile" line 42: Need an operator
make: "/usr/local/lib/ruby/gems/1.9/gems/hiredis-0.5.1/vendor/hiredis/Makefile" line 70: Need an operator
make: "/usr/local/lib/ruby/gems/1.9/gems/hiredis-0.5.1/vendor/hiredis/Makefile" line 74: Need an operator
make: "/usr/local/lib/ruby/gems/1.9/gems/hiredis-0.5.1/vendor/hiredis/Makefile" line 76: warning: duplicate script for target "hiredis-example-ae" ignored
make: "/usr/local/lib/ruby/gems/1.9/gems/hiredis-0.5.1/vendor/hiredis/Makefile" line 73: warning: using previous script for "hiredis-example-ae" defined here
make: "/usr/local/lib/ruby/gems/1.9/gems/hiredis-0.5.1/vendor/hiredis/Makefile" line 77: Need an operator
make: "/usr/local/lib/ruby/gems/1.9/gems/hiredis-0.5.1/vendor/hiredis/Makefile" line 113: Missing dependency operator
make: "/usr/local/lib/ruby/gems/1.9/gems/hiredis-0.5.1/vendor/hiredis/Makefile" line 115: Need an operator
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/local/lib/ruby/gems/1.9/gems/hiredis-0.5.1/vendor/hiredis
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/local/bin/ruby19
extconf.rb:20:in `block in <main>': Building hiredis failed (RuntimeError)
        from extconf.rb:18:in `chdir'
        from extconf.rb:18:in `<main>'


Gem files will remain installed in /usr/local/lib/ruby/gems/1.9/gems/hiredis-0.5.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9/gems/hiredis-0.5.1/ext/hiredis_ext/gem_make.out

Failed gem build: Ubuntu 11.04 64-bit

I'm having some issues building this gem. System info and build information as follows:

∴ uname -a
Linux brain 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
∴ ruby --version
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
∴ gem install hiredis
Building native extensions.  This could take a while...
ERROR:  Error installing hiredis:
        ERROR: Failed to build gem native extension.

        /home/bracer/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
cc -std=c99 -pedantic -c -I/home/bracer/local/include  -g -ggdb  net.c
cc -std=c99 -pedantic -c -I/home/bracer/local/include  -g -ggdb  hiredis.c
cc -std=c99 -pedantic -c -I/home/bracer/local/include  -g -ggdb  sds.c
cc -std=c99 -pedantic -c -I/home/bracer/local/include  -g -ggdb  async.c
ar rcs libhiredis.a net.o hiredis.o sds.o async.o
creating Makefile

make
gcc -I. -I/home/bracer/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/x86_64-linux -I/home/bracer/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/ruby/backward -I/home/bracer/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1 -I. -I/home/bracer/local/include   -fPIC -I/home/bracer/local/include -fPIC -I/home/bracer/.rvm/gems/ruby-1.9.2-p180@yaptime/gems/hiredis-0.3.2/vendor/hiredis  -o hiredis_ext.o -c hiredis_ext.c
gcc -I. -I/home/bracer/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/x86_64-linux -I/home/bracer/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/ruby/backward -I/home/bracer/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1 -I. -I/home/bracer/local/include   -fPIC -I/home/bracer/local/include -fPIC -I/home/bracer/.rvm/gems/ruby-1.9.2-p180@yaptime/gems/hiredis-0.3.2/vendor/hiredis  -o connection.o -c connection.c
gcc -I. -I/home/bracer/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/x86_64-linux -I/home/bracer/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/ruby/backward -I/home/bracer/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1 -I. -I/home/bracer/local/include   -fPIC -I/home/bracer/local/include -fPIC -I/home/bracer/.rvm/gems/ruby-1.9.2-p180@yaptime/gems/hiredis-0.3.2/vendor/hiredis  -o reader.o -c reader.c
gcc -shared -o hiredis_ext.so hiredis_ext.o connection.o reader.o -L. -L/home/bracer/.rvm/rubies/ruby-1.9.2-p180/lib -Wl,-R/home/bracer/.rvm/rubies/ruby-1.9.2-p180/lib -L.  -rdynamic -Wl,-export-dynamic /home/bracer/.rvm/gems/ruby-1.9.2-p180@yaptime/gems/hiredis-0.3.2/vendor/hiredis/libhiredis.a   -Wl,-R -Wl,/home/bracer/.rvm/rubies/ruby-1.9.2-p180/lib -L/home/bracer/.rvm/rubies/ruby-1.9.2-p180/lib -lruby  -lpthread -lrt -ldl -lcrypt -lm   -lc
/usr/bin/ld: /home/bracer/.rvm/gems/ruby-1.9.2-p180@yaptime/gems/hiredis-0.3.2/vendor/hiredis/libhiredis.a(hiredis.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/home/bracer/.rvm/gems/ruby-1.9.2-p180@yaptime/gems/hiredis-0.3.2/vendor/hiredis/libhiredis.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [hiredis_ext.so] Error 1


Gem files will remain installed in /home/bracer/.rvm/gems/ruby-1.9.2-p180@yaptime/gems/hiredis-0.3.2 for inspection.
Results logged to /home/bracer/.rvm/gems/ruby-1.9.2-p180@yaptime/gems/hiredis-0.3.2/ext/hiredis_ext/gem_make.out

[packaging] segfault when using the system hiredis shared library

Hello,

I'm trying to package this for GNU Guix, and like Debian, we have as policy to use the system libraries, so I applied the following Debian's patch: https://sources.debian.org/src/ruby-hiredis/0.6.3-2/debian/patches/use_system_libhiredis.patch/.

It builds and installs fine, but segfaults at run time, such as when running rake test, as shown below:

$ rake test --trace
** Invoke test (first_time)
** Execute test
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/bin/ruby -w -I"lib" -I"/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib" "/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/rake_test_loader.rb" "test/connection_test.rb" "test/reader_test.rb" 
/tmp/guix-build-ruby-hiredis-0.6.3.drv-0/source/test/connection_test.rb:279: warning: ambiguous first argument; put parentheses or a space even after `/' operator
Run options: --seed 56889

# Running:

..../gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/assertions.rb:130: [BUG] Segmentation fault at 0x0000000000000000
ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0031 p:0004 s:0188 e:000186 METHOD /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/assertions.rb:130
c:0030 p:0005 s:0179 e:000178 METHOD /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/assertions.rb:153
c:0029 p:0012 s:0170 e:000169 METHOD /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/assertions.rb:106
c:0028 p:0010 s:0157 e:000156 METHOD /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/assertions.rb:62
c:0027 p:0008 s:0148 e:000147 BLOCK  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/assertions.rb:217
c:0026 p:0075 s:0145 e:000142 BLOCK  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/assertions.rb:602
c:0025 p:0066 s:0139 e:000138 METHOD /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/assertions.rb:182
c:0024 p:0032 s:0133 E:002118 METHOD /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/assertions.rb:218
c:0023 p:0017 s:0124 e:000123 METHOD /tmp/guix-build-ruby-hiredis-0.6.3.drv-0/source/test/reader_test.rb:104
c:0022 p:0019 s:0120 e:000119 BLOCK  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/test.rb:98
c:0021 p:0002 s:0117 e:000116 METHOD /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/test.rb:195
c:0020 p:0005 s:0112 e:000111 BLOCK  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/test.rb:95
c:0019 p:0015 s:0109 e:000108 METHOD /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:270
c:0018 p:0005 s:0104 e:000103 BLOCK  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/test.rb:94
c:0017 p:0030 s:0101 e:000100 METHOD /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:365
c:0016 p:0045 s:0093 E:000248 METHOD /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/test.rb:211
c:0015 p:0004 s:0086 E:000a70 METHOD /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/test.rb:93
c:0014 p:0008 s:0082 e:000081 METHOD /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:1029
c:0013 p:0026 s:0075 e:000073 METHOD /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:339
c:0012 p:0010 s:0067 e:000066 BLOCK  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:326 [FINISH]
c:0011 p:---- s:0063 e:000062 CFUNC  :each
c:0010 p:0006 s:0059 e:000058 BLOCK  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:325
c:0009 p:0030 s:0056 e:000055 METHOD /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:365
c:0008 p:0030 s:0048 E:000708 METHOD /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:352
c:0007 p:0119 s:0041 E:000238 METHOD /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:324
c:0006 p:0009 s:0032 e:000031 BLOCK  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:164 [FINISH]
c:0005 p:---- s:0028 e:000027 CFUNC  :map
c:0004 p:0037 s:0024 e:000023 METHOD /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:164
c:0003 p:0142 s:0015 e:000014 METHOD /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:141
c:0002 p:0074 s:0008 E:0006f0 BLOCK  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:68 [FINISH]
c:0001 p:0000 s:0003 E:000250 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:68:in `block in autorun'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:141:in `run'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:164:in `__run'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:164:in `map'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:164:in `block in __run'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:324:in `run'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:352:in `with_info_handler'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:365:in `on_signal'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:325:in `block in run'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:325:in `each'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:326:in `block (2 levels) in run'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:339:in `run_one_method'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:1029:in `run_one_method'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/test.rb:93:in `run'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/test.rb:211:in `with_info_handler'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:365:in `on_signal'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/test.rb:94:in `block in run'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb:270:in `time_it'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/test.rb:95:in `block (2 levels) in run'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/test.rb:195:in `capture_exceptions'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/test.rb:98:in `block (3 levels) in run'
/tmp/guix-build-ruby-hiredis-0.6.3.drv-0/source/test/reader_test.rb:104:in `test_null_multi_bulk'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/assertions.rb:218:in `assert_equal'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/assertions.rb:182:in `assert'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/assertions.rb:602:in `block in message'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/assertions.rb:217:in `block in assert_equal'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/assertions.rb:62:in `diff'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/assertions.rb:106:in `things_to_diff'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/assertions.rb:153:in `mu_pp_for_diff'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/assertions.rb:130:in `mu_pp'

-- Machine register context ------------------------------------------------
 RIP: 0x00007fc08afef16f RBP: 0x00007fc08a9d5948 RSP: 0x00007ffeddf2faf8
 RAX: 0x0000000000000091 RBX: 0x00000000016feb60 RCX: 0x0000000000000000
 RDX: 0x00007fc087403260 RDI: 0x00000000016feb60 RSI: 0x00401f0f00000000
  R8: 0x00007fc08afef220  R9: 0x0000000000000000 R10: 0x0000000000000000
 R11: 0x00000000012156c8 R12: 0x00000000010a6f10 R13: 0x00000000016ff2a0
 R14: 0x00000000016fe540 R15: 0x00007fc08a9d5948 EFL: 0x0000000000010246

-- C level backtrace information -------------------------------------------
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(0x7fc08b00ca0a) [0x7fc08b00ca0a]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(0x7fc08ae7ea87) [0x7fc08ae7ea87]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(0x7fc08af89a99) [0x7fc08af89a99]
/gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libpthread.so.0(0x7fc08ada9d80) [0x7fc08ada9d80]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(0x7fc08afef16f) [0x7fc08afef16f]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(0x7fc08afe7035) [0x7fc08afe7035]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(0x7fc08aff6df4) [0x7fc08aff6df4]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(rb_vm_exec+0x1bb) [0x7fc08affc63b]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(rb_yield+0x75) [0x7fc08b0088f5]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(rb_ary_each+0x3c) [0x7fc08ae0ee6c]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(0x7fc08afec342) [0x7fc08afec342]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(0x7fc08afe7046) [0x7fc08afe7046]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(0x7fc08aff6e63) [0x7fc08aff6e63]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(rb_vm_exec+0x1bb) [0x7fc08affc63b]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(rb_yield+0x75) [0x7fc08b0088f5]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(0x7fc08ae1520c) [0x7fc08ae1520c]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(0x7fc08afec342) [0x7fc08afec342]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(0x7fc08afe7046) [0x7fc08afe7046]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(0x7fc08aff6e63) [0x7fc08aff6e63]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(rb_vm_exec+0x1bb) [0x7fc08affc63b]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(rb_proc_call+0x69) [0x7fc08af42029]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(0x7fc08ae8684f) [0x7fc08ae8684f]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(0x7fc08ae869d9) [0x7fc08ae869d9]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(0x7fc08ae86bc4) [0x7fc08ae86bc4]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7(ruby_run_node+0x52) [0x7fc08ae86f42]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/bin/ruby(0x4010fb) [0x4010fb]
/gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libc.so.6(__libc_start_main+0xcd) [0x7fc08aa537dd]
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/bin/ruby(_start+0x2a) [0x40114a]

-- Other runtime information -----------------------------------------------

* Loaded script: /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/rake_test_loader.rb

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 ruby2_keywords.rb
    5 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/enc/encdb.so
    6 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/enc/trans/transdb.so
    7 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/rbconfig.rb
    8 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/compatibility.rb
    9 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/defaults.rb
   10 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/deprecate.rb
   11 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/errors.rb
   12 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/version.rb
   13 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/requirement.rb
   14 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/platform.rb
   15 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/basic_specification.rb
   16 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/stub_specification.rb
   17 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/util.rb
   18 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/text.rb
   19 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/user_interaction.rb
   20 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/specification_policy.rb
   21 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/util/list.rb
   22 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/specification.rb
   23 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/exceptions.rb
   24 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/bundler_version_finder.rb
   25 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/dependency.rb
   26 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_gem.rb
   27 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/monitor.so
   28 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/monitor.rb
   29 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb
   30 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/core_ext/kernel_warn.rb
   31 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems.rb
   32 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/rubygems/path_support.rb
   33 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/did_you_mean/version.rb
   34 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/did_you_mean/core_ext/name_error.rb
   35 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/did_you_mean/levenshtein.rb
   36 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/did_you_mean/jaro_winkler.rb
   37 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/did_you_mean/spell_checker.rb
   38 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb
   39 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb
   40 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/did_you_mean/spell_checkers/name_error_checkers.rb
   41 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/did_you_mean/spell_checkers/method_name_checker.rb
   42 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/did_you_mean/spell_checkers/key_error_checker.rb
   43 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/did_you_mean/spell_checkers/null_checker.rb
   44 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/did_you_mean/formatters/plain_formatter.rb
   45 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/did_you_mean/tree_spell_checker.rb
   46 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/did_you_mean.rb
   47 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/version.rb
   48 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/fileutils.rb
   49 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/singleton.rb
   50 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/optparse.rb
   51 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/ostruct/version.rb
   52 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/ostruct.rb
   53 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/ext/core.rb
   54 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/ext/string.rb
   55 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/win32.rb
   56 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/linked_list.rb
   57 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/etc.so
   58 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/cpu_counter.rb
   59 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/scope.rb
   60 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task_argument_error.rb
   61 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/rule_recursion_overflow_error.rb
   62 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task_manager.rb
   63 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/cloneable.rb
   64 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/file_utils.rb
   65 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/file_utils_ext.rb
   66 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/file_list.rb
   67 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/set.rb
   68 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/promise.rb
   69 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/thread_pool.rb
   70 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/private_reader.rb
   71 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/thread_history_display.rb
   72 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/trace_output.rb
   73 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb
   74 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/rake_module.rb
   75 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/pseudo_status.rb
   76 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task_arguments.rb
   77 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/invocation_chain.rb
   78 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/invocation_exception_mixin.rb
   79 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb
   80 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/early_time.rb
   81 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/file_task.rb
   82 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/file_creation_task.rb
   83 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/multi_task.rb
   84 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/dsl_definition.rb
   85 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/default_loader.rb
   86 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/late_time.rb
   87 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/name_space.rb
   88 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/backtrace.rb
   89 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake.rb
   90 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/mutex_m.rb
   91 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/parallel.rb
   92 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/stringio.so
   93 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/delegate.rb
   94 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/tmpdir.rb
   95 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/tempfile.rb
   96 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/assertions.rb
   97 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/unit.rb
   98 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/test.rb
   99 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest.rb
  100 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/expectations.rb
  101 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/spec.rb
  102 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/mock.rb
  103 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/autorun.rb
  104 /tmp/guix-build-ruby-hiredis-0.6.3.drv-0/source/lib/hiredis/ext/hiredis_ext.so
  105 /tmp/guix-build-ruby-hiredis-0.6.3.drv-0/source/lib/hiredis/version.rb
  106 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/socket.so
  107 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/io/wait.so
  108 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/socket.rb
  109 /tmp/guix-build-ruby-hiredis-0.6.3.drv-0/source/lib/hiredis/ext/connection.rb
  110 /tmp/guix-build-ruby-hiredis-0.6.3.drv-0/source/lib/hiredis/ruby/reader.rb
  111 /tmp/guix-build-ruby-hiredis-0.6.3.drv-0/source/test/helper.rb
  112 /tmp/guix-build-ruby-hiredis-0.6.3.drv-0/source/test/connection_test.rb
  113 /tmp/guix-build-ruby-hiredis-0.6.3.drv-0/source/test/reader_test.rb
  114 /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/minitest-5.13.0/lib/minitest/pride_plugin.rb

* Process memory map:

00400000-00401000 r--p 00000000 00:16 159207228                          /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/bin/ruby
00401000-00402000 r-xp 00001000 00:16 159207228                          /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/bin/ruby
00402000-00403000 r--p 00002000 00:16 159207228                          /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/bin/ruby
00403000-00404000 r--p 00002000 00:16 159207228                          /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/bin/ruby
00404000-00405000 rw-p 00003000 00:16 159207228                          /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/bin/ruby
0107b000-0185c000 rw-p 00000000 00:00 0                                  [heap]
7fc078000000-7fc078021000 rw-p 00000000 00:00 0 
7fc078021000-7fc07c000000 ---p 00000000 00:00 0 
7fc080000000-7fc080021000 rw-p 00000000 00:00 0 
7fc080021000-7fc084000000 ---p 00000000 00:00 0 
7fc086a91000-7fc086c4b000 r--s 00000000 00:16 156006487                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libc-2.33.so
7fc086c4b000-7fc086c66000 r--s 00000000 00:16 156006522                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libpthread-2.33.so
7fc086c66000-7fc086faa000 r--s 00000000 00:16 159207271                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7.4
7fc086faa000-7fc086fae000 r--s 00000000 00:16 159207228                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/bin/ruby
7fc086fae000-7fc086faf000 ---p 00000000 00:00 0 
7fc086faf000-7fc0871af000 rw-p 00000000 00:00 0 
7fc0871af000-7fc0871b0000 ---p 00000000 00:00 0 
7fc0871b0000-7fc0873b0000 rw-p 00000000 00:00 0 
7fc0873b0000-7fc0873b1000 r--p 00000000 00:16 159208597                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/io/wait.so
7fc0873b1000-7fc0873b2000 r-xp 00001000 00:16 159208597                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/io/wait.so
7fc0873b2000-7fc0873b3000 r--p 00002000 00:16 159208597                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/io/wait.so
7fc0873b3000-7fc0873b4000 r--p 00002000 00:16 159208597                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/io/wait.so
7fc0873b4000-7fc0873b5000 rw-p 00003000 00:16 159208597                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/io/wait.so
7fc0873b5000-7fc0873b6000 r--p 00000000 00:16 156006484                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libanl-2.33.so
7fc0873b6000-7fc0873b8000 r-xp 00001000 00:16 156006484                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libanl-2.33.so
7fc0873b8000-7fc0873b9000 r--p 00003000 00:16 156006484                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libanl-2.33.so
7fc0873b9000-7fc0873ba000 r--p 00003000 00:16 156006484                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libanl-2.33.so
7fc0873ba000-7fc0873bb000 rw-p 00004000 00:16 156006484                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libanl-2.33.so
7fc0873bb000-7fc0873c2000 r--p 00000000 00:16 159208617                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/socket.so
7fc0873c2000-7fc0873e1000 r-xp 00007000 00:16 159208617                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/socket.so
7fc0873e1000-7fc0873e9000 r--p 00026000 00:16 159208617                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/socket.so
7fc0873e9000-7fc0873ea000 r--p 0002d000 00:16 159208617                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/socket.so
7fc0873ea000-7fc0873eb000 rw-p 0002e000 00:16 159208617                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/socket.so
7fc0873eb000-7fc0873ef000 r--p 00000000 00:16 276724635                  /gnu/store/0clwbra3j29m97rajyi5y83lm29s2636-hiredis-1.1.0/lib/libhiredis.so.1.1.0
7fc0873ef000-7fc0873fa000 r-xp 00004000 00:16 276724635                  /gnu/store/0clwbra3j29m97rajyi5y83lm29s2636-hiredis-1.1.0/lib/libhiredis.so.1.1.0
7fc0873fa000-7fc0873fd000 r--p 0000f000 00:16 276724635                  /gnu/store/0clwbra3j29m97rajyi5y83lm29s2636-hiredis-1.1.0/lib/libhiredis.so.1.1.0
7fc0873fd000-7fc0873fe000 ---p 00012000 00:16 276724635                  /gnu/store/0clwbra3j29m97rajyi5y83lm29s2636-hiredis-1.1.0/lib/libhiredis.so.1.1.0
7fc0873fe000-7fc0873ff000 r--p 00012000 00:16 276724635                  /gnu/store/0clwbra3j29m97rajyi5y83lm29s2636-hiredis-1.1.0/lib/libhiredis.so.1.1.0
7fc0873ff000-7fc087400000 rw-p 00013000 00:16 276724635                  /gnu/store/0clwbra3j29m97rajyi5y83lm29s2636-hiredis-1.1.0/lib/libhiredis.so.1.1.0
7fc087400000-7fc087402000 r--p 00000000 00:16 276724861                  /tmp/guix-build-ruby-hiredis-0.6.3.drv-0/source/lib/hiredis/ext/hiredis_ext.so
7fc087402000-7fc087404000 r-xp 00002000 00:16 276724861                  /tmp/guix-build-ruby-hiredis-0.6.3.drv-0/source/lib/hiredis/ext/hiredis_ext.so
7fc087404000-7fc087405000 r--p 00004000 00:16 276724861                  /tmp/guix-build-ruby-hiredis-0.6.3.drv-0/source/lib/hiredis/ext/hiredis_ext.so
7fc087405000-7fc087406000 r--p 00004000 00:16 276724861                  /tmp/guix-build-ruby-hiredis-0.6.3.drv-0/source/lib/hiredis/ext/hiredis_ext.so
7fc087406000-7fc087407000 rw-p 00005000 00:16 276724861                  /tmp/guix-build-ruby-hiredis-0.6.3.drv-0/source/lib/hiredis/ext/hiredis_ext.so
7fc087407000-7fc08740a000 r--p 00000000 00:16 159208618                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/stringio.so
7fc08740a000-7fc08740f000 r-xp 00003000 00:16 159208618                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/stringio.so
7fc08740f000-7fc087411000 r--p 00008000 00:16 159208618                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/stringio.so
7fc087411000-7fc087412000 r--p 00009000 00:16 159208618                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/stringio.so
7fc087412000-7fc087413000 rw-p 0000a000 00:16 159208618                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/stringio.so
7fc087413000-7fc087415000 r--p 00000000 00:16 159208589                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/etc.so
7fc087415000-7fc087418000 r-xp 00002000 00:16 159208589                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/etc.so
7fc087418000-7fc08741a000 r--p 00005000 00:16 159208589                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/etc.so
7fc08741a000-7fc08741b000 r--p 00006000 00:16 159208589                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/etc.so
7fc08741b000-7fc08741c000 rw-p 00007000 00:16 159208589                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/etc.so
7fc08741c000-7fc08741d000 r--p 00000000 00:16 159208602                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/monitor.so
7fc08741d000-7fc08741e000 r-xp 00001000 00:16 159208602                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/monitor.so
7fc08741e000-7fc08741f000 r--p 00002000 00:16 159208602                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/monitor.so
7fc08741f000-7fc087420000 r--p 00002000 00:16 159208602                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/monitor.so
7fc087420000-7fc087421000 rw-p 00003000 00:16 159208602                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/monitor.so
7fc087421000-7fc087422000 r--p 00000000 00:16 159208575                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/enc/trans/transdb.so
7fc087422000-7fc087424000 r-xp 00001000 00:16 159208575                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/enc/trans/transdb.so
7fc087424000-7fc087425000 r--p 00003000 00:16 159208575                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/enc/trans/transdb.so
7fc087425000-7fc087426000 r--p 00003000 00:16 159208575                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/enc/trans/transdb.so
7fc087426000-7fc087427000 rw-p 00004000 00:16 159208575                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/enc/trans/transdb.so
7fc087427000-7fc087428000 r--p 00000000 00:16 159208531                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/enc/encdb.so
7fc087428000-7fc087429000 r-xp 00001000 00:16 159208531                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/enc/encdb.so
7fc087429000-7fc08742a000 r--p 00002000 00:16 159208531                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/enc/encdb.so
7fc08742a000-7fc08742b000 r--p 00002000 00:16 159208531                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/enc/encdb.so
7fc08742b000-7fc08742c000 rw-p 00003000 00:16 159208531                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/2.7.0/x86_64-linux/enc/encdb.so
7fc08742c000-7fc08742d000 ---p 00000000 00:00 0 
7fc08742d000-7fc0874ce000 rw-p 00000000 00:00 0 
7fc0874ce000-7fc0874cf000 ---p 00000000 00:00 0 
7fc0874cf000-7fc087570000 rw-p 00000000 00:00 0 
7fc087570000-7fc087571000 ---p 00000000 00:00 0 
7fc087571000-7fc087612000 rw-p 00000000 00:00 0 
7fc087612000-7fc087613000 ---p 00000000 00:00 0 
7fc087613000-7fc0876b4000 rw-p 00000000 00:00 0 
7fc0876b4000-7fc0876b5000 ---p 00000000 00:00 0 
7fc0876b5000-7fc087756000 rw-p 00000000 00:00 0 
7fc087756000-7fc087757000 ---p 00000000 00:00 0 
7fc087757000-7fc0877f8000 rw-p 00000000 00:00 0 
7fc0877f8000-7fc0877f9000 ---p 00000000 00:00 0 
7fc0877f9000-7fc08789a000 rw-p 00000000 00:00 0 
7fc08789a000-7fc08789b000 ---p 00000000 00:00 0 
7fc08789b000-7fc08793c000 rw-p 00000000 00:00 0 
7fc08793c000-7fc08793d000 ---p 00000000 00:00 0 
7fc08793d000-7fc0879de000 rw-p 00000000 00:00 0 
7fc0879de000-7fc0879df000 ---p 00000000 00:00 0 
7fc0879df000-7fc087a80000 rw-p 00000000 00:00 0 
7fc087a80000-7fc087a81000 ---p 00000000 00:00 0 
7fc087a81000-7fc087b22000 rw-p 00000000 00:00 0 
7fc087b22000-7fc087b23000 ---p 00000000 00:00 0 
7fc087b23000-7fc087bc4000 rw-p 00000000 00:00 0 
7fc087bc4000-7fc087bc5000 ---p 00000000 00:00 0 
7fc087bc5000-7fc087c66000 rw-p 00000000 00:00 0 
7fc087c66000-7fc087c67000 ---p 00000000 00:00 0 
7fc087c67000-7fc087d08000 rw-p 00000000 00:00 0 
7fc087d08000-7fc087d09000 ---p 00000000 00:00 0 
7fc087d09000-7fc087daa000 rw-p 00000000 00:00 0 
7fc087daa000-7fc087dab000 ---p 00000000 00:00 0 
7fc087dab000-7fc087e4c000 rw-p 00000000 00:00 0 
7fc087e4c000-7fc087e4d000 ---p 00000000 00:00 0 
7fc087e4d000-7fc087eee000 rw-p 00000000 00:00 0 
7fc087eee000-7fc087eef000 ---p 00000000 00:00 0 
7fc087eef000-7fc087f90000 rw-p 00000000 00:00 0 
7fc087f90000-7fc087f91000 ---p 00000000 00:00 0 
7fc087f91000-7fc088032000 rw-p 00000000 00:00 0 
7fc088032000-7fc088033000 ---p 00000000 00:00 0 
7fc088033000-7fc0880d4000 rw-p 00000000 00:00 0 
7fc0880d4000-7fc0880d5000 ---p 00000000 00:00 0 
7fc0880d5000-7fc088176000 rw-p 00000000 00:00 0 
7fc088176000-7fc088177000 ---p 00000000 00:00 0 
7fc088177000-7fc088218000 rw-p 00000000 00:00 0 
7fc088218000-7fc088219000 ---p 00000000 00:00 0 
7fc088219000-7fc0882ba000 rw-p 00000000 00:00 0 
7fc0882ba000-7fc0882bb000 ---p 00000000 00:00 0 
7fc0882bb000-7fc08835c000 rw-p 00000000 00:00 0 
7fc08835c000-7fc08835d000 ---p 00000000 00:00 0 
7fc08835d000-7fc0883fe000 rw-p 00000000 00:00 0 
7fc0883fe000-7fc0883ff000 ---p 00000000 00:00 0 
7fc0883ff000-7fc0884a0000 rw-p 00000000 00:00 0 
7fc0884a0000-7fc0884a1000 ---p 00000000 00:00 0 
7fc0884a1000-7fc088542000 rw-p 00000000 00:00 0 
7fc088542000-7fc088543000 ---p 00000000 00:00 0 
7fc088543000-7fc0885e4000 rw-p 00000000 00:00 0 
7fc0885e4000-7fc0885e5000 ---p 00000000 00:00 0 
7fc0885e5000-7fc088686000 rw-p 00000000 00:00 0 
7fc088686000-7fc088687000 ---p 00000000 00:00 0 
7fc088687000-7fc088728000 rw-p 00000000 00:00 0 
7fc088728000-7fc088729000 ---p 00000000 00:00 0 
7fc088729000-7fc0887ca000 rw-p 00000000 00:00 0 
7fc0887ca000-7fc0887cb000 ---p 00000000 00:00 0 
7fc0887cb000-7fc08a9d7000 rw-p 00000000 00:00 0 
7fc08a9d7000-7fc08aa2c000 r--p 00000000 00:16 130917627                  /gnu/store/fnr1z6xsan0437r0yg48d0y8k32kqxby-glibc-utf8-locales-2.33/lib/locale/2.33/en_US.utf8/LC_CTYPE
7fc08aa2c000-7fc08aa30000 rw-p 00000000 00:00 0 
7fc08aa30000-7fc08aa52000 r--p 00000000 00:16 156006487                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libc-2.33.so
7fc08aa52000-7fc08ab93000 r-xp 00022000 00:16 156006487                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libc-2.33.so
7fc08ab93000-7fc08abe3000 r--p 00163000 00:16 156006487                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libc-2.33.so
7fc08abe3000-7fc08abe7000 r--p 001b2000 00:16 156006487                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libc-2.33.so
7fc08abe7000-7fc08abe9000 rw-p 001b6000 00:16 156006487                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libc-2.33.so
7fc08abe9000-7fc08abf2000 rw-p 00000000 00:00 0 
7fc08abf2000-7fc08abf5000 r--p 00000000 00:16 156008721                  /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libgcc_s.so.1
7fc08abf5000-7fc08ac06000 r-xp 00003000 00:16 156008721                  /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libgcc_s.so.1
7fc08ac06000-7fc08ac0a000 r--p 00014000 00:16 156008721                  /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libgcc_s.so.1
7fc08ac0a000-7fc08ac0b000 r--p 00017000 00:16 156008721                  /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libgcc_s.so.1
7fc08ac0b000-7fc08ac0c000 rw-p 00018000 00:16 156008721                  /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libgcc_s.so.1
7fc08ac0c000-7fc08ac19000 r--p 00000000 00:16 156006497                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libm-2.33.so
7fc08ac19000-7fc08acb0000 r-xp 0000d000 00:16 156006497                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libm-2.33.so
7fc08acb0000-7fc08ad4b000 r--p 000a4000 00:16 156006497                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libm-2.33.so
7fc08ad4b000-7fc08ad4c000 r--p 0013e000 00:16 156006497                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libm-2.33.so
7fc08ad4c000-7fc08ad4d000 rw-p 0013f000 00:16 156006497                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libm-2.33.so
7fc08ad4d000-7fc08ad4e000 r--p 00000000 00:16 156006491                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libcrypt-2.33.so
7fc08ad4e000-7fc08ad54000 r-xp 00001000 00:16 156006491                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libcrypt-2.33.so
7fc08ad54000-7fc08ad56000 r--p 00007000 00:16 156006491                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libcrypt-2.33.so
7fc08ad56000-7fc08ad57000 ---p 00009000 00:16 156006491                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libcrypt-2.33.so
7fc08ad57000-7fc08ad58000 r--p 00009000 00:16 156006491                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libcrypt-2.33.so
7fc08ad58000-7fc08ad59000 rw-p 0000a000 00:16 156006491                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libcrypt-2.33.so
7fc08ad59000-7fc08ad89000 rw-p 00000000 00:00 0 
7fc08ad89000-7fc08ad8a000 r--p 00000000 00:16 156006494                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libdl-2.33.so
7fc08ad8a000-7fc08ad8b000 r-xp 00001000 00:16 156006494                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libdl-2.33.so
7fc08ad8b000-7fc08ad8c000 r--p 00002000 00:16 156006494                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libdl-2.33.so
7fc08ad8c000-7fc08ad8d000 r--p 00002000 00:16 156006494                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libdl-2.33.so
7fc08ad8d000-7fc08ad8e000 rw-p 00003000 00:16 156006494                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libdl-2.33.so
7fc08ad8e000-7fc08ad90000 r--p 00000000 00:16 156006528                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/librt-2.33.so
7fc08ad90000-7fc08ad94000 r-xp 00002000 00:16 156006528                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/librt-2.33.so
7fc08ad94000-7fc08ad96000 r--p 00006000 00:16 156006528                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/librt-2.33.so
7fc08ad96000-7fc08ad97000 r--p 00007000 00:16 156006528                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/librt-2.33.so
7fc08ad97000-7fc08ad98000 rw-p 00008000 00:16 156006528                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/librt-2.33.so
7fc08ad98000-7fc08ad9e000 r--p 00000000 00:16 156006522                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libpthread-2.33.so
7fc08ad9e000-7fc08adac000 r-xp 00006000 00:16 156006522                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libpthread-2.33.so
7fc08adac000-7fc08adb2000 r--p 00014000 00:16 156006522                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libpthread-2.33.so
7fc08adb2000-7fc08adb3000 r--p 00019000 00:16 156006522                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libpthread-2.33.so
7fc08adb3000-7fc08adb4000 rw-p 0001a000 00:16 156006522                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libpthread-2.33.so
7fc08adb4000-7fc08adb8000 rw-p 00000000 00:00 0 
7fc08adb8000-7fc08adbb000 r--p 00000000 00:16 156014484                  /gnu/store/8qv5kb2fgm4c3bf70zcg9l6hkf3qzpw9-zlib-1.2.11/lib/libz.so.1.2.11
7fc08adbb000-7fc08adcc000 r-xp 00003000 00:16 156014484                  /gnu/store/8qv5kb2fgm4c3bf70zcg9l6hkf3qzpw9-zlib-1.2.11/lib/libz.so.1.2.11
7fc08adcc000-7fc08add3000 r--p 00014000 00:16 156014484                  /gnu/store/8qv5kb2fgm4c3bf70zcg9l6hkf3qzpw9-zlib-1.2.11/lib/libz.so.1.2.11
7fc08add3000-7fc08add4000 r--p 0001a000 00:16 156014484                  /gnu/store/8qv5kb2fgm4c3bf70zcg9l6hkf3qzpw9-zlib-1.2.11/lib/libz.so.1.2.11
7fc08add4000-7fc08add5000 rw-p 0001b000 00:16 156014484                  /gnu/store/8qv5kb2fgm4c3bf70zcg9l6hkf3qzpw9-zlib-1.2.11/lib/libz.so.1.2.11
7fc08add5000-7fc08ae05000 r--p 00000000 00:16 159207271                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7.4
7fc08ae05000-7fc08b017000 r-xp 00030000 00:16 159207271                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7.4
7fc08b017000-7fc08b10f000 r--p 00242000 00:16 159207271                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7.4
7fc08b10f000-7fc08b110000 ---p 0033a000 00:16 159207271                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7.4
7fc08b110000-7fc08b116000 r--p 0033a000 00:16 159207271                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7.4
7fc08b116000-7fc08b119000 rw-p 00340000 00:16 159207271                  /gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/libruby.so.2.7.4
7fc08b119000-7fc08b134000 rw-p 00000000 00:00 0 
7fc08b136000-7fc08b138000 rw-p 00000000 00:00 0 
7fc08b138000-7fc08b139000 r--p 00000000 00:16 156006478                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/ld-2.33.so
7fc08b139000-7fc08b15c000 r-xp 00001000 00:16 156006478                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/ld-2.33.so
7fc08b15c000-7fc08b165000 r--p 00024000 00:16 156006478                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/ld-2.33.so
7fc08b165000-7fc08b167000 r--p 0002c000 00:16 156006478                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/ld-2.33.so
7fc08b167000-7fc08b169000 rw-p 0002e000 00:16 156006478                  /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/ld-2.33.so
7ffedd736000-7ffeddf35000 rw-p 00000000 00:00 0                          [stack]
7ffeddfc4000-7ffeddfc8000 r--p 00000000 00:00 0                          [vvar]
7ffeddfc8000-7ffeddfca000 r-xp 00000000 00:00 0                          [vdso]


rake aborted!
SignalException: SIGABRT
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/testtask.rb:119:in `block (3 levels) in define'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/file_utils.rb:57:in `sh'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/file_utils.rb:104:in `ruby'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/testtask.rb:117:in `block (2 levels) in define'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/file_utils_ext.rb:58:in `verbose'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/testtask.rb:111:in `block in define'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `block in execute'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `each'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `execute'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:199:in `synchronize'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:188:in `invoke'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:160:in `invoke_task'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `each'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block in top_level'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:125:in `run_with_threads'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:110:in `top_level'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:83:in `block in run'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/lib/ruby/gems/2.7.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/bin/rake:23:in `load'
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/bin/rake:23:in `<main>'
Tasks: TOP => test

Would you know what may be at cause? The dependencies being used are:

and Ruby is at 2.7.4.

Thanks!

Failed gem build on OS X 10.6.8

Hi, I am having some trouble installing the gem and was wondering if you have any insight into the following. I've googled for the issue unsuccessfully, any help would be appreciated.

$ sudo gem install hiredis
Password:
Building native extensions. This could take a while...
ERROR: Error installing hiredis:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -arch i386 -arch x86_64 -g -ggdb net.c
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -arch i386 -arch x86_64 -g -ggdb hiredis.c
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -arch i386 -arch x86_64 -g -ggdb sds.c
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -arch i386 -arch x86_64 -g -ggdb async.c
libtool -static -o libhiredis.a - net.o hiredis.o sds.o async.o
libtool: unrecognized option -static' libtool: Trylibtool --help' for more information.
make: *** [libhiredis.a] Error 1
creating Makefile

make
gcc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -I/Library/Ruby/Gems/1.8/gems/hiredis-0.4.1/vendor/hiredis -c connection.c
gcc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -I/Library/Ruby/Gems/1.8/gems/hiredis-0.4.1/vendor/hiredis -c hiredis_ext.c
gcc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -I/Library/Ruby/Gems/1.8/gems/hiredis-0.4.1/vendor/hiredis -c reader.c
cc -arch i386 -arch x86_64 -pipe -bundle -undefined dynamic_lookup -o hiredis_ext.bundle connection.o hiredis_ext.o reader.o -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 /Library/Ruby/Gems/1.8/gems/hiredis-0.4.1/vendor/hiredis/libhiredis.a -lruby -lpthread -ldl
i686-apple-darwin10-llvm-gcc-4.2: /Library/Ruby/Gems/1.8/gems/hiredis-0.4.1/vendor/hiredis/libhiredis.a: No such file or directory
i686-apple-darwin10-llvm-gcc-4.2: /Library/Ruby/Gems/1.8/gems/hiredis-0.4.1/vendor/hiredis/libhiredis.a: No such file or directory
lipo: can't figure out the architecture type of: /var/tmp//ccvQ1LBK.out
make: *** [hiredis_ext.bundle] Error 1

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/hiredis-0.4.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/hiredis-0.4.1/ext/hiredis_ext/gem_make.out

$ ruby --version
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin10.0]
$ gem --version
1.3.7

New maintainer needed

I have neither the time nor the energy to fulfil the maintainer role here.
I failed to spend enough time in the past and haven't pushed out a release in nearly 3 years.

If anyone is actively using this project and wants to take over, please reach me over email.

Hiredis and ruby 2.2

I upgraded to ruby 2.2 and got this error:

dyld: lazy symbol binding failed: Symbol not found: _rb_thread_select
  Referenced from: /Users/jsinglet/.rvm/gems/ruby-2.2.0/extensions/x86_64-darwin-14/2.2.0/hiredis-0.4.5/hiredis/ext/hiredis_ext.bundle
  Expected in: flat namespace

dyld: Symbol not found: _rb_thread_select
  Referenced from: /Users/jsinglet/.rvm/gems/ruby-2.2.0/extensions/x86_64-darwin-14/2.2.0/hiredis-0.4.5/hiredis/ext/hiredis_ext.bundle
  Expected in: flat namespace

Seems like the _rb_thread_select method has been renamed to rb_thread_fd_select in ruby 2.2

Downgrading to ruby 2.1.5 makes this issue go away

https://bugs.ruby-lang.org/issues/9502

Error compiling on FreeBSD

...and yes I applied the patch to make it use gmake.

Submodule 'vendor/hiredis' (git://github.com/antirez/hiredis.git) registered for path 'vendor/hiredis'
Cloning into 'vendor/hiredis'...
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 3 (delta 0)
Receiving objects: 100% (3/3), done.
fatal: reference is not a tree: 95e83386f7d592d021bed87f4df1530eda454c6a
Unable to checkout '95e83386f7d592d021bed87f4df1530eda454c6a' in submodule path 'vendor/hiredis'
make: don't know how to make clean. Stop
rm -r tmp/amd64-freebsd9/hiredis_ext/1.8.7
mkdir -p tmp/amd64-freebsd9/hiredis_ext/1.8.7
cd tmp/amd64-freebsd9/hiredis_ext/1.8.7
/usr/local/bin/ruby18 -I. ../../../../ext/hiredis_ext/extconf.rb
gmake: *** No rule to make target `static'.  Stop.
creating Makefile
cd -
cd tmp/amd64-freebsd9/hiredis_ext/1.8.7
gmake
cc -I. -I/usr/local/lib/ruby/1.8/amd64-freebsd9 -I/usr/local/lib/ruby/1.8/amd64-freebsd9 -I../../../../ext/hiredis_ext -I/usr/local/include    -fPIC -fwrapv -I/usr/local/include -O2 -pipe -fno-strict-aliasing -std=gnu89  -fPIC  -I/tmp/gem/hiredis-rb/vendor/hiredis  -c ../../../../ext/hiredis_ext/connection.c
In file included from ../../../../ext/hiredis_ext/connection.c:3:
../../../../ext/hiredis_ext/hiredis_ext.h:4:21: error: hiredis.h: No such file or directory
In file included from ../../../../ext/hiredis_ext/connection.c:3:
../../../../ext/hiredis_ext/hiredis_ext.h:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'redisExtReplyObjectFunctions'
../../../../ext/hiredis_ext/connection.c:6: error: expected specifier-qualifier-list before 'redisContext'
../../../../ext/hiredis_ext/connection.c: In function 'parent_context_try_free_context':
../../../../ext/hiredis_ext/connection.c:11: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c:12: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c:13: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c: In function 'parent_context_try_free_timeout':
../../../../ext/hiredis_ext/connection.c:18: error: 'redisParentContext' has no member named 'timeout'
../../../../ext/hiredis_ext/connection.c:19: error: 'redisParentContext' has no member named 'timeout'
../../../../ext/hiredis_ext/connection.c:20: error: 'redisParentContext' has no member named 'timeout'
../../../../ext/hiredis_ext/connection.c: In function 'parent_context_mark':
../../../../ext/hiredis_ext/connection.c:31: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c:31: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c:32: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c: In function 'parent_context_raise':
../../../../ext/hiredis_ext/connection.c:49: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c:50: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c:54: error: 'REDIS_ERR_IO' undeclared (first use in this function)
../../../../ext/hiredis_ext/connection.c:54: error: (Each undeclared identifier is reported only once
../../../../ext/hiredis_ext/connection.c:54: error: for each function it appears in.)
../../../../ext/hiredis_ext/connection.c:58: error: 'REDIS_ERR_EOF' undeclared (first use in this function)
../../../../ext/hiredis_ext/connection.c: In function 'connection_parent_context_alloc':
../../../../ext/hiredis_ext/connection.c:70: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c:71: error: 'redisParentContext' has no member named 'timeout'
../../../../ext/hiredis_ext/connection.c: At top level:
../../../../ext/hiredis_ext/connection.c:123: error: expected declaration specifiers or '...' before 'redisContext'
../../../../ext/hiredis_ext/connection.c: In function 'connection_generic_connect':
../../../../ext/hiredis_ext/connection.c:130: error: 'c' undeclared (first use in this function)
../../../../ext/hiredis_ext/connection.c:139: error: 'REDIS_ERR_IO' undeclared (first use in this function)
../../../../ext/hiredis_ext/connection.c:149: error: 'redisParentContext' has no member named 'timeout'
../../../../ext/hiredis_ext/connection.c:150: error: 'redisParentContext' has no member named 'timeout'
../../../../ext/hiredis_ext/connection.c:184: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c:185: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c:185: error: 'redisExtReplyObjectFunctions' undeclared (first use in this function)
../../../../ext/hiredis_ext/connection.c: In function 'connection_connect':
../../../../ext/hiredis_ext/connection.c:195: error: 'redisContext' undeclared (first use in this function)
../../../../ext/hiredis_ext/connection.c:195: error: 'c' undeclared (first use in this function)
../../../../ext/hiredis_ext/connection.c:218: error: too many arguments to function 'connection_generic_connect'
../../../../ext/hiredis_ext/connection.c: In function 'connection_connect_unix':
../../../../ext/hiredis_ext/connection.c:223: error: 'redisContext' undeclared (first use in this function)
../../../../ext/hiredis_ext/connection.c:223: error: 'c' undeclared (first use in this function)
../../../../ext/hiredis_ext/connection.c:244: error: too many arguments to function 'connection_generic_connect'
../../../../ext/hiredis_ext/connection.c: In function 'connection_is_connected':
../../../../ext/hiredis_ext/connection.c:250: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c:250: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c: In function 'connection_disconnect':
../../../../ext/hiredis_ext/connection.c:259: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c: In function 'connection_write':
../../../../ext/hiredis_ext/connection.c:279: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c:293: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c: In function 'connection_flush':
../../../../ext/hiredis_ext/connection.c:301: error: 'redisContext' undeclared (first use in this function)
../../../../ext/hiredis_ext/connection.c:301: error: 'c' undeclared (first use in this function)
../../../../ext/hiredis_ext/connection.c:305: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c:308: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c:312: error: 'REDIS_ERR' undeclared (first use in this function)
../../../../ext/hiredis_ext/connection.c:320: error: 'redisParentContext' has no member named 'timeout'
../../../../ext/hiredis_ext/connection.c: In function '__get_reply':
../../../../ext/hiredis_ext/connection.c:335: error: 'redisContext' undeclared (first use in this function)
../../../../ext/hiredis_ext/connection.c:335: error: 'c' undeclared (first use in this function)
../../../../ext/hiredis_ext/connection.c:335: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c:340: error: 'REDIS_ERR' undeclared (first use in this function)
../../../../ext/hiredis_ext/connection.c:358: error: 'redisParentContext' has no member named 'timeout'
../../../../ext/hiredis_ext/connection.c:381: error: 'redisParentContext' has no member named 'timeout'
../../../../ext/hiredis_ext/connection.c: In function 'connection_read':
../../../../ext/hiredis_ext/connection.c:414: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c: In function 'connection_set_timeout':
../../../../ext/hiredis_ext/connection.c:441: error: 'redisParentContext' has no member named 'timeout'
../../../../ext/hiredis_ext/connection.c: In function 'connection_fileno':
../../../../ext/hiredis_ext/connection.c:453: error: 'redisParentContext' has no member named 'context'
../../../../ext/hiredis_ext/connection.c:456: error: 'redisParentContext' has no member named 'context'
gmake: *** [connection.o] Error 1
rake aborted!
Command failed with status (2): [gmake...]
Tasks: TOP => default => rebuild => compile => compile:amd64-freebsd9 => compile:hiredis_ext:amd64-freebsd9 => copy:hiredis_ext:amd64-freebsd9:1.8.7 => tmp/amd64-freebsd9/hiredis_ext/1.8.7/hiredis_ext.so
(See full trace by running task with --trace)
FreeBSD 9.0-RELEASE
ruby 1.8.7 (2012-10-12 patchlevel 371) [amd64-freebsd9]
rake, version 10.0.2
GNU Make 3.82

Unable call methods with a timeout greater than 2142 seconds

Hi! 👋

We noticed that all call that take a timeout argument like brpoplpush do not accept a timeout greater than 2142 seconds.

$ r.brpoplpush('test', 'test2', timeout: 2143)

RangeError: integer 2148000000 too big to convert to `int'
from vendor/bundle/ruby/3.0.0/gems/redis-4.2.5/lib/redis/connection/hiredis.rb:41:in `timeout='

While this might not be a smart use case (a lot of things can happen to the connection within one hour), I believe it should be supported by hiredis-rb because it works with the plain ruby adapter.

I am pretty sure this line causes the exception:

if (NUM2INT(usecs) < 0) {

A bit later in the function the usecs are converted back to seconds.

if (NUM2INT(usecs) > 0) {
ptr = malloc(sizeof(*ptr));
ptr->tv_sec = NUM2INT(usecs) / 1000000;

This makes me think the NUM2INT cast could be done after the division. I didn't send a PR because I am not sure how regirous the validation of the resulting number should be. Is it safe to assume that t_time is always at least a 32bit integer, or are there smarter/safer ways to do it?

Cannot install hiredis

I bought me a new Windows 8.1 computer. Now i tried to run my old rails projects. In on of them i'm using websockets. The gem 'websocket' is reqiurirng hiredis

So i tried to install it but i get error always this error:

C:\project_s2_Development\project_s2apiheroku2>gem install hiredis
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing hiredis:
        ERROR: Failed to build gem native extension.

    C:/RailsInstaller/Ruby2.1.0/bin/ruby.exe extconf.rb
gcc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-string
s -g -ggdb  net.c
net.c:1:0: warning: -fPIC ignored for target (all code is position independent)
[enabled by default]
net.c:35:24: fatal error: sys/socket.h: No such file or directory
compilation terminated.
make: *** [net.o] Error 1
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/RailsInstaller/Ruby2.1.0/bin/ruby
extconf.rb:25:in `block in <main>': Building hiredis failed (RuntimeError)
        from extconf.rb:23:in `chdir'
        from extconf.rb:23:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1
.0/gems/hiredis-0.5.2 for inspection.
Results logged to C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/extensions/x86
-mingw32/2.1.0/hiredis-0.5.2/gem_make.out

Can you recommend something how to install hiredis on windows? I cannot find anything! Thanks for your help!

redis-rb TestInternals#test_large_payload failure

As described in redis/redis-rb/issues/1117, testing redis-rb 4.7.1 with Redis 7, I observe the following bug when using hiredis-rb 0.6.3 with native extension (the plain Ruby version seems to work just fine):

  1) Error:
TestInternals#test_large_payload:
Redis::ProtocolError:  Got '' as initial reply byte. If you're in a forking environment, such as Unicorn, you need to connect to Redis after forking. 
    /builddir/build/BUILD/redis-4.7.1/usr/share/gems/gems/redis-4.7.1/lib/redis/connection/hiredis.rb:60:in `rescue in read'
    /builddir/build/BUILD/redis-4.7.1/usr/share/gems/gems/redis-4.7.1/lib/redis/connection/hiredis.rb:53:in `read'
    /builddir/build/BUILD/redis-4.7.1/usr/share/gems/gems/redis-4.7.1/lib/redis/client.rb:311:in `block in read'
    /builddir/build/BUILD/redis-4.7.1/usr/share/gems/gems/redis-4.7.1/lib/redis/client.rb:299:in `io'
    /builddir/build/BUILD/redis-4.7.1/usr/share/gems/gems/redis-4.7.1/lib/redis/client.rb:310:in `read'
    /builddir/build/BUILD/redis-4.7.1/usr/share/gems/gems/redis-4.7.1/lib/redis/client.rb:161:in `block in call'
    /builddir/build/BUILD/redis-4.7.1/usr/share/gems/gems/redis-4.7.1/lib/redis/client.rb:279:in `block (2 levels) in process'
    /builddir/build/BUILD/redis-4.7.1/usr/share/gems/gems/redis-4.7.1/lib/redis/client.rb:420:in `ensure_connected'
    /builddir/build/BUILD/redis-4.7.1/usr/share/gems/gems/redis-4.7.1/lib/redis/client.rb:269:in `block in process'
    /builddir/build/BUILD/redis-4.7.1/usr/share/gems/gems/redis-4.7.1/lib/redis/client.rb:373:in `logging'
    /builddir/build/BUILD/redis-4.7.1/usr/share/gems/gems/redis-4.7.1/lib/redis/client.rb:268:in `process'
    /builddir/build/BUILD/redis-4.7.1/usr/share/gems/gems/redis-4.7.1/lib/redis/client.rb:161:in `call'
    /builddir/build/BUILD/redis-4.7.1/usr/share/gems/gems/redis-4.7.1/lib/redis.rb:269:in `block in send_command'
    /builddir/build/BUILD/redis-4.7.1/usr/share/gems/gems/redis-4.7.1/lib/redis.rb:268:in `synchronize'
    /builddir/build/BUILD/redis-4.7.1/usr/share/gems/gems/redis-4.7.1/lib/redis.rb:268:in `send_command'
    /builddir/build/BUILD/redis-4.7.1/usr/share/gems/gems/redis-4.7.1/lib/redis/commands/strings.rb:108:in `setex'
    /builddir/build/BUILD/redis-4.7.1/usr/share/gems/gems/redis-4.7.1/test/internals_test.rb:20:in `test_large_payload'

And I wonder what might be the issue, because the error is not exhibited in redis-rb CI. The difference I have spotted is that hiredis-rb in Fedora is not using the vendored hiredis 1.0.0 but the system hiredis library 1.0.2.

Problem Building Native Extensions in Version 0.3.1, 0.3.2

When attempting to install hiredis using $ gem install hiredis -v 0.3.2, the build fails with this output:

Building native extensions.  This could take a while...
ERROR:  Error installing hiredis:
    ERROR: Failed to build gem native extension.

        /Users/benvreed/.rbenv/versions/1.9.3-p362/bin/ruby extconf.rb
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings   -arch i386 -arch x86_64 -g -ggdb  net.c
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings   -arch i386 -arch x86_64 -g -ggdb  hiredis.c
hiredis.c:797:31: error: second argument to 'va_arg' is of incomplete type 'void'
                    va_arg(ap,void);
                    ~~~~~~~~~~^~~~~
/usr/bin/../lib/clang/4.1/include/stdarg.h:35:50: note: expanded from macro 'va_arg'
#define va_arg(ap, type)    __builtin_va_arg(ap, type)
                                                 ^
1 error generated.
make: *** [hiredis.o] Error 1
creating Makefile

make
compiling connection.c
compiling hiredis_ext.c
compiling reader.c
linking shared-object hiredis/ext/hiredis_ext.bundle
i686-apple-darwin11-llvm-gcc-4.2: /Users/benvreed/.rbenv/versions/1.9.3-p362/lib/ruby/gems/1.9.1/gems/hiredis-0.3.2/vendor/hiredis/libhiredis.a: No such file or directory
make: *** [hiredis_ext.bundle] Error 1


Gem files will remain installed in /Users/benvreed/.rbenv/versions/1.9.3-p362/lib/ruby/gems/1.9.1/gems/hiredis-0.3.2 for inspection.
Results logged to /Users/benvreed/.rbenv/versions/1.9.3-p362/lib/ruby/gems/1.9.1/gems/hiredis-0.3.2/ext/hiredis_ext/gem_make.out

Unlike #3, this does not mention libtool. I can confirm that this problem does not occur with the latest version, v0.4.5, but does occur on v0.3.2 on OS X 10.7.5.

This is probably not compatible with Ruby 3.0's Fiber Scheduler?

Ruby 3.0 introduced the FiberScheduler interface so that evented libraries like Async can hook into low-level blocking IO events and use them to efficiently schedule/coordinate concurrent Fiber-driven tasks behind the scenes.

I've been playing around with Ruby 3.1 + async Fiber-driven tasks + hiredis-rb, and I believe, as it stands, blocking operations like blpop are going to block the entire Reactor because hiredis isn't aware of the Fiber Scheduler.

It is possible for native C extension to be FiberScheduler-aware, see:

https://www.wjwh.eu/posts/2020-12-28-ruby-fiber-scheduler-c-extension.html#integrating-the-fiber-scheduler-into-c-extensions

But I'm just wondering, would it be possible to make hiredis-rb be FiberScheduler-aware? Or are all the hookpoints too embedded within hiredis to make that work?

Failed to build gem native extension

On Mac OSX 10.6.7, using hiredis 0.10 (installed through homebrew), when I try to install hiredis-rb through rubygems 1.6.2 (w/ ruby 1.9.2), I get this error :

/Users/eppo/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb --with-hiredis-lib=/usr/local/lib --with-hiredis-include=/usr/local/include/hiredis
checking for hiredis.h... yes
checking for redisReplyReaderCreate() in -lhiredis... no

I added manually --with-hiredis-lib and --with-hiredis-include parameters but I got the same error without too.
My hiredis setup seems correct though:

# ll /usr/local/lib/libhiredis.* /usr/local/include/hiredis/
lrwxr-xr-x  1 eppo  staff  41 16 mai 21:41 /usr/local/lib/libhiredis.a -> ../Cellar/hiredis/0.10.0/lib/libhiredis.a
lrwxr-xr-x  1 eppo  staff  45 16 mai 21:41 /usr/local/lib/libhiredis.dylib -> ../Cellar/hiredis/0.10.0/lib/libhiredis.dylib

/usr/local/include/hiredis/:
total 40
drwxr-xr-x  5 eppo  staff   170 22 avr 06:15 adapters
-rw-r--r--  1 eppo  staff  4916 22 avr 06:15 async.h
-rw-r--r--  1 eppo  staff  8703 22 avr 06:15 hiredis.h

I checked in hiredis.h I have in /usr/local/include/hiredis/hiredis.h and redisReplyReaderCreate is present.

Problem for install gem hiredis 0.4.4 in ubuntu 12.10 64 bits

Installing hiredis (0.4.4) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /home/sostenes/.rvm/rubies/ruby-1.8.7-p371/bin/ruby extconf.rb 

cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb hiredis.c
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb sds.c
cc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb async.c
ar rcs libhiredis.a net.o hiredis.o sds.o async.o
creating Makefile

make
gcc -I. -I/home/sostenes/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/x86_64-linux -I/home/sostenes/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/x86_64-linux -I. -fPIC -O3 -O2 -fno-tree-dce -fno-optimize-sibling-calls -fPIC -I/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis -c connection.c
gcc -I. -I/home/sostenes/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/x86_64-linux -I/home/sostenes/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/x86_64-linux -I. -fPIC -O3 -O2 -fno-tree-dce -fno-optimize-sibling-calls -fPIC -I/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis -c hiredis_ext.c
gcc -I. -I/home/sostenes/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/x86_64-linux -I/home/sostenes/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/1.8/x86_64-linux -I. -fPIC -O3 -O2 -fno-tree-dce -fno-optimize-sibling-calls -fPIC -I/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis -c reader.c
gcc -shared -o hiredis_ext.so connection.o hiredis_ext.o reader.o -L. -L/home/sostenes/.rvm/rubies/ruby-1.8.7-p371/lib -Wl,-R/home/sostenes/.rvm/rubies/ruby-1.8.7-p371/lib -L. -rdynamic -Wl,-export-dynamic /home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a -Wl,-R -Wl,/home/sostenes/.rvm/rubies/ruby-1.8.7-p371/lib -L/home/sostenes/.rvm/rubies/ruby-1.8.7-p371/lib -lruby -lrt -ldl -lcrypt -lm -lc
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(sds.o): na função strtod': /usr/include/stdlib.h:330: múltipla definição destrtod'
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(hiredis.o):/usr/include/stdlib.h:330: definido primeiramente aqui
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(sds.o): na função strtol': /usr/include/stdlib.h:336: múltipla definição destrtol'
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(hiredis.o):/usr/include/stdlib.h:336: definido primeiramente aqui
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(sds.o): na função strtoul': /usr/include/stdlib.h:342: múltipla definição destrtoul'
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(hiredis.o):/usr/include/stdlib.h:342: definido primeiramente aqui
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(sds.o): na função strtof': /usr/include/stdlib.h:351: múltipla definição destrtof'
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(hiredis.o):/usr/include/stdlib.h:351: definido primeiramente aqui
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(sds.o): na função strtold': /usr/include/stdlib.h:357: múltipla definição destrtold'
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(hiredis.o):/usr/include/stdlib.h:357: definido primeiramente aqui
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(sds.o): na função strtoll': /usr/include/stdlib.h:384: múltipla definição destrtoll'
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(hiredis.o):/usr/include/stdlib.h:384: definido primeiramente aqui
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(sds.o): na função strtoull': /usr/include/stdlib.h:390: múltipla definição destrtoull'
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(hiredis.o):/usr/include/stdlib.h:390: definido primeiramente aqui
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(sds.o): na função strtod': /usr/include/stdlib.h:330: múltipla definição deatof'
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(hiredis.o):/usr/include/stdlib.h:330: definido primeiramente aqui
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(sds.o): na função atoi': /usr/include/stdlib.h:403: múltipla definição deatoi'
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(hiredis.o):/usr/include/stdlib.h:403: definido primeiramente aqui
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(sds.o): na função strtol': /usr/include/stdlib.h:336: múltipla definição deatol'
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(hiredis.o):/usr/include/stdlib.h:336: definido primeiramente aqui
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(sds.o): na função strtoll': /usr/include/stdlib.h:384: múltipla definição deatoll'
/home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/vendor/hiredis/libhiredis.a(hiredis.o):/usr/include/stdlib.h:384: definido primeiramente aqui
collect2: error: ld returned 1 exit status
make: ** [hiredis_ext.so] Erro 1

Gem files will remain installed in /home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4 for inspection.
Results logged to /home/sostenes/.rvm/gems/ruby-1.8.7-p371@global/gems/hiredis-0.4.4/ext/hiredis_ext/gem_make.out
An error occurred while installing hiredis (0.4.4), and Bundler cannot continue.
Make sure that gem install hiredis -v '0.4.4' succeeds before bundling.

SSL not supported by hiredis driver message

Im using the latest version of redis-rb which is version 4.6.0 and also of hiredis gem, version 0.6.3. Im trying to connect to a Redis cluster in AWS which has in transit encryption enabled as follows:

client = Redis.new(url: 'the url here', ssl: true)

I get the following response:

NotImplementedError (SSL not supported by hiredis driver)

Also, tying to do client = Redis.new(url: 'the url here', ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE }) leads to a Connection Timeout.

I saw that hiredis C library has enabled SSL support (redis/hiredis#645 ). However, is SSL support still not available in the ruby version ?. Is there any other way to get SSL working with redis in ruby ?

Errno::EINVAL: Invalid argument instead of Redis::CannotConnectError

Sometimes this code fails (on different iteration) with Errno::EINVAL: Invalid argument when redis server is down.

redis = Redis.new(driver: :hiredis)
10000.times do |i|
  puts(i.to_s)
  begin
    redis.get(1)
  rescue Redis::CannotConnectError
  end
end
# oneliner:
# redis = Redis.new(driver: :hiredis); 10000.times { |i| puts(i.to_s); begin; redis.get(1); rescue Redis::CannotConnectError; end }

:ruby driver is ok.

AppVeyor tests fail due to Bundler version mismatch

The AppVeyor tests run on 2.1 and 2.2, it seems, and they both fail.

"Too new Bundler" for those.

gem install bundler --no-document
ERROR: Error installing bundler:
The last version of bundler (>= 0) to support your Ruby & RubyGems was 1.17.3. Try installing it with gem install bundler -v 1.17.3
bundler requires Ruby version >= 2.3.0. The current ruby version is 2.1.0.

Usage instructions are unclear

To use hiredis-rb with redis-rb, do I need to specify the driver when creating a connection?

Redis.new(url:'redis://localhost:6379/0', driver: :hiredis)

Or is it sufficient to follow the instructions and just do the following?

gem "hiredis", "~> 0.6.0"
gem "redis", ">= 3.2.0", :require => ["redis", "redis/connection/hiredis"]

and

Redis.new(url: 'redis://localhost:6379/0')

Or do I need to do both?

Thank you

Big fat thank you, works nicely and made my life a lot easier. Super fast 👍

RuntimeError sucks

Hey,

I noticed a small annoyance and inconsistency:

irb(main):004:0> Redis.new(host: "foobar").get('bar')
SocketError: getaddrinfo: Name or service not known

vs.

irb(main):006:0> Redis.new(host: "foobar", driver: 'hiredis').get('bar')
RuntimeError: Name or service not known

The Ruby driver raises SocketError while the hiredis driver raises RuntimeError. I would argue that SocketError is better because RuntimeError is very vague and harder to rescue in a meaningful way. Whatever your opinion on this is, I think both drivers should ideally raise the same error.

Thoughts?

@badboy

IPv6 Support?

It appears the current release of hiredis-rb doesn't support IPv6:

2.1.1 :006 > Redis.new(host: "::1", driver: :ruby).get(1)
 => nil 
2.1.1 :007 > Redis.new(host: "::1", driver: :hiredis).get(1)
RuntimeError: Address family for hostname not supported
from /home/dplummer/.rvm/gems/ruby-2.1.1/gems/redis-3.0.7/lib/redis/connection/hiredis.rb:16:in `connect'

(ruby 2.1.1, redis 2.8.8, redis gem 3.0.7, hiredis-rb 0.5.2)

I think this is from the hiredis C library. It looks like hiredis-rb is built against v0.11, and the IPv6 support hasn't been released yet. Am I on the right track there? Any plans for new releases?

[Fedora] ExtConnectionTest#test_recover_from_partial_write failure

Hello,

In Fedora we're running the test suite, still with your ext. built against system hiredis 0.13.3, and I've encountered this issue:

  1) Error:
ExtConnectionTest#test_recover_from_partial_write:
Errno::EAGAIN: Resource temporarily unavailable
    /builddir/build/BUILD/hiredis-0.6.3/usr/share/gems/gems/hiredis-0.6.3/test/connection_test.rb:295:in `flush'
    /builddir/build/BUILD/hiredis-0.6.3/usr/share/gems/gems/hiredis-0.6.3/test/connection_test.rb:295:in `block in test_recover_from_partial_write'
    /builddir/build/BUILD/hiredis-0.6.3/usr/share/gems/gems/hiredis-0.6.3/test/connection_test.rb:73:in `listen'
    /builddir/build/BUILD/hiredis-0.6.3/usr/share/gems/gems/hiredis-0.6.3/test/connection_test.rb:285:in `test_recover_from_partial_write'

If I run it with rescue on the failing flush, I get:

  1) Failure:
ExtConnectionTest#test_recover_from_partial_write [/builddir/build/BUILD/hiredis-0.6.3/usr/share/gems/gems/hiredis-0.6.3/test/connection_test.rb:300]:
Expected false to be truthy.

So it does not seem to recover.

Could you advice me what's the issue? I've reverted 5284a04, to be able to build. Is there something else I need to revert?

Thank you for your advice.

Implement C-level ping?

Hi, I've been trying to monitor Redis network latency within Sidekiq by using PING but I've learned that a process pegged at 100% CPU will dramatically overstate latency due to thread scheduling latency around the GVL. If you have 10 jobs crunching numbers, it may take 50-100ms to get a Ruby thread scheduled to process the PONG. Would you be interested in a special PING impl which is designed only to calculate round trip time in C, so as to avoid Ruby VM overhead?

I'm thinking something as simple as:

> redis.rtt_us
=> 267

where the result is the calculated RTT in µs.

See also sidekiq/sidekiq#5025

Ruby Fallback Gives Socket Error on Windows

I know that the hiredis extension is not supported on Windows, but I thought it was supposed to fall back to a pure Ruby implementation. It seems that does not work either on Windows - is that intentional?

require "redis"
require "hiredis"
require "hiredis/ruby/connection"

conn = Hiredis::Ruby::Connection.new
conn.connect("127.0.0.1", "6379", 10000)
conn.write(["PING"])
p conn.read


ruby hi-test.rb:

<internal:prelude>:78:in `__read_nonblock': A non-blocking socket operation could not be completed immediately. - read would block (IO::EWOULDBLOCKWaitReadable)
        from <internal:prelude>:78:in `read_nonblock'
        from C:/tools/ruby24/lib/ruby/gems/2.4.0/gems/hiredis-0.6.1/lib/hiredis/ruby/connection.rb:268:in `read'
        from ./hi-test.rb:6:in `<main>'

Interestingly, those exact same commands work OK when used manually in IRB, so it seems like this could be made to work on Windows. Perhaps there's a timing issue?

PS C:\WINDOWS\system32> irb
irb(main):001:0> require 'hiredis/ruby/connection'
=> true
irb(main):002:0> conn = Hiredis::Ruby::Connection.new
=> #<Hiredis::Ruby::Connection:0x00000000038a0428 @sock=nil, @timeout=nil>
irb(main):003:0> conn.connect("127.0.0.1", "6379", 10000)
=> nil
irb(main):004:0> conn.write(["PING"])
=> nil
irb(main):005:0> p conn.read
"PONG"
=> "PONG"
=> "awesome"

Running redis 3.0.503, redis gem 4.1.0, hiredis gem 0.6.3.

Running with multiple threads freezes program

Ran into a freezing server while using hiredis in a multithreaded context. I was able to trace it down to the hiredis library. I've prepared a small app that pretty consistently freezes whenever I use a thread pool count of more than 1. Here's the gist: https://gist.github.com/amcvega/93dbd8f7b31d02679c95

I run it with: ruby -I. test.rb | wc -l

With a thread count of 1, it finishes quickly. With a thread count of 2, it does a little bit and then locks up.

I'm not sure if it's just my setup or I've coded it wrong. I haven't been able to test it out on other machines yet. Here are my machine particulars:

  • ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux]
  • hiredis-0.5.2

redisKeepAlive cause compile errors in solaris.

I have presented a workaround:

int redisKeepAlive(redisContext *c, int interval) {
int val = 1;
int fd = c->fd;

if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &val, sizeof(val)) == -1){
    __redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
    return REDIS_ERR;
}

ifdef _OSX

val = interval;
if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &val, sizeof(val)) < 0) {
    __redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
    return REDIS_ERR;
}

else

#if defined(__sun) && defined(__SVR4)
#else
val = interval;
if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &val, sizeof(val)) < 0) {
    __redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
    return REDIS_ERR;
}

val = interval/3;
if (val == 0) val = 1;
if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &val, sizeof(val)) < 0) {
    __redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
    return REDIS_ERR;
}

val = 3;
if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &val, sizeof(val)) < 0) {
    __redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
    return REDIS_ERR;
}
#endif

endif

return REDIS_OK;

}

No releases on rubygems?

The latest release version on rubygems is 0.6.3 which is far behind the changelog. When will new releases be pushed to rubygems?

hiredis 0.5.0 introduces memory leak

Upon updating my application's dependencies from hired is 0.4.5->0.5.0, memory usage began leaking, until it consumes all memory on the box, which ultimately was leading to crashes:
screen shot 2014-03-31 at 11 10 37 am
(This is on a box with 512MB RAM)

Upon reverting back to hiredis 0.4.5, memory usage immediately became stable again.

hiredis-rb is not GC-safe

Hi there.

While investigating a GC-related issue (ohler55/oj#265 (comment)), @ohler55 mentioned that he looked at the hiredis-rb C code and saw some stuff that wasn't GC safe and might be the source of the bug I'm investigating (NotImplementedError: method ... called on terminated object). He pointed out that:

Ruby checks the stack for VALUE types which are Ruby object references. Compilers often optimize code by placing variable in registers which are invisible to Ruby as far as checking for wether an object is still being referenced. The work around for this is to make sure all VALUE local variable are volatile. That keeps them out of registers and on the stack.

See the linked-to github issue above, but I'm only seeing this issue a few times per day on an app that gets significant traffic, so it's tough to reproduce, but all signs point to it being GC-related.

I look forward to your reply here.

Doc update or clarification - using hiredis with redis

Hi, I'm a new rails user, so please forgive me if this is basic or off topic. I'm adding redis to my app and have be reviewing the Rails Guide and Readme here, as well as a doc from Engine Yard. Each one lays out a slightly different way to use Hi-Redis. I'm wondering which is correct, and if the Readme here could be updated to be a bit clearer - or explain why to do it as indicated here vs the Rails Guide.

From the Rails Guide: https://guides.rubyonrails.org/caching_with_rails.html#activesupport-cache-rediscachestore

From the Guide regarding Gem installation:
`
To get started, add the redis gem to your Gemfile:
gem 'redis'

You can enable support for the faster hiredis connection library by additionally adding its ruby wrapper to your Gemfile:
gem 'hiredis'

Redis cache store will automatically require & use hiredis if available. No further configuration is needed.

Finally, add the configuration in the relevant config/environments/*.rb file:
config.cache_store = :redis_cache_store, { url: ENV['REDIS_URL'] }
`

This seems to differ from the Readme here, which is a bit confusing for me as it has two sections that start the same To use hiredis from redis-rb,....

One shows loading the two Gems.
The next shows only the one gem with the require section that Rails Guides doesn't show.

Then the Engine Yard article here: https://www.engineyard.com/blog/rails-5-2-redis-cache-store says that the require is not needed as well, but they do show having to put driver in the config line.

So I'm wondering - which is correct, and is there a way we can make the Usage - redis-rb section of the readme a bit easier to understand, and clearer what to do?

Thanks for your time and patience.

failed to build native extension when directory structure has a space

When building hiredis from bundle install in an application that
has a space in the directory name, e.g. /home/john/app/space app/,
the following error occurs

Installing hiredis (0.4.5)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /opt/local/bin/ruby1.9 extconf.rb
sh: line 0: cd: /home/john/app/space: No such file or directory
creating Makefile

make
compiling connection.c
clang: error: no such file or directory: 'app/.gems/ruby/1.9.1/gems/hiredis-0.4.5/vendor/hiredis'
make: *** [connection.o] Error 1


Gem files will remain installed in /home/john/app/space app/.gems/ruby/1.9.1/gems/hiredis-0.4.5 for inspection.
Results logged to /home/john/app/space app/.gems/ruby/1.9.1/gems/hiredis-0.4.5/ext/hiredis_ext/gem_make.out

An error occurred while installing hiredis (0.4.5), and Bundler cannot continue.
Make sure that `gem install hiredis -v '0.4.5'` succeeds before bundling.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.