Subject: Re: Segfault under cygwin 1.7.62
From: Vin Shelton <[email-masked]>
To: "Stephen J. Turnbull" <[email-masked]>
Cc: Andy Koppe <[email-masked]>, [email-masked], XEmacs developers <[email-masked]>
Date: Mon, 12 Oct 2009 15:16:00 -0400
List-Id: <cygwin.cygwin.com>

On Mon, Oct 12, 2009 at 6:46 AM, Stephen J. Turnbull <[email-masked]> wrote:
> Andy Koppe writes:
>
>  > Meanwhile, Corinna has implemented support for the latter on
>  > cygwin-cvs, so that mad filename works fine now:
>  >
>  > $ touch $'ï\202\201Ð\201Ð\201Ð\201ï\203\22002ABFxi-string)g)Àâw\001\200ÑH\001Â\200\t'
>  > $ ls
>  > ï??Ð?Ð?Ð?ï??02ABFxi-string)g)Àâw??ÑH?Â??
>  > $ ls --quoting-style=escape
>  > ï\202\201Ð\201Ð\201Ð\201ï\203\22002ABFxi-string)g)Àâw\001\200ÑH\001Â\200\t
>
> Thank you!
>
> N.B.  I think that those names appeared in Emacs string APIs.  Emacs
> strings are not NUL-terminated, so most likely the tail wasn't part of
> the actual file name.  It's pretty amazing that even the parentheses
> don't mess things up!
>
> Vin, let us know if you have further problems after upgrading to the
> next Cygwin.

The new behavior is different, but the problem is not yet fixed.
Here's what happened:

1. Rather than building cygwin1.dll from CVS, I waited until Corinna
had cut a new snapshot.  I downloaded cygwin1-20091012.dll.bz2 and
installed it.  'uname -a' reports "CYGWIN_NT-5.1 gandalf-xp
1.7.0s(0.215/5/3) 20091012 10:21:06 i686 Cygwin".

2. At the same time, I noticed that Aidan checked in some fixes for
the mule tests, so I upgraded to those.

3. I fired up a build of the new XEmacs sources, running against the
new cygwin1.dll.  When I run 'make check' against that XEmacs, I get
the now-familiar failure:

Testing /usr/local/src/xemacs-21.5-test-2009-10-12-mule/tests/automated/mule-tests.el...
FAIL: Assertion failed: (file-exists-p name2)
FAIL: Assertion failed: (equal (file-truename name2) name1)

Fatal error: assertion failed, file
/usr/local/src/xemacs-21.5-test-2009-10-12-mule/src/unicode.c, line
2358, RECORD_TYPEP (obj, lrecord_type_charset)
make[1]: *** [check] Segmentation fault (core dumped)
make[1]: Leaving directory
`/usr/local/build/xemacs-21.5-test-2009-10-12-mule/src'
make: *** [check] Error 2

4.  But when I try to run that XEmacs under gdb, I get different
results: gdb doesn't detect a segfault, and the test seems to run to
completion:

...

SUMMARY for /usr/local/build/xemacs-21.5-test-2009-10-12-mule/tests/automated/mule-tests.el:
	  682 passes
	    6 assertion failures
	    0 errors that should have been generated, but weren't
	    0 wrong-error failures
	    0 missing-message failures
	    0 other failures

but I get the following messages (read from bottom to top):

Test suite execution failed unexpectedly.
mule-tests.el:            682 of   688 tests successful ( 99%).
Test suite execution aborted.
Unexpected error (invalid-argument "Invalid (GNU Emacs) key format
(see doc of define-key)" C-f9) while executing byte-compiled code.
(New file)
(New file)
(New file)
(New file)
Loading byte-optimize...done
Loading byte-optimize...
Test suite execution aborted.
Unexpected error (structure-formation-error "Invalid prefix keys in
sequence" ?S [?S -]) while executing interpreted code.
Loading iso-with-esc...done
Loading iso-with-esc...
Loading ccl...done
Loading ccl...
(New file)
(New file)
(New file)
(New file)
Loading efs-cu...done
Loading efs-cu...
Testing /usr/local/build/xemacs-21.5-test-2009-10-12-mule/tests/automated/mule-tests.el...

Note the "Test suite execution failed unexpectedly." message.

I see similar results with a version of XEmacs built without Aidan's
changes: crash at the command line when running 'make check' but no
crash under gdb.

Do I need some additional cygwin changes other than the dll?  Corinna
- I noticed that you changed the "DEFAULT_LOCALE" in
include/cygwin/config.h (DEFAULT_LOCALE) to  "C.UTF-8". Do I need to
import that change into my compile-time environment somehow?  Or is
there an environment variable that needs to be set to alter runtime
behavior?

  - 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