unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kazuhiro Ito <kzhr@d1.dion.ne.jp>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: 9318@debbugs.gnu.org
Subject: bug#9318: 23.3.50; The first call of encode-coding-region() returns wrong result
Date: Sun, 21 Aug 2011 09:17:05 +0900	[thread overview]
Message-ID: <20110821001726.D29052C037@msa104.auone-net.jp> (raw)
In-Reply-To: <877h67vkpf.fsf@stupidchicken.com>

> >> When I start Emacs and evaluate the below code, unexpected result returns.
> >
> >> (let ((func (lambda ()
> >> 	      (with-temp-buffer
> >> 		(mapc 'insert '(166 25339))
> >> 		(encode-coding-region (point-min) (point-max) 'ctext-unix)
> >> 		(buffer-string)))))
> >>   (cons (funcall func)
> >> 	(funcall func)))
> >> -> ("¦拻^@^@^@^@^@^@^@^@^@^@" . "^[$(D\"C^[$(H*f^[(B")
> >
> > I noticed this problem is not Windows specific.  I confirmed that it
> > is reproducible in Emacs 23.3.1 (build by pkgsrc) on NetBSD/amd64 via
> > SSH from remote host.  But it doesn't occur on openSUSE 11.3.
> 
> Could you run Emacs under a debugger, trigger the crash, and provide a
> backtrace?  (You will need to have compiled Emacs with debugging
> symbols.)

I built Emacs 23.3 with "-O0 -g" option on NetBSD 5.1 (amd64), and
started with below commad (via SSH).

gdb --args emacs -Q --no-splash

Next, inputtedand below code and evaluated with C-x C-e.

(progn
  (goto-char (point-min))
  (insert #x80)
  (insert (make-string 16 ?A))
  (encode-coding-region 1 18 'ctext-unix))

backtrace is below.  Please let me know if you need more information.


Program received signal SIGSEGV, Segmentation fault.
0x0000000000557419 in mark_object (arg=4702111234474983745) at alloc.c:5473
5473            if (STRING_MARKED_P (ptr))
(gdb) bt full
#0  0x0000000000557419 in mark_object (arg=4702111234474983745) at alloc.c:5473
        ptr = (struct Lisp_String *) 0x4141414141414140
        obj = 4702111234474983745
        cdr_count = 0
#1  0x0000000000557320 in mark_char_table (ptr=0x1281800) at alloc.c:5405
        val = 4702111234474983745
        size = 130
        i = 0
#2  0x0000000000557315 in mark_char_table (ptr=0x17f6c00) at alloc.c:5402
        val = 19404805
        size = 34
        i = 14
#3  0x0000000000557315 in mark_char_table (ptr=0x13ea700) at alloc.c:5402
        val = 25127941
        size = 18
        i = 6
#4  0x0000000000557315 in mark_char_table (ptr=0x10ba800) at alloc.c:5402
        val = 20883205
        size = 68
        i = 4
#5  0x0000000000557838 in mark_object (arg=17541125) at alloc.c:5567
        obj = 17541125
        cdr_count = 0
#6  0x0000000000557228 in mark_vectorlike (ptr=0xb16480) at alloc.c:5377
        size = 10
        i = 9
#7  0x0000000000557855 in mark_object (arg=11625605) at alloc.c:5569
        obj = 11625605
        cdr_count = 0
#8  0x0000000000557228 in mark_vectorlike (ptr=0xb56000) at alloc.c:5377
        size = 434
        i = 107
#9  0x0000000000557855 in mark_object (arg=11886597) at alloc.c:5569
        obj = 11886597
        cdr_count = 0
#10 0x00000000005577b0 in mark_object (arg=10786565) at alloc.c:5562
        h = (struct Lisp_Hash_Table *) 0xa49700
        obj = 10786565
        cdr_count = 0
#11 0x00000000005568ff in Fgarbage_collect () at alloc.c:5092
        bind = (struct specbinding *) 0xb96526
        catch = (struct catchtag *) 0x7f7fffffc508
        handler = (struct handler *) 0x10
        stack_top_variable = 0 '\0'
        i = 418
        message_p = 0
        total = {140187732526192, 140187732526008, 140187732526000, 4294967295, 
  12148454, 10960258, 10312685, 68}
        count = 8
        t1 = {
  tv_sec = 1313842937, 
  tv_usec = 498976
}
        t2 = {
  tv_sec = 0, 
  tv_usec = 140187732530104
}
        t3 = {
  tv_sec = 11465618, 
  tv_usec = 0
}
#12 0x0000000000577bb4 in Ffuncall (nargs=2, args=0x7f7fffffc4f0) at eval.c:2965
        fun = 10313885
        original_fun = 10959186
        funcar = 10762338
        numargs = 1
        lisp_numargs = 10950075
        val = 68
        backtrace = {
  next = 0x7f7fffffc9a0, 
  function = 0x7f7fffffc4f8, 
  args = 0x7f7fffffc500, 
  nargs = 1, 
  evalargs = 0 '\0', 
  debug_on_exit = 0 '\0'
}
        internal_args = (Lisp_Object *) 0x7f7fffffc500
        i = 0
#13 0x00000000005ce3c1 in Fbyte_code (bytestr=9300689, vector=9300725, maxdepth=12)
    at bytecode.c:680
        count = 7
        op = 1
        vectorp = (Lisp_Object *) 0x8deb00
        bytestr_length = 18
        stack = {
  pc = 0x96972f ")\207", 
  top = 0x7f7fffffc4f8, 
  bottom = 0x7f7fffffc4f0, 
  byte_string = 9300689, 
  byte_string_start = 0x96971f "\b\203\b", 
  constants = 9300725, 
  next = 0x7f7fffffcb40
}
        top = (Lisp_Object *) 0x7f7fffffc4f0
        result = 10956883
#14 0x00000000005788cc in funcall_lambda (fun=9300621, nargs=1, 
    arg_vector=0x7f7fffffca28) at eval.c:3220
        val = 10762242
        syms_left = 10762242
        next = 18577650
        count = 6
        i = 1
        optional = 0
        rest = 0
#15 0x000000000057821a in Ffuncall (nargs=2, args=0x7f7fffffca20) at eval.c:3077
        fun = 9300621
        original_fun = 18577602
        funcar = 18577842
        numargs = 1
        lisp_numargs = 10956963
        val = 10762242
        backtrace = {
  next = 0x7f7fffffced0, 
  function = 0x7f7fffffca20, 
  args = 0x7f7fffffca28, 
  nargs = 1, 
  evalargs = 0 '\0', 
  debug_on_exit = 0 '\0'
}
        internal_args = (Lisp_Object *) 0xa730a3
        i = 0
#16 0x00000000005ce3c1 in Fbyte_code (bytestr=9301185, vector=9301221, maxdepth=12)
    at bytecode.c:680
        count = 5
        op = 1
        vectorp = (Lisp_Object *) 0x8decf0
        bytestr_length = 31
        stack = {
  pc = 0x969692 "\v)B\211\034A\n=\204\033", 
  top = 0x7f7fffffca28, 
  bottom = 0x7f7fffffca20, 
  byte_string = 9301185, 
  byte_string_start = 0x969685 "\b\204\b", 
  constants = 9301221, 
  next = 0x0
}
        top = (Lisp_Object *) 0x7f7fffffca20
        result = 10762242
#17 0x00000000005788cc in funcall_lambda (fun=9301109, nargs=1, 
    arg_vector=0x7f7fffffcfa8) at eval.c:3220
        val = 140187732528832
        syms_left = 10762242
        next = 18577650
        count = 4
        i = 1
        optional = 0
        rest = 0
#18 0x000000000057821a in Ffuncall (nargs=2, args=0x7f7fffffcfa0) at eval.c:3077
        fun = 9301109
        original_fun = 11438610
        funcar = 5059672
        numargs = 1
        lisp_numargs = 5059670
        val = 10762242
        backtrace = {
  next = 0x7f7fffffd310, 
  function = 0x7f7fffffcfa0, 
  args = 0x7f7fffffcfa8, 
  nargs = 1, 
  evalargs = 0 '\0', 
  debug_on_exit = 0 '\0'
}
        internal_args = (Lisp_Object *) 0xa77993
        i = 0
#19 0x000000000057296b in Fcall_interactively (function=11438610, 
    record_flag=10762242, keys=10790405) at callint.c:869
        val = 4
        args = (Lisp_Object *) 0x7f7fffffcfa0
        visargs = (Lisp_Object *) 0x7f7fffffcf80
        specs = 9301281
        filter_specs = 9301281
        teml = 5734938
        up_event = 10762242
        enable = 10762242
        speccount = 2
        next_event = 2
        prefix_arg = 10762242
        string = (unsigned char *) 0x7f7fffffcfc0 "P"
        tem = (unsigned char *) 0x61652c ""
        varies = (int *) 0x7f7fffffcf60
        i = 2
        j = 1
        count = 1
        foo = 1
        prompt1 = '\0' <repeats 99 times>
        tem1 = 0x0
        arg_from_tty = 0
        gcpro1 = {
  next = 0xa43802, 
  var = 0xa43802, 
  nvars = 0
}
        gcpro2 = {
  next = 0xa53bc2, 
  var = 0xa51c05, 
  nvars = 10828738
}
        gcpro3 = {
  next = 0xa55952, 
  var = 0xa53bc2, 
  nvars = 2
}
        gcpro4 = {
  next = 0xa43802, 
  var = 0xb4a776, 
  nvars = 2
}
        gcpro5 = {
  next = 0xa43802, 
  var = 0xa43802, 
  nvars = 10836306
}
        key_count = 2
        record_then_fail = 0
        save_this_command = 11438610
        save_last_command = 11490098
        save_this_original_command = 11438610
        save_real_this_command = 11438610
#20 0x0000000000577f70 in Ffuncall (nargs=4, args=0x7f7fffffd3b0) at eval.c:3037
        fun = 10312397
        original_fun = 10978002
        funcar = 4294967297
        numargs = 3
        lisp_numargs = 10937344
        val = 315
        backtrace = {
  next = 0x0, 
  function = 0x7f7fffffd3b0, 
  args = 0x7f7fffffd3b8, 
  nargs = 3, 
  evalargs = 0 '\0', 
  debug_on_exit = 0 '\0'
}
        internal_args = (Lisp_Object *) 0x7f7fffffd3b8
        i = 0
#21 0x000000000057795d in call3 (fn=10978002, arg1=11438610, arg2=10762242, 
    arg3=10762242) at eval.c:2857
        ret_ungc_val = 9301109
        gcpro1 = {
  next = 0x8dec75, 
  var = 0xa43802, 
  nvars = 4
}
        args = {10978002, 11438610, 10762242, 10762242}
