varnish / libvmod-digest

Digest and HMAC vmod
Other
50 stars 27 forks source link

VCL compilation fails with current varnish (6.2.0) #29

Closed cst152 closed 5 years ago

cst152 commented 5 years ago

Hi,

I'm currently having issues starting varnish with the digest module. import digest; causes the following error during VCL compilation:

Error:
Message from VCC-compiler:
Could not load VMOD digest
    File name: /usr/lib/varnish/vmods/libvmod_digest.so
    dlerror: /usr/lib/varnish/vmods/libvmod_digest.so: undefined symbol: vmod_init_function
('/etc/varnish/default.vcl' Line 16 Pos 8)
import digest;
-------######-

Running VCC-compiler failed, exited with 2
VCL compilation failed

I'm using a self-compiled varnish at version 6.2.0 and the master branch of libvmod-digest on Debian. I noticed this issue about a month ago with Varnish 6.1.1, though.

dridi commented 5 years ago

Yes, 6.2 introduced some "havoc" and normally it should be easy to solve:

https://varnish-cache.org/lists/pipermail/varnish-dev/2019-February/009327.html

Would you like to attempt a pull request?

dridi commented 5 years ago

Here is an example of such a migration: https://github.com/Dridi/libvmod-querystring/commit/b657fb4c08197e5c6a62d6be1a4bdbbd27796029

cst152 commented 5 years ago

I'll gladly help, though I'm not particularly an expert on the internals of Varnish. Or vmods. Or c for that matter :)

I made some changes to vmod_digest.c as you can review here. The vmod compiles as it should but I still get the same error when I launch varnish.

dridi commented 5 years ago

Does it work with Varnish 6.0 too?

cst152 commented 5 years ago

That'll take me some time to figure out. I'll get back to you.

cst152 commented 5 years ago

Alright, it works for varnish 6.0 and 6.1. After I changed init_function into VPFX(init_function), it also seems to work with 6.2.0. I'll test it some more and issue a pull request afterwards.

cst152 commented 5 years ago

Pull request has been issued.