On 2016/01/17 15:22, Sebastien Marie wrote:
> Hi,
> 
> Here a diff for adding pledge(2) to textproc/mupdf. I added ports@ in Cc
> in order to get wider reviewing.
> 
> I pledged all programs inside textproc/mupdf:
>   - mupdf-x11
>   - mupdf-gl
>   - mutool draw,clean,extract,info,pages,poster,show
>   - mujstest

These seem fine in my tests so far (tried a few files with various
image formats etc and some with passwords).

>   - mupdf-x11-curl

I ran into a problem with mupdf-x11-curl fetching from http getting
killed on the first file I tried: as luck would have it I haven't been
able to repeat it with another file, but http://dmtx.uk/ugh.pdf
if you'd like to try it. Works ok from disk. It fails to display
in the unpledged version too (sits burning cpu), so there's an
upstream bug anyway.

I've run out of time to dig for now but here's what I have so far:

mupdf: warning: not enough data to open yet
error: read of a block we don't have (E) (offset=0)
error: cannot load document from stream
[...lots of the above...]
mupdf: warning: not enough data to open yet
error: cannot find object in xref (8150 0 R) - not loaded yet?
error: cannot find object in xref (8150 0 R) - not loaded yet?
error: cannot find object in xref (18 0 R) - not loaded yet?
Pledged version - Abort trap (core dumped) 
Unpledged version - warning: Background fetch complete!

Core was generated by `mupdf-x11-curl'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00000dc8f939e4da in socket () at <stdin>:2
2       <stdin>: No such file or directory.
[Current thread is 1 (process 6470)]
(gdb) bt
#0  0x00000dc8f939e4da in socket () at <stdin>:2
#1  0x00000dc852af5bbb in _xcb_socket (family=1, type=1, proto=0)
    at /usr/xenocara/lib/libxcb/libxcb/../../../dist/libxcb/src/xcb_util.c:315
#2  0x00000dc852af5f7a in _xcb_open_unix (file=<optimized out>, protocol=0x0)
    at /usr/xenocara/lib/libxcb/libxcb/../../../dist/libxcb/src/xcb_util.c:440
#3  _xcb_open (display=0, protocol=<optimized out>, host=0xdc89f4ded90 "")
    at /usr/xenocara/lib/libxcb/libxcb/../../../dist/libxcb/src/xcb_util.c:297
#4  xcb_connect_to_display_with_auth_info (displayname=<optimized out>, 
auth=0x0, 
    screenp=0x0)
    at /usr/xenocara/lib/libxcb/libxcb/../../../dist/libxcb/src/xcb_util.c:506
#5  0x00000dc85d15060b in _XConnectXCB () from /usr/X11R6/lib/libX11.so.16.1
#6  0x00000dc85d1414fb in XOpenDisplay () from /usr/X11R6/lib/libX11.so.16.1
#7  0x00000dc60370f4e0 in winreloadpage (app=<optimized out>)
    at platform/x11/x11_main.c:701
#8  0x00000dc603717f8b in fetch_chunk (state=<optimized out>)
    at platform/x11/curl_stream.c:287
#9  fetcher_thread (state=<optimized out>) at platform/x11/curl_stream.c:318
#10 pthread_thread (arg=0xdc8fb4de000) at platform/x11/curl_stream.c:102
#11 0x00000dc8fed8477e in _rthread_start (v=0x1) at 
/usr/src/lib/librthread/rthread.c:145
#12 0x00000dc8f933252b in __tfork_thread ()
    at /usr/src/lib/libc/arch/amd64/sys/tfork_thread.S:75
#13 0x0000000000000000 in ?? ()
(gdb) frame 1
#1  0x00000dc852af5bbb in _xcb_socket (family=1, type=1, proto=0)
    at /usr/xenocara/lib/libxcb/libxcb/../../../dist/libxcb/src/xcb_util.c:315
315         fd = socket(family, type | SOCK_CLOEXEC, proto);
(gdb) frame 7
#7  0x00000dc60370f4e0 in winreloadpage (app=<optimized out>)
    at platform/x11/x11_main.c:701
701             Display *dpy = XOpenDisplay(NULL);

mupdf-x11-curl(1655): syscall 97 "unix"    -- socket
mupdf-x11-curl(12083): syscall 48 "stdio"  -- sigprocmask

Reply via email to