Proper stack alignment for constructors on i386

2012-12-22 Thread Mark Kettenis
So the unaligned thread stack issue on i386 made me look at stack
alignment in constructors, and I noticed that things weren't quite
right there either.  Rather than doing arithmetic and depending on the
stack being aligned properly, just force the alignment to be right
just before we start executing the constructors.  As a bonus this
gives us a proper stackframe, which might actually help with debugging.

Tested by checking that a stack variable of type __m128i is now
properly aligned.

ok?


Index: md_init.h
===
RCS file: /cvs/src/lib/csu/i386/md_init.h,v
retrieving revision 1.2
diff -u -p -r1.2 md_init.h
--- md_init.h   31 Mar 2011 09:48:09 -  1.2
+++ md_init.h   22 Dec 2012 20:39:57 -
@@ -50,13 +50,15 @@
"   .type " #entry_pt ",@function   \n" \
#entry_pt": \n" \
"   .align 16   \n" \
-   "   subl$8,%esp \n" \
+   "   pushl   %ebp\n" \
+   "   movl%esp,%ebp   \n" \
+   "   andl$~15,%esp   \n" \
"   .previous")
 
 
 #define MD_SECTION_EPILOGUE(sect)  \
__asm ( \
".section "#sect",\"ax\",@progbits  \n" \
-   "   addl$8,%esp \n" \
+   "   leave   \n" \
"   ret \n" \
"   .previous")



Re: evince segfaults in sse2_composite_over_n_8_8888, i386, Dec 12 snapshot

2012-12-22 Thread Florian Obser
On Sat, Dec 22, 2012 at 08:33:47PM +0100, Mark Kettenis wrote:
> > Date: Sat, 22 Dec 2012 20:19:17 +0100 (CET)
> > From: Mark Kettenis 
> > 
> > > Date: Sat, 22 Dec 2012 18:36:53 +
> > > From: Florian Obser 
> > > 
> > > 0x0298c256 :  movdqa 
> > > %xmm0,0xffc8(%ebp)
> > 
> > I expected an instruction like that.  And since we have
> > 
> > > ebp0x82049574   0x82049574
> > 
> > the address 0xffc8(%ebp) isn't 16-byte aligned.  So it looks like
> > our thread stacks aren't properly aligned.  Looking for the best way
> > to fix this now.
> 
> Does this diff fix the issue?  it's a diff against libc, so you'll
> need the patch in /usr/src/lib/libc/arc/i386/sys and rebuild and
> install libc.
> 

Works for me, too. Thanks!

> 
> Index: tfork_thread.S
> ===
> RCS file: /cvs/src/lib/libc/arch/i386/sys/tfork_thread.S,v
> retrieving revision 1.4
> diff -u -p -r1.4 tfork_thread.S
> --- tfork_thread.S22 Aug 2012 17:19:34 -  1.4
> +++ tfork_thread.S22 Dec 2012 19:29:38 -
> @@ -88,6 +88,9 @@ ENTRY(__tfork_thread)
>*/
>  1:
>   xorl%ebp, %ebp  # mark outermost frame
> + subl$4, %esp# align stack
> + andl$~15, %esp
> + addl$4, %esp
>   pushl   %edi# push start argument
>   call*%esi
>   addl$4, %esp
> 

-- 
I'm not entirely sure you are real.



Re: evince segfaults in sse2_composite_over_n_8_8888, i386, Dec 12 snapshot

2012-12-22 Thread Matthieu Herrb
On Sat, Dec 22, 2012 at 08:33:47PM +0100, Mark Kettenis wrote:
> > Date: Sat, 22 Dec 2012 20:19:17 +0100 (CET)
> > From: Mark Kettenis 
> > 
> > > Date: Sat, 22 Dec 2012 18:36:53 +
> > > From: Florian Obser 
> > > 
> > > 0x0298c256 :  movdqa 
> > > %xmm0,0xffc8(%ebp)
> > 
> > I expected an instruction like that.  And since we have
> > 
> > > ebp0x82049574   0x82049574
> > 
> > the address 0xffc8(%ebp) isn't 16-byte aligned.  So it looks like
> > our thread stacks aren't properly aligned.  Looking for the best way
> > to fix this now.
> 
> Does this diff fix the issue?  it's a diff against libc, so you'll
> need the patch in /usr/src/lib/libc/arc/i386/sys and rebuild and
> install libc.
> 

Yes, it does fix the issue for me. Thanks.

> 
> Index: tfork_thread.S
> ===
> RCS file: /cvs/src/lib/libc/arch/i386/sys/tfork_thread.S,v
> retrieving revision 1.4
> diff -u -p -r1.4 tfork_thread.S
> --- tfork_thread.S22 Aug 2012 17:19:34 -  1.4
> +++ tfork_thread.S22 Dec 2012 19:29:38 -
> @@ -88,6 +88,9 @@ ENTRY(__tfork_thread)
>*/
>  1:
>   xorl%ebp, %ebp  # mark outermost frame
> + subl$4, %esp# align stack
> + andl$~15, %esp
> + addl$4, %esp
>   pushl   %edi# push start argument
>   call*%esi
>   addl$4, %esp

-- 
Matthieu Herrb



RFC: add nl(1)

2012-12-22 Thread Arto Jonsson
Hi,

this patch adds nl(1) from netbsd which, if I've understood correctly,
is required by posix 2008. I've made the following changes to the code
from netbsd:

* use strtonum
* getprogname() -> __progname
* remove old RCID
* use __dead
* clean up includes

For the manual:

* remove .Pp before .Bl (spotted by mandoc lint)
* use .Ex -std

I've marked this RFC because I got some questions. 

1) On line 68 of nl.c the regex_t is intialized with zeros. Leave as it
   is? The point being if regex_t structure changes -> convert it to
   pointer?

2) Convert the program to use getline() or not?

3) The man page should probably mention confomance to posix 2008.

4) I have no idea how cvs works so I just added the $OpenBSD$ line at
   the top. This is correct?

Index: Makefile
===
RCS file: /cvs/src/usr.bin/Makefile,v
retrieving revision 1.126
diff -u -u -a -r1.126 Makefile
--- Makefile23 Nov 2012 07:03:28 -  1.126
+++ Makefile22 Dec 2012 19:51:08 -
@@ -16,7 +16,7 @@
m4 mail make man mandoc mesg mg \
midiplay mixerctl mkdep mklocale mkstr mktemp modstat nc netstat \
newsyslog \
-   nfsstat nice nm nohup oldrdist pagesize passwd paste patch pctr \
+   nfsstat nice nm nl nohup oldrdist pagesize passwd paste patch pctr \
pkg-config pkill \
pr printenv printf quota radioctl ranlib rcs rdist rdistd \
readlink renice rev rpcgen rpcinfo rs rsh rup ruptime rusers rwall \
Index: nl/Makefile
===
RCS file: nl/Makefile
diff -N nl/Makefile
--- /dev/null   1 Jan 1970 00:00:00 -
+++ nl/Makefile 22 Dec 2012 19:51:08 -
@@ -0,0 +1,6 @@
+#  $OpenBSD$
+#  $NetBSD: Makefile,v 1.4 2011/08/16 12:00:46 christos Exp $
+
+PROG=  nl
+
+.include 
Index: nl/nl.1
===
RCS file: nl/nl.1
diff -N nl/nl.1
--- /dev/null   1 Jan 1970 00:00:00 -
+++ nl/nl.1 22 Dec 2012 19:51:08 -
@@ -0,0 +1,215 @@
+.\"$OpenBSD$
+.\"$NetBSD: nl.1,v 1.12 2012/04/08 22:00:39 wiz Exp $
+.\"
+.\" Copyright (c) 1999 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Klaus Klein.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd February 15, 1999
+.Dt NL 1
+.Os
+.Sh NAME
+.Nm nl
+.Nd line numbering filter
+.Sh SYNOPSIS
+.Nm
+.Op Fl p
+.Op Fl b Ar type
+.Op Fl d Ar delim
+.Op Fl f Ar type
+.Op Fl h Ar type
+.Op Fl i Ar incr
+.Op Fl l Ar num
+.Op Fl n Ar format
+.Op Fl s Ar sep
+.Op Fl v Ar startnum
+.Op Fl w Ar width
+.Op Ar file
+.Sh DESCRIPTION
+The
+.Nm
+utility reads lines from the named
+.Ar file
+or the standard input if the
+.Ar file
+argument is omitted,
+applies a configurable line numbering filter operation and writes the result
+to the standard output.
+.Pp
+The
+.Nm
+utility treats the text it reads in terms of logical pages.
+Unless specified otherwise, line numbering is reset at the start of each
+logical page.
+A logical page consists of a header, a body and a footer section; empty
+sections are valid.
+Different line numbering options are independently available for header,
+body and footer sections.
+.Pp
+The starts of logical page sections are signaled by input lines containing
+nothing but one of the following sequences of delimiter characters:
+.Bd -unfilled -offset indent
+.Bl -column "\e:\e:\e: " "header "
+.It Em "Line"  "Start of"
+.It \e:\e:\e:  header
+.It \e:\e: body
+.It \e:footer
+.El
+.Ed
+.Pp
+If the input does not contain any logical page section signaling dir