#22 0x00000000004e4bca in Fcommand_execute (cmd=11438610, record_flag=10762242, 
    keys=10762242, special=10762242) at keyboard.c:10562
        final = 9301109
        tem = 10762242
        prefixarg = 10762242
#23 0x00000000004d564d in command_loop_1 () at keyboard.c:1906
        cmd = 11438610
        lose = 1
        keybuf = {96, 20, 8, 0, 140187732530800, 18451712, 1893, 0, 
  140187732530816, 1983, 18451712, 4294967317, 140187732530800, 6299742, 10656928, 
  216, 10937344, 7378697632079252736, 140187732530864, 9720, 274877896416, 
  140187732531032, 0, 140187732530872, 140187732530384, 0, 10762242, 12348018, 
  8166853, 10762242}
        i = 2
        prev_modiff = 158
        prev_buffer = (struct buffer *) 0xa51c00
        already_adjusted = 0
#24 0x0000000000575049 in internal_condition_case (bfun=0x4d3a17 <command_loop_1>, 
    handlers=10851522, hfun=0x4d34bc <cmd_error>) at eval.c:1492
        val = 10762242
        c = {
  tag = 10762242, 
  val = 10762242, 
  next = 0x7f7fffffd880, 
  gcpro = 0x0, 
  jmp = {2129, 140187732531264, 140187732541408, 140187698962432, 140187696909296, 
    3, 140187732531000, 5722036, 0, 140187732531488, 18636288}, 
  backlist = 0x0, 
  handlerlist = 0x0, 
  lisp_eval_depth = 0, 
  pdlcount = 2, 
  poll_suppress_count = 0, 
  interrupt_input_blocked = 0, 
  byte_stack = 0x0
}
        h = {
  handler = 10851522, 
  var = 10762242, 
  chosen_clause = 0, 
  tag = 0x7f7fffffd790, 
  next = 0x0
}
#25 0x00000000004d389f in command_loop_2 () at keyboard.c:1362
        val = 1
