Subject: Re: Segfault under cygwin 1.7.62
From: Vin Shelton <[email-masked]>
To: "Stephen J. Turnbull" <[email-masked]>
Cc: The Cygwin Mailing List <[email-masked]>, XEmacs developers <[email-masked]>
Date: Thu, 8 Oct 2009 11:43:22 -0400
List-Id: <cygwin.cygwin.com>

On Thu, Oct 8, 2009 at 5:13 AM, Stephen J. Turnbull <[email-masked]> wrote:
> Vin Shelton writes:
>
>  > XEmacs people - here is the line of code implicated in the crash:
>  >
>  >                switch (XCHARSET_REP_BYTES (charset))
>
> Can you do a pobj on charset in the debugger and find out what it
> actually is?

sputter... you expect me to do actual work on this!  :-)  Thanks for
the nudge, Stephen.  :-)

Here's what I found.  charset is, as we suspected, bogus:

Fatal error: assertion failed, file
/usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/unicode.c, line
2358, RECORD_TYPEP (obj, lrecord_type_charset)

Program received signal SIGSEGV, Segmentation fault.
assert_failed (
    file=0xa1c65b
"/usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/unicode.c",
    line=2358, expr=0xa1c795 "RECORD_TYPEP (obj, lrecord_type_charset)")
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/emacs.c:4036
4036      * ((int *) 0) = 666;
(gdb) pobj charset
Cannot access memory at address 0x4

and here's the stack backtrace.

(gdb) bt
#0  assert_failed (
    file=0xa1c65b
"/usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/unicode.c",
    line=2358, expr=0xa1c795 "RECORD_TYPEP (obj, lrecord_type_charset)")
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/emacs.c:4036
#1  0x005f05de in unicode_convert (str=0x176ea48,
    src=0x148d0e3
"ï\202\201Ð\201Ð\201Ð\201ï\203\22002ABFxi-string)g)Àâw\001\200ÑH\001Â\200\t",
dst=0x14e8b60, n=17)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/charset.h:247
#2  0x00495f18 in coding_writer (stream=0x176ea00,
    data=0x148d0c0
"c;C:\\cygwin\\cygwin\\tmp\\s360339.aoa\\ï\202\201Ð\201Ð\201Ð\201ï\203\22002ABFxi-string)g)Àâw\001\200ÑH\001Â\200\t",
size=53)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/file-coding.c:1926
#3  0x005151bc in Lstream_really_write (lstr=0x176ea00,
    data=0x148d0c0
"c;C:\\cygwin\\cygwin\\tmp\\s360339.aoa\\ï\202\201Ð\201Ð\201Ð\201ï\203\22002ABFxi-string)g)Àâw\001\200ÑH\001Â\200\t",
size=53)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/lstream.c:380
#4  0x00515295 in Lstream_flush_out (lstr=0x176ea00)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/lstream.c:419
#5  0x00515547 in Lstream_flush (lstr=0x176ea00)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/lstream.c:443
#6  0x00515588 in Lstream_close (lstr=0x176ea00)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/lstream.c:799
#7  0x005dc847 in dfc_convert_to_external_format (source_type=DFC_TYPE_DATA,
    source=0x21e410, coding_system=8781988, sink_type=DFC_TYPE_DATA,
sink=0x21e408)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/text.c:4223
#8  0x0056cd68 in readlink_or_correct_case (name=<value optimized out>,
    buf=0x21e464
"/tmp/s360339.aoa/\201ï\217£\217°\201ï\217£\217°\201ï\217£\217°\201ï\217£\217°02ABFx",
size=16383, links_only=0)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/realpath.c:176
#9  0x0056d4d7 in qxe_realpath (path=0x22248c "",
    resolved_path=0x22651c
"c:/cygwin/tmp/s360339.aoa/\201Ð\201Ð\201Ð\201Ð02ABFx",
    links_only=0) at
/usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/realpath.c:348
#10 0x004a7752 in Ffile_truename (filename=23126500, default_=6708400)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/fileio.c:1404
#11 0x0045e379 in Feval (form=22025348)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3747
#12 0x0045e253 in Feval (form=22025456)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3734
#13 0x00460933 in For (args=26558792)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:846
#14 0x0045e1f9 in Feval (form=26558756)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3718
#15 0x0045f0ba in Fprogn (args=26558816)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:1002
---Type <return> to continue, or q <return> to quit---
#16 0x0045e1f9 in Feval (form=26558840)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3718
#17 0x0045e7d9 in Feval (form=26561716)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3832
#18 0x0045f0ba in Fprogn (args=26561848)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:1002
#19 0x0045e1f9 in Feval (form=26561812)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3718
#20 0x0045b363 in condition_case_1 (handlers=26558636, bfun=0x45dce2 <Feval>,
    barg=26561812, hfun=0x461c28 <run_condition_case_handlers>, harg=23252292)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:2014
#21 0x004610f9 in condition_case_3 (bodyform=26561812, var=23252292,
handlers=26558636)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:2096
#22 0x004611e0 in Fcondition_case (args=26558648)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:2155
#23 0x0045e1f9 in Feval (form=26558612)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3718
#24 0x0045e7d9 in Feval (form=22025360)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3832
#25 0x0045f0ba in Fprogn (args=26574400)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:1002
#26 0x0045e1f9 in Feval (form=26574364)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3718
#27 0x0045e1f9 in Feval (form=26574448)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3718
#28 0x0045e7d9 in Feval (form=22024760)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3832
#29 0x0045f0ba in Fprogn (args=22029972)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:1002
#30 0x00461780 in FletX (args=22028760)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:1109
#31 0x0045e1f9 in Feval (form=22030700)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3718
#32 0x0045f0ba in Fprogn (args=22708804)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:1002
#33 0x0045e1f9 in Feval (form=22708816)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3718
#34 0x0045e1f9 in Feval (form=22708876)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3718
#35 0x0045e7d9 in Feval (form=22215848)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3832
#36 0x0045f0ba in Fprogn (args=21821696)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:1002
#37 0x0045f27f in funcall_lambda (fun=21822008, nargs=0, args=0x22b7e4)
---Type <return> to continue, or q <return> to quit---
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:4364
#38 0x0045f6c3 in Ffuncall (nargs=1, args=0x22b7e0)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:4056
#39 0x0045e542 in Feval (form=23311312)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3774
#40 0x0045b363 in condition_case_1 (handlers=23306940, bfun=0x45dce2 <Feval>,
    barg=23311312, hfun=0x461c28 <run_condition_case_handlers>, harg=23252292)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:2014