Re: evince segfaults in sse2_composite_over_n_8_8888, i386, Dec 12 snapshot

2012-12-22 Thread Mark Kettenis
> Date: Sat, 22 Dec 2012 20:19:17 +0100 (CET)
> From: Mark Kettenis 
> 
> > Date: Sat, 22 Dec 2012 18:36:53 +
> > From: Florian Obser 
> > 
> > 0x0298c256 :  movdqa 
> > %xmm0,0xffc8(%ebp)
> 
> I expected an instruction like that.  And since we have
> 
> > ebp0x82049574   0x82049574
> 
> the address 0xffc8(%ebp) isn't 16-byte aligned.  So it looks like
> our thread stacks aren't properly aligned.  Looking for the best way
> to fix this now.

Does this diff fix the issue?  it's a diff against libc, so you'll
need the patch in /usr/src/lib/libc/arc/i386/sys and rebuild and
install libc.


Index: tfork_thread.S
===
RCS file: /cvs/src/lib/libc/arch/i386/sys/tfork_thread.S,v
retrieving revision 1.4
diff -u -p -r1.4 tfork_thread.S
--- tfork_thread.S  22 Aug 2012 17:19:34 -  1.4
+++ tfork_thread.S  22 Dec 2012 19:29:38 -
@@ -88,6 +88,9 @@ ENTRY(__tfork_thread)
 */
 1:
xorl%ebp, %ebp  # mark outermost frame
+   subl$4, %esp# align stack
+   andl$~15, %esp
+   addl$4, %esp
pushl   %edi# push start argument
call*%esi
addl$4, %esp



Re: evince segfaults in sse2_composite_over_n_8_8888, i386, Dec 12 snapshot

2012-12-22 Thread Mark Kettenis
> Date: Sat, 22 Dec 2012 18:36:53 +
> From: Florian Obser 
> 
> 0x0298c256 :  movdqa %xmm0,0xffc8(%ebp)

I expected an instruction like that.  And since we have

> ebp0x82049574   0x82049574

the address 0xffc8(%ebp) isn't 16-byte aligned.  So it looks like
our thread stacks aren't properly aligned.  Looking for the best way
to fix this now.

Matthieu, you might want to hold off committing that workaround.



Re: evince segfaults in sse2_composite_over_n_8_8888, i386, Dec 12 snapshot

2012-12-22 Thread Matthieu Herrb
On Sat, Dec 22, 2012 at 07:08:45PM +0100, Mark Kettenis wrote:
> > Date: Sat, 22 Dec 2012 18:45:31 +0100
> > From: Matthieu Herrb 
> > List-Owner: 
> > 
> > On Fri, Dec 21, 2012 at 05:45:11PM +0100, Giovanni Bechis wrote:
> > 
> > [moving to tech@ since it's not a ports issue]
> > 
> > > On 12/21/12 17:40, Florian Obser wrote:
> > > > Hi,
> > > > evince-3.6.1 segfaults with this pdf:
> > > > http://gowers.files.wordpress.com/2012/02/elsevierstatementfinal.pdf
> > > > 
> > > > I tried a known good pdf (used to work in september) and get the
> > > > same bt.
> > > > 
> > > works for me with this snap:
> > > OpenBSD 5.2-current (GENERIC.MP) #2: Mon Dec 10 18:39:29 MST 2012
> > > dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> > 
> > I can reproduce it on i386 but not on amd64. It looks like an issue
> > with pixman's sse-2 code on i386. 
> 
> What instruction does it crash on?  What are the contents of the
> registers at that point?

I hope there's enough information in that gdb session transcript

Script started on Sat Dec 22 19:38:15 2012
bluenote% gdb evince
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-unknown-openbsd5.2"...(no debugging symbols 
found)

(gdb) r elsevierstatementfinal.pdf 
Starting program: /usr/local/bin/evince elsevierstatementfinal.pdf