#26 0x0000000000574a0e in internal_catch (tag=10846786, 
    func=0x4d3885 <command_loop_2>, arg=10762242) at eval.c:1228
        c = {
  tag = 10846786, 
  val = 10762242, 
  next = 0x0, 
  gcpro = 0x0, 
  jmp = {2129, 140187732531488, 140187732541408, 140187698962432, 140187696909296, 
    3, 140187732531288, 5720565, 4301358603, 10820608, 11046651}, 
  backlist = 0x0, 
  handlerlist = 0x0, 
  lisp_eval_depth = 0, 
  pdlcount = 2, 
  poll_suppress_count = 0, 
  interrupt_input_blocked = 0, 
  byte_stack = 0x0
}
#27 0x00000000004d3859 in command_loop () at keyboard.c:1341
No locals.
#28 0x00000000004d3004 in recursive_edit_1 () at keyboard.c:956
        count = 1
        val = 5059007
#29 0x00000000004d31a6 in Frecursive_edit () at keyboard.c:1018
        count = 0
        buffer = 10762242
#30 0x00000000004d169a in main (argc=3, argv=0x7f7fffffdb70) at emacs.c:1833
        dummy = 140187730444288
        stack_bottom_variable = 0 '\0'
        do_initial_setlocale = 1
        skip_args = 0
        rlim = {
  rlim_cur = 8720384, 
  rlim_max = 33554432
}
        no_loadup = 0
        junk = 0x0
        dname_arg = 0x0

