[Dev-luatex] segfault on example in manual

luigi scarso luigi.scarso at gmail.com
Tue Apr 2 07:18:38 CEST 2019


On Tue, Apr 2, 2019 at 12:23 AM Reinhard Kotucha <reinhard.kotucha at web.de>
wrote:

> Hi,
> when I run the example on page 261/262 of the LuaTeX Manual and the
> input file ("foo.pdf" in the example) doesn't exist, I get
>
>   Segmentation fault (core dumped)
>
> on x86_64-linux.
>
> Regards,
>   Reinhard
>
> --
> ------------------------------------------------------------------
> Reinhard Kotucha                            Phone: +49-511-3373112
> Marschnerstr. 25
> D-30167 Hannover                    mailto:reinhard.kotucha at web.de
> ------------------------------------------------------------------
> _______________________________________________
> dev-luatex mailing list
> dev-luatex at ntg.nl
> https://mailman.ntg.nl/mailman/listinfo/dev-luatex
>



Confirmed. The test is

local operatortable = { }

operatortable.Do = function(scanner,info)
    local resources = info.resources
    if resources then
            local val     = scanner:pop()
            local name    = val[2]
            local xobject = resources.XObject
            print(info.space .. "Uses XObject " .. name)
            local resources = xobject.Resources
            if resources then
                local newinfo = {
                    space     = info.space .. " ",
                    resources = resources,
                }
                pdfscanner.scan(entry, operatortable, newinfo)
            end
      end
end

local function Analyze(filename)
    local doc = pdfe.open(filename)
    if doc then
        local pages = doc.Pages
        for i=1,#pages do
            local page = pages[i]
            local info = {
              space     = " " ,
              resources = page.Resources,
            }
            print("Page " .. i)
         -- pdfscanner.scan(page.Contents,operatortable,info)
            pdfscanner.scan(page.Contents(),operatortable,info)
        end
    end
end

Analyze("foo.pdf")

-- 
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/dev-luatex/attachments/20190402/39f4b3f0/attachment.html>


More information about the dev-luatex mailing list