** (evince:18904): WARNING **: Couldn't connect to accessibility bus: Failed to 
connect to socket /tmp/dbus-9LxEHkWwec: No such file or directory
[New process 18904]

Program received signal SIGSEGV, Segmentation fault.
[Switching to thread 1002687]
0x0953a657 in sse2_composite_over_n_8_ (imp=0x7c25b000, info=0x93d325b4) at 
emmintrin.h:584
584   return __extension__ (__m128i)(__v4si){ __q0, __q1, __q2, __q3 };
(gdb) x/i $pc
0x953a657 :   movdqa 0xfd18(%ebp),%xmm0
(gdb) bt
#0  0x0953a657 in sse2_composite_over_n_8_ (imp=0x7c25b000, 
info=0x93d325b4) at emmintrin.h:584
#1  0x0947ded2 in pixman_composite_glyphs_no_mask (op=PIXMAN_OP_OVER, 
src=0x89071e00, dest=0x853aad00, src_x=0, src_y=0, dest_x=0, dest_y=0, 
cache=0x8106d000, n_glyphs=3, 
glyphs=0x93d32710) at /usr/xenocara/lib/pixman/pixman/pixman-glyph.c:489
#2  0x0322bfc8 in composite_glyphs () from /usr/local/lib/libcairo.so.12.1
#3  0x03274de8 in composite_glyphs () from /usr/local/lib/libcairo.so.12.1
#4  0x0327675a in clip_and_composite () from /usr/local/lib/libcairo.so.12.1
#5  0x03276a23 in _cairo_traps_compositor_glyphs () from 
/usr/local/lib/libcairo.so.12.1
#6  0x0321de92 in _cairo_compositor_glyphs () from 
/usr/local/lib/libcairo.so.12.1
#7  0x03230355 in _cairo_image_surface_glyphs () from 
/usr/local/lib/libcairo.so.12.1
#8  0x03265602 in _cairo_surface_show_text_glyphs () from 
/usr/local/lib/libcairo.so.12.1
#9  0x0322694a in _cairo_gstate_show_text_glyphs () from 
/usr/local/lib/libcairo.so.12.1
#10 0x032176fe in cairo_show_glyphs () from /usr/local/lib/libcairo.so.12.1
#11 0x0d696ade in CairoOutputDev::endString () from 
/usr/local/lib/libpoppler-glib.so.11.0
#12 0x028b7150 in Gfx::doShowText () from /usr/local/lib/libpoppler.so.15.0
#13 0x028bcbfc in Gfx::opShowSpaceText () from /usr/local/lib/libpoppler.so.15.0
#14 0x028ae490 in Gfx::execOp () from /usr/local/lib/libpoppler.so.15.0
#15 0x028aeb81 in Gfx::go () from /usr/local/lib/libpoppler.so.15.0
#16 0x028af2df in Gfx::display () from /usr/local/lib/libpoppler.so.15.0
#17 0x02909d1c in Page::displaySlice () from /usr/local/lib/libpoppler.so.15.0
#18 0x0d68ce25 in _poppler_page_render () from 
/usr/local/lib/libpoppler-glib.so.11.0
#19 0x0d68d059 in poppler_page_render () from 
/usr/local/lib/libpoppler-glib.so.11.0
#20 0x0b2c2aa7 in pdf_page_render () from 
/usr/local/lib/evince/4/backends/libpdfdocument.so
#21 0x0b2c2e13 in pdf_document_render () from 
/usr/local/lib/evince/4/backends/libpdfdocument.so
#22 0x01f49058 in ev_document_render () from 
/usr/local/lib/libevdocument3.so.0.0
#23 0x0f6b8a71 in ev_job_render_run () from /usr/local/lib/libevview3.so.0.0
#24 0x0f6b4d11 in ev_job_run () from /usr/local/lib/libevview3.so.0.0
#25 0x0f6b9547 in ev_job_thread_proxy () from /usr/local/lib/libevview3.so.0.0
#26 0x0a07a362 in g_thread_proxy () from /usr/local/lib/libglib-2.0.so.3400.0
#27 0x0534a10e in _rthread_start (v=0x81e5f900) at 
/usr/src/lib/librthread/rthread.c:122
#28 0x09233809 in __tfork_thread () at 
/usr/src/lib/libc/arch/i386/sys/tfork_thread.S:92
(gdb) info all-registers 
eax0xff00   -16777216
ecx0xff00   -16777216
edx0xff00   -16777216
ebx0x292bf84c   690747468
esp0x93d316bc   0x93d316bc
ebp0x93d32564   0x93d32564
esi

Re: evince segfaults in sse2_composite_over_n_8_8888, i386, Dec 12 snapshot

2012-12-22 Thread Florian Obser
On Sat, Dec 22, 2012 at 07:08:45PM +0100, Mark Kettenis wrote:
> > Date: Sat, 22 Dec 2012 18:45:31 +0100
> > From: Matthieu Herrb 
> > List-Owner: 
> > 
> > On Fri, Dec 21, 2012 at 05:45:11PM +0100, Giovanni Bechis wrote:
> > 
> > [moving to tech@ since it's not a ports issue]
> > 
> > > On 12/21/12 17:40, Florian Obser wrote:
> > > > Hi,
> > > > evince-3.6.1 segfaults with this pdf:
> > > > http://gowers.files.wordpress.com/2012/02/elsevierstatementfinal.pdf
> > > > 
> > > > I tried a known good pdf (used to work in september) and get the
> > > > same bt.
> > > > 
> > > works for me with this snap:
> > > OpenBSD 5.2-current (GENERIC.MP) #2: Mon Dec 10 18:39:29 MST 2012
> > > dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> > 
> > I can reproduce it on i386 but not on amd64. It looks like an issue
> > with pixman's sse-2 code on i386. 
> 
> What instruction does it crash on?  What are the contents of the
> registers at that point?
> 
(I don't know what I'm doing here, hope this is right)
#0  0x0298c256 in sse2_composite_over_n_8_ () from 
/usr/X11R6/lib/libpixman-1.so.28.0
(gdb) disassemble 0x0298c256 0x0298c25a
Dump of assembler code from 0x298c256 to 0x298c25a:
0x0298c256 :  movdqa %xmm0,0xffc8(%ebp)
End of assembler dump.
(gdb) info registers 
eax0x8b592000   -1957093376
ecx0xff00   -16777216
edx0xf683944
ebx0x2292f7cc   580057036
esp0x820494dc   0x820494dc
ebp0x82049574   0x82049574
esi0x8b592a00   -1957090816
edi0x79 121
eip0x298c2560x298c256
eflags 0x210286 2163334
cs 0x2b 43
ss 0x33 51
ds 0x33 51
es 0x33 51
fs 0x5b 91
gs 0x63 99
(gdb) info registers xmm0
xmm0   {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, 
v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 
0x0, 0x0}, 
  v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 
0x}
(gdb) bt
#0  0x0298c256 in sse2_composite_over_n_8_ () from 
/usr/X11R6/lib/libpixman-1.so.28.0
#1  0x0296ac41 in pixman_composite_glyphs_no_mask () from 
/usr/X11R6/lib/libpixman-1.so.28.0
#2  0x0a7d8fc8 in composite_glyphs () from /usr/local/lib/libcairo.so.12.1
#3  0x0a821de8 in composite_glyphs () from /usr/local/lib/libcairo.so.12.1
#4  0x0a82375a in clip_and_composite () from /usr/local/lib/libcairo.so.12.1
#5  0x0a823a23 in _cairo_traps_compositor_glyphs () from 
/usr/local/lib/libcairo.so.12.1
#6  0x0a7cae92 in _cairo_compositor_glyphs () from 
/usr/local/lib/libcairo.so.12.1
#7  0x0a7dd355 in _cairo_image_surface_glyphs () from 
/usr/local/lib/libcairo.so.12.1
#8  0x0a812602 in _cairo_surface_show_text_glyphs () from 
/usr/local/lib/libcairo.so.12.1
#9  0x0a7d394a in _cairo_gstate_show_text_glyphs () from 
/usr/local/lib/libcairo.so.12.1
#10 0x0a7c46fe in cairo_show_glyphs () from /usr/local/lib/libcairo.so.12.1
#11 0x0ce77ade in CairoOutputDev::endString () from 
/usr/local/lib/libpoppler-glib.so.11.0
#12 0x0d226150 in Gfx::doShowText () from /usr/local/lib/libpoppler.so.15.0
#13 0x0d22bbfc in Gfx::opShowSpaceText () from /usr/local/lib/libpoppler.so.15.0
#14 0x0d21d490 in Gfx::execOp () from /usr/local/lib/libpoppler.so.15.0
#15 0x0d21db81 in Gfx::go () from /usr/local/lib/libpoppler.so.15.0
#16 0x0d21e2df in Gfx::display () from /usr/local/lib/libpoppler.so.15.0
#17 0x0d278d1c in Page::displaySlice () from /usr/local/lib/libpoppler.so.15.0
#18 0x0ce6de25 in _poppler_page_render () from 
/usr/local/lib/libpoppler-glib.so.11.0
#19 0x0ce6e059 in poppler_page_render () from 
/usr/local/lib/libpoppler-glib.so.11.0
#20 0x073abaa7 in pdf_page_render () from 
/usr/local/lib/evince/4/backends/libpdfdocument.so
#21 0x073abe13 in pdf_document_render () from 
/usr/local/lib/evince/4/backends/libpdfdocument.so
#22 0x0d411058 in ev_document_render () from 
/usr/local/lib/libevdocument3.so.0.0
#23 0x0090ea71 in ev_job_render_run () from /usr/local/lib/libevview3.so.0.0
#24 0x0090ad11 in ev_job_run () from /usr/local/lib/libevview3.so.0.0
#25 0x0090f547 in ev_job_thread_proxy () from /usr/local/lib/libevview3.so.0.0
#26 0x07dcd362 in g_thread_proxy () from /usr/local/lib/libglib-2.0.so.3400.0
#27 0x08de710e in _rthread_start (v=0x7e078500) at 
/usr/src/lib/librthread/rthread.c:122
#28 0x0ba7a809 in __tfork_thread () at 
/usr/src/lib/libc/arch/i386/sys/tfork_thread.S:92

