Subject: Re: mutt-1.4.2 (from pkgsrc) broken on -current/alpha?
To: None <tech-pkg@NetBSD.org>
From: Richard Braun <syn@sceen.net>
List: tech-pkg
Date: 02/21/2004 23:57:11
--ZPt4rx8FFjLCG7dd
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Feb 21, 2004 at 04:46:11PM -0600, Dave Huang wrote:
> [ Sorry, tech-pkg probably isn't exactly the right place for this, but
>   I figure you guys know about autoconf ]
>=20
> First, a recap for those on tech-pkg:
>=20
> I updated my mutt package from 1.4.1 to 1.4.2, and it now crashes soon
> after starting (it clears the screen, and that's it).
>=20
> On Wed, Feb 18, 2004 at 04:30:47PM -0600, Dave Huang wrote:
> > Manuel Bouyer wrote:
> >=20
> > >>The system is running -current with userland from Jan 21 and kernel f=
rom=20
> > >>Jan 24; perhaps I should try updating both (libc, in particular), but=
 it=20
> > >>doesn't look like wcrtomb() has had any changes in a while.
> > >>
> > >
> > >I'm running 1.6.x on this box, maybe that's the key.
> > >
> > Perhaps so... I think -current has many changes in the wide character=
=20
> > support. I recompiled mutt with -g, and now get:
> >=20
> > pid 2443 (mutt): unaligned access: va=3D0x1ffffeaa4 pc=3D0x160414670=20
> > ra=3D0x120021d28 sp=3D0x1ffffe9f0 op=3Dldq
> > pid 2443 (mutt): unaligned access: va=3D0x1ffffeaa4 pc=3D0x1604146b0=20
> > ra=3D0x120021d28 sp=3D0x1ffffe9f0 op=3Dldq
> > pid 2443 (mutt): unaligned access: va=3D0x200fba1800000c79 pc=3D0x16041=
46b8=20
> > ra=3D0x120021d28 sp=3D0x1ffffe9f0 op=3Dldq
> >=20
> > Program received signal SIGSEGV, Segmentation fault.
> > 0x00000001604146bc in wcrtomb () from /usr/lib/libc.so.12
> > (gdb) where
> > #0  0x00000001604146bc in wcrtomb () from /usr/lib/libc.so.12
> > #1  0x0000000120021d28 in mutt_format_string (
> >    dest=3D0x1200f7798 "/var/mail/khym: No such file or directory (errno=
 =3D=20
> > 2)",
> >    destlen=3D255, min_width=3D0, max_width=3D78, right_justify=3D0,
> >    m_pad_char=3D0 '\0',
> >    s=3D0x1200f7798 "/var/mail/khym: No such file or directory (errno =
=3D 2)",
> >    n=3D256, arboreal=3D0) at curs_lib.c:565
> > #2  0x0000000120020a70 in mutt_curses_error (
> >    fmt=3D0x1200cfa6c "%s: %s (errno =3D %d)") at curs_lib.c:255
> > #3  0x0000000120020fd8 in mutt_perror (s=3D0x1ffffec20 "/var/mail/khym")
> >    at curs_lib.c:326
> > #4  0x000000012005bce4 in mx_open_mailbox (path=3D0x1ffffec20=20
> > "/var/mail/khym",
> >    flags=3D0, pctx=3D0x0) at mx.c:657
> > #5  0x000000012004d550 in main (argc=3D1, argv=3D0x1fffff498) at main.c=
:838
> > (gdb) up
> > #1  0x0000000120021d28 in mutt_format_string (
> >    dest=3D0x1200f7798 "/var/mail/khym: No such file or directory (errno=
 =3D=20
> > 2)",
> >    destlen=3D255, min_width=3D0, max_width=3D78, right_justify=3D0,
> >    m_pad_char=3D0 '\0',
> >    s=3D0x1200f7798 "/var/mail/khym: No such file or directory (errno =
=3D 2)",
> >    n=3D256, arboreal=3D0) at curs_lib.c:565
> > 565           if (w > max_width || (k2 =3D wcrtomb (scratch, wc,=20
> > &mbstate2)) > destlen)
> >=20
> > I set machdep.unaligned_sigbus=3D1, and the unaligned access happens=20
> > within wcrtomb() also. However, a test program that calls=20
> > setlocale(LC_ALL, ""), then wcrtomb() works fine. I guess I'll just try=
=20
> > upgrading my system to the latest -current first :)
>=20
> I tracked it down, and the problem isn't in NetBSD's libc, the problem
> is that mutt's configure script doesn't think NetBSD has wchar.h, so
> it makes up bogus types for various wchar-related things (namely, it
> does a "#define mbstate_t int"). The reason it can't find wchar.h is:
>=20
> configure:7529: checking for wchar.h
> configure:7539: gcc -E -I/usr/include -I/usr/include -I$(top_srcdir)/intl=
 conftest.c >/dev/null 2>conftest.out
> top_srcdir: not found
> configure: failed program was:
> #line 7534 "configure"
> #include "confdefs.h"
> #include <wchar.h>
>=20
> What's this $(top_srcdir) about, and why isn't it being expanded? It's
> coming from line 7458 of the configure script (or line 758 of
> configure.in):
>=20
> CPPFLAGS=3D"$CPPFLAGS -I\$(top_srcdir)/intl"
>=20
> Any thoughts on how to fix it? Or perhaps someone could just commit a
> patch to pkgsrc? :)
> --=20
> Name: Dave Huang         |  Mammal, mammal / their names are called /
> INet: khym@azeotrope.org |  they raise a paw / the bat, the cat /
> FurryMUCK: Dahan         |  dolphin and dog / koala bear and hog -- TMBG
> Dahan: Hani G Y+C 28 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ =
PL++
>=20

I have NetBSD/i386 1.6.2 and NetBSD/sparc64 1.6.2 running Mutt/1.4.2i witho=
ut
any problem (from pkgsrc-2003Q4). FYI.

--=20
Richard Braun

--ZPt4rx8FFjLCG7dd
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFAN+JGBlWsEPLYRi8RAlUIAJ4+uzgK+7g0denQ0ficiwVwIGqtzACgquaE
LQSGjst+CCoJF3jRdaVyZnw=
=pXYy
-----END PGP SIGNATURE-----

--ZPt4rx8FFjLCG7dd--