Lisp Backtrace:
"eval-last-sexp-1" (0xffffca28)
"eval-last-sexp" (0xffffcfa8)
"call-interactively" (0xffffd3b8)


-- 
Kazuhiro Ito





  reply	other threads:[~2011-08-21  0:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-18  9:01 bug#9318: 23.3.50; The first call of encode-coding-region() returns wrong result on on Windows Kazuhiro Ito
2011-08-18  9:48 ` Andreas Schwab
2011-08-18 21:33   ` Kazuhiro Ito
2011-08-19 13:46 ` bug#9318: 23.3.50; The first call of encode-coding-region() returns wrong result Kazuhiro Ito
2011-08-20 21:26   ` Chong Yidong
2011-08-21  0:17     ` Kazuhiro Ito [this message]
2011-08-24  9:37       ` Kazuhiro Ito
2011-08-24 12:06         ` Eli Zaretskii
2011-08-25  9:49           ` Kazuhiro Ito
2011-08-24 17:59         ` Andreas Schwab
2011-08-25  9:54           ` Kazuhiro Ito
2011-08-26 11:41             ` Kazuhiro Ito
2011-08-28  0:04               ` Kazuhiro Ito
2011-08-30 23:30                 ` Kazuhiro Ito
2011-12-01  1:56                   ` Kenichi Handa
2011-12-05  7:10                     ` Kenichi Handa
2011-12-05 11:31                       ` Kazuhiro Ito
2011-12-05  9:11 ` Paul Eggert
2011-12-06  0:30   ` Kenichi Handa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110821001726.D29052C037@msa104.auone-net.jp \
    --to=kzhr@d1.dion.ne.jp \
    --cc=9318@debbugs.gnu.org \
    --cc=cyd@stupidchicken.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).