These are chat archives for CZ-NIC/knot-resolver

2nd
Jun 2017
Mike Emigh
@nakame_maiku_twitter
Jun 02 2017 05:47
@vcunat I'm guessing that if there are issues reaching the trust anchors download site during refresh, then that'll also block queries from being resolved?
Petr Špaček
@pspacek
Jun 02 2017 06:56
@nakame_maiku_twitter It should keep the old keys valid. Do you see a problem related to that?
Mike Emigh
@nakame_maiku_twitter
Jun 02 2017 07:08
@pspacek I meant more along the lines of it not being async, so that queries would be blocked until some sort of timeout occurs?
Petr Špaček
@pspacek
Jun 02 2017 07:24
Not sure, please test it and report results :-)
Mike Emigh
@nakame_maiku_twitter
Jun 02 2017 08:07
I set the bootstrap_url to an IP that doesn't respond and set refresh to 10 * sec
not seeing any blocks, but I am getting PANICs when querying at the same time
Petr Špaček
@pspacek
Jun 02 2017 08:08
What do you mean by 'panic'?
Mike Emigh
@nakame_maiku_twitter
Jun 02 2017 08:09
crash
[system] interactive mode
> [ ta ] key: 19036 state: Valid
[ ta ] next refresh for . in 0.0027777777777778 hours
PANIC: unprotected error in call to Lua API (8)
just repeatedly querying for google.com as it does its refresh
Petr Špaček
@pspacek
Jun 02 2017 08:10
Mike Emigh
@nakame_maiku_twitter
Jun 02 2017 08:14
actually I don't think its related, because I can cause the crash without loading that module
Petr Špaček
@pspacek
Jun 02 2017 08:20
If you can reproduce it reliably please report it.
Mike Emigh
@nakame_maiku_twitter
Jun 02 2017 08:21
I can, caused by policy.lua
Want to make sure it's done something that I caused
Petr Špaček
@pspacek
Jun 02 2017 08:22
Sure, thanks!
Mike Emigh
@nakame_maiku_twitter
Jun 02 2017 08:24
do you know of an easy way to get debug info from lua? "PANIC: unprotected error in call to Lua API (8)" isn't very helpful to me
Mike Emigh
@nakame_maiku_twitter
Jun 02 2017 08:30
I dont have an explanation for this, but if I remove any of these print statements, i can crash it quickly. with all of them in place, no crashes
-- Evaluate packet in given rules to determine policy action
function policy.evaluate(rules, req, query, state)
        print("HERE")
        for i = 1, #rules do
        print("HERE2")
                local rule = rules[i]
        print("HERE3")
                if not rule.suspended then
        print("HERE4")
                        local action = rule.cb(req, query)
        print("HERE5")
                        if action ~= nil then
                                rule.count = rule.count + 1
                                local next_state = policy.enforce(state, req, action)
                                if next_state then    -- Not a chain rule,
                                        return next_state -- stop on first match
                                end
                        end
                end
        end
        return state
end
Petr Špaček
@pspacek
Jun 02 2017 08:32
I know next to nothing about Lua so sorry, I cannot help here. @vcunat surely know better than me :-)
Mike Emigh
@nakame_maiku_twitter
Jun 02 2017 08:42
yeah, something is weird. If I add a print statement to some other function in that file thats not called, it crashes
Mike Emigh
@nakame_maiku_twitter
Jun 02 2017 08:48
appears to always die on this: req = kres.request_t(req)
Petr Špaček
@pspacek
Jun 02 2017 08:54
That is super weird.
Vladimír Čunát
@vcunat
Jun 02 2017 09:09
I'll look into it. I assume it's on kresd close to master.
Mike Emigh
@nakame_maiku_twitter
Jun 02 2017 09:15
Wonder if it's just my luajit since I'm the only one having problems
Vladimír Čunát
@vcunat
Jun 02 2017 09:16
What policies have you defined?
Mike Emigh
@nakame_maiku_twitter
Jun 02 2017 09:16
none
simply loading the module
yeah, im building from master. trying a luajit build without any optimizations now
Mike Emigh
@nakame_maiku_twitter
Jun 02 2017 09:33
think it might have been my luajit, the clang compile appears to be working better
Vladimír Čunát
@vcunat
Jun 02 2017 09:40
I can't see what could go wrong on req = kres.request_t(req). It's just a pointer cast, and it's even supposed to work on invalid pointers.
Mike Emigh
@nakame_maiku_twitter
Jun 02 2017 09:41
not happening anymore after recompiling luajit with clang with no optimizations, trying again with the defaults
Vladimír Čunát
@vcunat
Jun 02 2017 09:43
BTW, lately I've been testing with 2.1.0-beta3, compiled by gcc.
Mike Emigh
@nakame_maiku_twitter
Jun 02 2017 09:44
which version of gcc?
Vladimír Čunát
@vcunat
Jun 02 2017 09:44
5.4.0
Mike Emigh
@nakame_maiku_twitter
Jun 02 2017 09:44
I previously built with gcc 5.4.0
Vladimír Čunát
@vcunat
Jun 02 2017 09:45
but it's an "amalgamated" build
Mike Emigh
@nakame_maiku_twitter
Jun 02 2017 09:45
yeah, im using that too
not seeing any issues with clang and the default optimizations, so guess ill just stick with that