nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] nmh-1.7-RC1: scan with complex subjects dumps core


From: Leonardo Taccari
Subject: Re: [Nmh-workers] nmh-1.7-RC1: scan with complex subjects dumps core
Date: Sat, 05 Aug 2017 14:54:59 +0200

Hello Ralph,
I was bitten by something similar and so I've rebuilt nmh-1.7-RC1 with
debug symbols, attached some (hopefully) useful debug information (I've
used gdb though because AFAIK ltrace isn't available on NetBSD).

Ralph Corderoy writes:
> [...]
> Could you run this scan command with 1.7-RC1 to make sure it still has
> the assert(3) failure on the problem email.
>
>     scan -format '%(decode{subject})' cur
> [...]

I've mhstore-ed Norm's problematic email as `1' in the current directory
and reproduced it via:

 % scan -format '%(decode{subject})' +. 1
 assertion "w >= 0" failed: file "sbr/fmt_scan.c", line 291, function 
"cpstripped"
 Abort (core dumped)
 Exit 134

Looking at the problematic char on gdb (this is on NetBSD/amd64 8.99.1):

 % gdb -core ./scan.core `which scan`
 Reading symbols from /usr/pkg/bin/scan...done.
 [New process 1]
 Core was generated by `scan'.
 Program terminated with signal SIGABRT, Aborted.
 #0  0x00007e7fe9b2725a in _lwp_kill () from /usr/lib/libc.so.12
 (gdb) bt
 #0  0x00007e7fe9b2725a in _lwp_kill () from /usr/lib/libc.so.12
 #1  0x00007e7fe9b26e75 in abort () at /usr/src/lib/libc/stdlib/abort.c:74
 #2  0x00007e7fe9b26a03 in __assert13 (address@hidden "sbr/fmt_scan.c", 
address@hidden,
     address@hidden <__func__.6577> "cpstripped", address@hidden "w >= 0")
     at /usr/src/lib/libc/gen/assert.c:72
 #3  0x0000000000407552 in cpstripped (address@hidden, max=136,
     str=0x7f7fffc11e41 "\360\237\225\266Sun\342\200\231s out, savings 
ON\342\200\224shop major appliance deals now",
     address@hidden " \360\237\225\266Sun\342\200\231s out, savings 
ON\342\200\224shop major appliance deals now")
     at sbr/fmt_scan.c:291
 #4  0x0000000000407bf7 in fmt_scan (format=<optimized out>, 
scanlp=0x7e7fe9901560, width=136, address@hidden <dat>,
     address@hidden) at sbr/fmt_scan.c:450
 #5  0x0000000000403dda in scan (address@hidden, address@hidden, address@hidden,
     address@hidden "%(decode{subject})", width=<optimized out>, 
address@hidden, curflg=<optimized out>, unseen=0,
     folder=0x7e7fe9918268 "/tmp/m", size=0, noisy=1, scanl=0x7f7fffc14408) at 
uip/scansbr.c:326
 #6  0x0000000000403435 in main (argc=<optimized out>, argv=<optimized out>) at 
uip/scan.c:256
 (gdb) f 3
 #3  0x0000000000407552 in cpstripped (address@hidden, max=136,
     str=0x7f7fffc11e41 "\360\237\225\266Sun\342\200\231s out, savings 
ON\342\200\224shop major appliance deals now",
     address@hidden " \360\237\225\266Sun\342\200\231s out, savings 
ON\342\200\224shop major appliance deals now")
     at sbr/fmt_scan.c:291
 291             assert(w >= 0);
 (gdb) list
 286
 287             prevCtrl = 0;
 288
 289     #ifdef MULTIBYTE_SUPPORT
 290             w = wcwidth(wide_char);
 291             assert(w >= 0);
 292             if (max >= (size_t) w) {
 293                 charstring_push_back_chars (dest, altstr ? altstr : str, 
char_len, w);
 294                 max -= w;
 295                 str += char_len;
 (gdb) print w
 $1 = <optimized out>
 (gdb) print wide_char
 $2 = 128374 L'\x1f576'
 (gdb) quit

L'\x1f576' (in wide_char) is probably the `dark sunglasses' (U+1F576)
unicode character and directly trying to:

 wcwidth(L'\x1f576')

...returns `-1'.

If you need any further information please let me know!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]