-- 
I'm not entirely sure you are real.



Re: evince segfaults in sse2_composite_over_n_8_8888, i386, Dec 12 snapshot

2012-12-22 Thread Mark Kettenis
> Date: Sat, 22 Dec 2012 18:45:31 +0100
> From: Matthieu Herrb 
> List-Owner: 
> 
> On Fri, Dec 21, 2012 at 05:45:11PM +0100, Giovanni Bechis wrote:
> 
> [moving to tech@ since it's not a ports issue]
> 
> > On 12/21/12 17:40, Florian Obser wrote:
> > > Hi,
> > > evince-3.6.1 segfaults with this pdf:
> > > http://gowers.files.wordpress.com/2012/02/elsevierstatementfinal.pdf
> > > 
> > > I tried a known good pdf (used to work in september) and get the
> > > same bt.
> > > 
> > works for me with this snap:
> > OpenBSD 5.2-current (GENERIC.MP) #2: Mon Dec 10 18:39:29 MST 2012
> > dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> 
> I can reproduce it on i386 but not on amd64. It looks like an issue
> with pixman's sse-2 code on i386. 

What instruction does it crash on?  What are the contents of the
registers at that point?



Re: evince segfaults in sse2_composite_over_n_8_8888, i386, Dec 12 snapshot

2012-12-22 Thread Matthieu Herrb
On Fri, Dec 21, 2012 at 05:45:11PM +0100, Giovanni Bechis wrote:

[moving to tech@ since it's not a ports issue]

> On 12/21/12 17:40, Florian Obser wrote:
> > Hi,
> > evince-3.6.1 segfaults with this pdf:
> > http://gowers.files.wordpress.com/2012/02/elsevierstatementfinal.pdf
> > 
> > I tried a known good pdf (used to work in september) and get the
> > same bt.
> > 
> works for me with this snap:
> OpenBSD 5.2-current (GENERIC.MP) #2: Mon Dec 10 18:39:29 MST 2012
> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP

I can reproduce it on i386 but not on amd64. It looks like an issue
with pixman's sse-2 code on i386. 

Until someone knowledgeable it this area proposes a better fix (and yes
I checked that pixman 0.28.2 or -head don't fix it), I suggest the
patch below for pixman, that I'm probably to commit.

--- lib/pixman/Makefile.bsd-wrapper
+++ lib/pixman/Makefile.bsd-wrapper
@@ -4,6 +4,10 @@
 
 SHARED_LIBS=   pixman-1 28.0
 
+.if ${MACHINE_ARCH} == i386
+CONFIGURE_ARGS += --disable-sse2
+.endif
+
 .if ${MACHINE_ARCH} == arm
 CONFIGURE_ARGS +=  --disable-arm-simd --disable-arm-neon
 .endif

-- 
Matthieu Herrb