xiaooloong / lua-resty-iconv

LuaJIT FFI bindings for libiconv - Character encoding conversion in OpenResty

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SegmentFault when repeatedlly call method `convert`

xiaooloong opened this issue · comments

save the following code to a.lua

local iconv = require 'resty.iconv'
local i = iconv:new('GBK', 'UTF-8')
while true do
    local t = i:convert('中文')
end

run it with the command luajit a.lua will simply result in a segmentation fault