emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: segfault in read_process_output() during vc-diff


From: Tim Van Holder
Subject: Re: segfault in read_process_output() during vc-diff
Date: Thu, 9 Nov 2006 14:52:22 +0100

On 11/9/06, Kenichi Handa <address@hidden> wrote:
In article <address@hidden>, "Tim Van Holder" <address@hidden> writes:

> With -g I get

> (gdb) up
> #1  0x0818c7ec in read_process_output (proc=142856980, channel=5) at
> /home/tim/gnu/src/emacs/src/process.c:5144
> 5144          bcopy (chars + coding->consumed, SDATA (p->decoding_buf),
> (gdb) info locals
> count = 3
> odeactivate = 137465089
> obuffer = 140212876
> waiting = -1
> okeymap = 142839261
> text = 143388459
> outer_running_asynch_code = 0
> nbytes = 1058
> chars = 0xbfffd5f0 "testsuite/input/godwit/ucm/system/sources
> --include=/test/testsuite/input/godwit/ucm/system/includes \\\n-
> --files-from=/test/testsuite/input/godwit/ucm/system/all-sources.lst\n-\n-#

Thank you, but I have no idea why nbytes (1058) can be less
than coding->consumed (2374).  Please show the value of
p->decoding_carryover too.

(gdb) p p->decoding_carryover
(gdb) pr

p->decoding_carryover and p->encoding_carryover are both 0.

I added some printfs ro read_process_output, in case they're of any help:

in read_process_output; carryover is 0, coding->consumed = 0
+ decision: proc_buffered_char[channel] (-1) < 0
 yes => emacs_read() says 4096 bytes read
** (coding.c:6365) decode_coding_string() set coding->consumed to 8
** (coding.c:6384) decode_coding_string() set coding->consumed to 4096
+ decode_coding_string() on a 4096-byte unibyte string set
coding->consumed to 4096
+ set carryover = nbytes - coding->consumed = 4096 - 4096 = 0
in read_process_output; carryover is 0, coding->consumed = 4096
+ decision: proc_buffered_char[channel] (-1) < 0
 yes => emacs_read() says 4096 bytes read
** (coding.c:6286) decode_coding_string() set coding->consumed to 4096
+ decode_coding_string() on a 4096-byte unibyte string set
coding->consumed to 4096
+ set carryover = nbytes - coding->consumed = 4096 - 4096 = 0
in read_process_output; carryover is 0, coding->consumed = 4096
+ decision: proc_buffered_char[channel] (-1) < 0
 yes => emacs_read() says 4096 bytes read
** (coding.c:6286) decode_coding_string() set coding->consumed to 4096
+ decode_coding_string() on a 4096-byte unibyte string set
coding->consumed to 4096
+ set carryover = nbytes - coding->consumed = 4096 - 4096 = 0
in read_process_output; carryover is 0, coding->consumed = 4096
+ decision: proc_buffered_char[channel] (-1) < 0
 yes => emacs_read() says 1058 bytes read
** (coding.c:6365) decode_coding_string() set coding->consumed to 0
** (coding.c:6384) decode_coding_string() set coding->consumed to 2374
+ decode_coding_string() on a 1058-byte unibyte string set
coding->consumed to 2374
+ set carryover = nbytes - coding->consumed = 1058 - 2374 = -1316

So it seems that decode_coding_string() arrives at an overly large
coding->consumed when
adding shrinked_bytes.




reply via email to

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