Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined reference to `hi_malloc(unsigned long)' #769

Closed
DoctorUSB opened this issue Feb 27, 2020 · 8 comments
Closed

undefined reference to `hi_malloc(unsigned long)' #769

DoctorUSB opened this issue Feb 27, 2020 · 8 comments

Comments

@DoctorUSB
Copy link

I recently used hiredis in a project and made it into a docker image, the docker image was used in the project and worked fine, this was 2 months ago 17th of December. I recently changed a flag for OpenCV in the original Dockerfile and recreated a new image, I now seem to have a error as seen, below. I believe this may be because my Dockerfile clones the current hiredis repo with the new changes, and a new change may have caused this bug/error. Please note I get this error when just importing redis and not even using it.

/tmp/ccd0E4XK.o: In function `redisLibevAttach(ev_loop*, redisAsyncContext*)':
/usr/local/include/hiredis/adapters/libev.h:122: undefined reference to `hi_malloc(unsigned long)'
@michael-grunder
Copy link
Collaborator

Can you try again? I merged a few housekeeping fixes that are likely related to your issue.

@DoctorUSB
Copy link
Author

Hi Michael thanks for the reply and changes although, I am still having the issue with the latest commit. Thanks.

@michael-grunder
Copy link
Collaborator

Perhaps it's attempting to link to an older version of hiredis? I bumped the version to 0.15.0 in this repo as we'll need to do that before any official release.

It's hard to say for sure without a Dockerfile that lets me replicate the problem, but this error is exactly what I would expect when attempting to link to an older version of libhiredis.so.0.14.

If you can provide a Dockerfile to replicate the issue I'm happy to help.

@michael-grunder
Copy link
Collaborator

@DoctorUSB Are you still having issues?

@michael-grunder
Copy link
Collaborator

I'm going to close the issue because there hasn't been any activity but if you're still running into problems please reopen and let me know.

@dwilliamsND
Copy link

dwilliamsND commented May 7, 2020

@michael-grunder

Hey, Just to help out whoever runs into this -- We're running into this issue, as well. We encountered it, while doing an OS upgrade, and discovered that the workaround was to a manual install from git/source: details below.

From (works)

Ubuntu 16.04.6, GCC 5.4.0, CMake 3.5.1, libhiredis 0.13 (via apt get)

To (broken)

Ubuntu 20.04.0, GCC 9.3.0, CMake 3.16.3, libhiredis 0.14.0 (via apt get)

To (works)

Ubuntu 20.04.0, GCC 9.3.0, CMake 3.16.3, libhiredis 0.14.1 (manual install)

  1. $ git clone https://github.com/redis/hiredis.git
  2. $ cd hiredis
  3. $ git checkout v0.14.1 *
  4. $ make
  5. # make install
  6. (link in our application)

edit: * fixed minor version number -- thanks @ptalus

@ptalus
Copy link

ptalus commented Jul 26, 2020

3. `$ git co v0.14.0`

`$ git checkout v0.14.1

@nitrologic
Copy link

my temporary fix:

// wsl2 you suck...
void *hi_malloc(unsigned long size){
return malloc(size);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants