nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] solving a history bug in nano [patch]


From: Tito
Subject: Re: [Nano-devel] solving a history bug in nano [patch]
Date: Wed, 1 Jun 2016 15:09:48 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.8.0



On 06/01/2016 10:40 AM, Benno Schulenberg wrote:

On Tue, May 31, 2016, at 22:05, Tito wrote:
(gdb) backtrace
#0  0x40104368 in malloc_consolidate () from /lib/libc.so.6
#1  0x40106218 in _int_malloc () from /lib/libc.so.6
#2  0x40107878 in malloc () from /lib/libc.so.6
#3  0x00033d00 in nmalloc (howmuch=1920) at utils.c:388
#4  0x00037508 in display_string (buf=0xc9300 "pippo", start_col=0, len=62, 
dollars=false) at winio.c:1777
#5  0x000283a0 in not_found_msg (str=0xc9300 "pippo") at search.c:93
#6  0x00028dc0 in findnextstr (whole_word_only=false, begin=0xc9c48, begin_x=0, 
needle=0xc9300 "pippo", needle_len=0x0)
     at search.c:333
#7  0x00029178 in do_search () at search.c:456

Okay.  When you comment out the call of not_found_msg() at line 333
it will most likely just abort on the next malloc.  Something seems to
have messed up memory.

To exclude the possiblity that strncmp() is not working right on your
platform, can you compile and run the following small C program:

#include <string.h>
#include <stdio.h>

int main()
{
         printf("Four...  %x\n", strncmp("same", "sa", 4));
         printf("Much...  %x\n", strncmp("same", "sa", 12345));
         printf("Sizet... %x\n", strncmp("same", "sa", (size_t)-1));
         printf("Minus... %x\n", strncmp("same", "sa", -1));
}

Running ./a.out here produces:

Four...  1
Much...  1
Sizet... 1
Minus... 1

Hi,

 ./test
Four...  1
Much...  1
Sizet... 0
Minus... 0

LANG=it_IT
LC_CTYPE="it_IT"
LC_NUMERIC=it_IT
LC_TIME=it_IT
LC_COLLATE="it_IT"
LC_MONETARY=it_IT
LC_MESSAGES=it_IT

Hm.  Strange locale.  It doesn't specify a character encoding?
And some items are quoted and others not?  What character
encoding is it using?

How can I find it out?

Ciao,
Tito

Benno




reply via email to

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