#41 0x004610f9 in condition_case_3 (bodyform=23311312, var=23252292,
handlers=23306940)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:2096
#42 0x004611e0 in Fcondition_case (args=23311264)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:2155
#43 0x0045e1f9 in Feval (form=23311228)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3718
#44 0x0045f0ba in Fprogn (args=24174704)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:1002
#45 0x0056153f in Fwith_output_to_temp_buffer (args=24192600)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/print.c:833
#46 0x0045e1f9 in Feval (form=24192984)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3718
#47 0x0045f0ba in Fprogn (args=23286628)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:1002
#48 0x00461563 in Flet (args=24192636)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:1180
#49 0x0045e1f9 in Feval (form=24211200)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3718
#50 0x0045f0ba in Fprogn (args=24211032)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:1002
#51 0x0045f27f in funcall_lambda (fun=23286712, nargs=2, args=0x22bf70)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:4364
#52 0x0045e981 in Feval (form=24238052)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3859
#53 0x0045f0ba in Fprogn (args=24238040)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:1002
#54 0x00461563 in Flet (args=24323552)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:1180
#55 0x0045e1f9 in Feval (form=24261668)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3718
#56 0x0045f0ba in Fprogn (args=24291872)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:1002
#57 0x0045f27f in funcall_lambda (fun=24237968, nargs=1, args=0x22c3b4)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:4364
#58 0x0045f6c3 in Ffuncall (nargs=2, args=0x22c3b0)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:4056
---Type <return> to continue, or q <return> to quit---
#59 0x0045dabd in Fapply (nargs=2, args=0x22c3b0)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:4256
#60 0x0045dcd1 in apply1 (fn=24237968, arg=22440000)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:5233
#61 0x0041d00c in Fcall_interactively (function=24540868, record_flag=6707608,
    keys=6708400) at
/usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/callint.c:461
#62 0x00461b86 in Fcommand_execute (cmd=24540868, record_flag=6707608,
keys=6708400)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3209
#63 0x0045f522 in Ffuncall (nargs=3, args=0x22c584)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:4001
#64 0x0041a6b5 in execute_optimized_program (
    program=0x1753210
"\r\035Æ\rÇa«\004Èª$\rÉk«\004Êª\034\r¨«\aËÌ\r\"ª\022\r:«\r\r@¨«\bËÌ\r@\"ª\002Í!\024)\t«Kt«HÎ\f!\f\032\033Ï\fÐ\"\210\v8\b¬\023Ñ
Ò a«\aÓ pa«\006Ô \210ª\004Õ
\210Ö×!\033ØÙË\vA«\004Úª\002Û\nÜ\v!#\"\210Ö\016\036!\210ÝÙ!*\207Ï\fÐ\"\207",
    stack_depth=7, constants_data=0x7ff704)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/bytecode.c:898
#65 0x0045cdd2 in funcall_compiled_function (fun=8621900, nargs=1,
args=0x22c704)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3588
#66 0x0045f685 in Ffuncall (nargs=2, args=0x22c700)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:4046
#67 0x0041ddd2 in Fcall_interactively (function=6564064, record_flag=6708400,
    keys=6708400) at
/usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/callint.c:996
#68 0x00461b86 in Fcommand_execute (cmd=6564064, record_flag=6708400,
keys=6708400)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:3209
#69 0x00470090 in execute_command_event (command_builder=0x1773dc0,
event=24939732)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/event-stream.c:4288
#70 0x0047388b in Fdispatch_event (event=24939732)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/event-stream.c:4640
#71 0x0042906f in Fcommand_loop_1 ()
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/cmdloop.c:600
#72 0x004290c2 in command_loop_1 (unused_dummy=6708400)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/cmdloop.c:505
#73 0x0045b363 in condition_case_1 (handlers=6702880, bfun=0x429086
<command_loop_1>,
    barg=6708400, hfun=0x429256 <cmd_error>, harg=6708400)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:2014
#74 0x0042921d in command_loop_2 (unused_dummy=6708400)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/cmdloop.c:262
#75 0x0045a5db in internal_catch (tag=6430456, func=0x4291dd <command_loop_2>,
    arg=6708400, threw=0x0, thrown_tag=0x0, backtrace_before_throw=0x0)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/eval.c:1602
#76 0x0042945c in initial_command_loop (load_me=6708400)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/cmdloop.c:313
#77 0x00456b22 in xemacs_21_5_b29_i686_pc_cygwin (argc=2, argv=0x148db40,
    unused_envp=0x0, restart=0)
---Type <return> to continue, or q <return> to quit---
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/emacs.c:2717
#78 0x00456be2 in main (argc=2, argv=0x148db40, unused_envp=0x0)
    at /usr/local/src/xemacs-21.5-test-2009-10-07-mule/src/emacs.c:3226

I'm afraid that my knowledge of the unicode world is at best zero, so
I will probably need more guidance to unearth more useful information.

  - Vin

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple