unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#52295: 28.0.90; Killing text results in coding system complaint
       [not found] <875ys3sgfv.fsf.ref@yahoo.com>
@ 2021-12-05  6:40 ` luangruo--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-12-05  8:45   ` Eli Zaretskii
  0 siblings, 1 reply; 25+ messages in thread
From: luangruo--- via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-12-05  6:40 UTC (permalink / raw)
  To: 52295

Trying to kill text on MS-Windows 9x results in the following complaint:

w32--set-selection: Coding system is invalid or doesn't have an eol
variant for dos line ends: nil [2 times]

In GNU Emacs 28.0.90 (build 1, i686-pc-mingw32) of 2021-12-05 built on MACHINE

Windowing system distributor ‘Microsoft Corp.', version 4.10.2222
System Description: Microsoft Windows 98 (v4.10.2222)
Configured using:

‘configure --with-gnutls=ifavailable --prefix=/emacs-28.0.90/../prefix'
Configured features:
ACL MODULES NOTIFY W32NOTIFY PDUMPER SOUND THREADS TOOLKIT SCROLL_BARS
Important settings:

value of $LANG: enu

locale-coding-system: cp1252
Major mode: Fundamental





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-05  6:40 ` bug#52295: 28.0.90; Killing text results in coding system complaint luangruo--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-12-05  8:45   ` Eli Zaretskii
  2021-12-05  8:58     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 25+ messages in thread
From: Eli Zaretskii @ 2021-12-05  8:45 UTC (permalink / raw)
  To: luangruo; +Cc: 52295

> Date: Sun, 05 Dec 2021 14:40:04 +0800
> From: luangruo--- via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> Trying to kill text on MS-Windows 9x results in the following complaint:
> 
> w32--set-selection: Coding system is invalid or doesn't have an eol
> variant for dos line ends: nil [2 times]

What are the values of the following variables on that system?

  selection-coding-system
  next-selection-coding-system





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-05  8:45   ` Eli Zaretskii
@ 2021-12-05  8:58     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-12-05  9:12       ` Eli Zaretskii
  0 siblings, 1 reply; 25+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-12-05  8:58 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 52295

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Sun, 05 Dec 2021 14:40:04 +0800
>> From: luangruo--- via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>> 
>> Trying to kill text on MS-Windows 9x results in the following complaint:
>> 
>> w32--set-selection: Coding system is invalid or doesn't have an eol
>> variant for dos line ends: nil [2 times]
>
> What are the values of the following variables on that system?
>
>   selection-coding-system
>   next-selection-coding-system

Both variables are nil.

Thanks.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-05  8:58     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-12-05  9:12       ` Eli Zaretskii
  2021-12-05  9:26         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 25+ messages in thread
From: Eli Zaretskii @ 2021-12-05  9:12 UTC (permalink / raw)
  To: Po Lu; +Cc: 52295

> From: Po Lu <luangruo@yahoo.com>
> Cc: 52295@debbugs.gnu.org
> Date: Sun, 05 Dec 2021 16:58:27 +0800
> 
> >> w32--set-selection: Coding system is invalid or doesn't have an eol
> >> variant for dos line ends: nil [2 times]
> >
> > What are the values of the following variables on that system?
> >
> >   selection-coding-system
> >   next-selection-coding-system
> 
> Both variables are nil.

That's the problem.  But I don't understand why is that so.  The value
of selection-coding-system is set in globals_of_w32select, which is
called during startup, and where we have this code:

  ANSICP = GetACP ();
  OEMCP = GetOEMCP ();

  QANSICP = coding_from_cp (ANSICP);
  QOEMCP = coding_from_cp (OEMCP);

  if (os_subtype == OS_SUBTYPE_NT)
    Vselection_coding_system = Qutf_16le_dos;
  else if (inhibit_window_system)
    Vselection_coding_system = QOEMCP;
  else
    Vselection_coding_system = QANSICP;

On Windows 9X, this should assign the ANSI codepage to
selection-coding-system.  Since your codepage seems to be 1252, it
should assign the symbol 'cp1252-dos' to selection-coding-system, see
coding_from_cp.

Why doesn't this happen in your case?





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-05  9:12       ` Eli Zaretskii
@ 2021-12-05  9:26         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-12-06 12:33           ` Eli Zaretskii
  0 siblings, 1 reply; 25+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-12-05  9:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 52295

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Po Lu <luangruo@yahoo.com>
>> Cc: 52295@debbugs.gnu.org
>> Date: Sun, 05 Dec 2021 16:58:27 +0800
>> 
>> >> w32--set-selection: Coding system is invalid or doesn't have an eol
>> >> variant for dos line ends: nil [2 times]
>> >
>> > What are the values of the following variables on that system?
>> >
>> >   selection-coding-system
>> >   next-selection-coding-system
>> 
>> Both variables are nil.
>
> That's the problem.  But I don't understand why is that so.  The value
> of selection-coding-system is set in globals_of_w32select, which is
> called during startup, and where we have this code:
>
>   ANSICP = GetACP ();
>   OEMCP = GetOEMCP ();
>
>   QANSICP = coding_from_cp (ANSICP);
>   QOEMCP = coding_from_cp (OEMCP);
>
>   if (os_subtype == OS_SUBTYPE_NT)
>     Vselection_coding_system = Qutf_16le_dos;
>   else if (inhibit_window_system)
>     Vselection_coding_system = QOEMCP;
>   else
>     Vselection_coding_system = QANSICP;
>
> On Windows 9X, this should assign the ANSI codepage to
> selection-coding-system.  Since your codepage seems to be 1252, it
> should assign the symbol 'cp1252-dos' to selection-coding-system, see
> coding_from_cp.
>
> Why doesn't this happen in your case?

Maybe that variable is dumped during the build process, with a value
appropriate for NT, and when Emacs starts on a 9X system some other code
sees that it is invalid and sets it to nil?





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-05  9:26         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-12-06 12:33           ` Eli Zaretskii
  2021-12-07  3:42             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 25+ messages in thread
From: Eli Zaretskii @ 2021-12-06 12:33 UTC (permalink / raw)
  To: Po Lu; +Cc: 52295

> From: Po Lu <luangruo@yahoo.com>
> Cc: 52295@debbugs.gnu.org
> Date: Sun, 05 Dec 2021 17:26:11 +0800
> 
> >> >   selection-coding-system
> >> >   next-selection-coding-system
> >> 
> >> Both variables are nil.
> >
> > That's the problem.  But I don't understand why is that so.  The value
> > of selection-coding-system is set in globals_of_w32select, which is
> > called during startup, and where we have this code:
> >
> >   ANSICP = GetACP ();
> >   OEMCP = GetOEMCP ();
> >
> >   QANSICP = coding_from_cp (ANSICP);
> >   QOEMCP = coding_from_cp (OEMCP);
> >
> >   if (os_subtype == OS_SUBTYPE_NT)
> >     Vselection_coding_system = Qutf_16le_dos;
> >   else if (inhibit_window_system)
> >     Vselection_coding_system = QOEMCP;
> >   else
> >     Vselection_coding_system = QANSICP;
> >
> > On Windows 9X, this should assign the ANSI codepage to
> > selection-coding-system.  Since your codepage seems to be 1252, it
> > should assign the symbol 'cp1252-dos' to selection-coding-system, see
> > coding_from_cp.
> >
> > Why doesn't this happen in your case?
> 
> Maybe that variable is dumped during the build process, with a value
> appropriate for NT, and when Emacs starts on a 9X system some other code
> sees that it is invalid and sets it to nil?

No, the code above is run in the dumped Emacs, when it starts, not in
temacs.  So the values should reflect what happens when you start
Emacs on the Windows 9X system.

Could you perhaps add some printf's there to see what actually
happens?  It almost looks like that code doesn't get called (which
would be strange by itself), since coding_from_cp cannot possibly
return nil.  Or maybe the initial assignment does work, but then some
code resets the variable back to nil?





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-06 12:33           ` Eli Zaretskii
@ 2021-12-07  3:42             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-12-07  5:51               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 25+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-12-07  3:42 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 52295

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Po Lu <luangruo@yahoo.com>
>> Cc: 52295@debbugs.gnu.org
>> Date: Sun, 05 Dec 2021 17:26:11 +0800
>> 
>> >> >   selection-coding-system
>> >> >   next-selection-coding-system
>> >> 
>> >> Both variables are nil.
>> >
>> > That's the problem.  But I don't understand why is that so.  The value
>> > of selection-coding-system is set in globals_of_w32select, which is
>> > called during startup, and where we have this code:
>> >
>> >   ANSICP = GetACP ();
>> >   OEMCP = GetOEMCP ();
>> >
>> >   QANSICP = coding_from_cp (ANSICP);
>> >   QOEMCP = coding_from_cp (OEMCP);
>> >
>> >   if (os_subtype == OS_SUBTYPE_NT)
>> >     Vselection_coding_system = Qutf_16le_dos;
>> >   else if (inhibit_window_system)
>> >     Vselection_coding_system = QOEMCP;
>> >   else
>> >     Vselection_coding_system = QANSICP;
>> >
>> > On Windows 9X, this should assign the ANSI codepage to
>> > selection-coding-system.  Since your codepage seems to be 1252, it
>> > should assign the symbol 'cp1252-dos' to selection-coding-system, see
>> > coding_from_cp.
>> >
>> > Why doesn't this happen in your case?
>> 
>> Maybe that variable is dumped during the build process, with a value
>> appropriate for NT, and when Emacs starts on a 9X system some other code
>> sees that it is invalid and sets it to nil?
>
> No, the code above is run in the dumped Emacs, when it starts, not in
> temacs.  So the values should reflect what happens when you start
> Emacs on the Windows 9X system.

> Could you perhaps add some printf's there to see what actually
> happens?  It almost looks like that code doesn't get called (which
> would be strange by itself), since coding_from_cp cannot possibly
> return nil.  Or maybe the initial assignment does work, but then some
> code resets the variable back to nil?

`globals_of_w32select' is called, but QANSICP is nil:

  Fprint (QANSICP, Qexternal_debugging_output);

Prints "nil" onto the console.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-07  3:42             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-12-07  5:51               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-12-07  7:33                 ` Eli Zaretskii
  2021-12-07 14:05                 ` Eli Zaretskii
  0 siblings, 2 replies; 25+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-12-07  5:51 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 52295

Po Lu <luangruo@yahoo.com> writes:

> `globals_of_w32select' is called, but QANSICP is nil:
>
>   Fprint (QANSICP, Qexternal_debugging_output);
>
> Prints "nil" onto the console.

??? It appears that coding_from_cp is actually returning nil in this
case.

This must be a bug in intern, because I don't see how else it could
possibly return nil.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-07  5:51               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-12-07  7:33                 ` Eli Zaretskii
  2021-12-07  9:20                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-12-07 14:05                 ` Eli Zaretskii
  1 sibling, 1 reply; 25+ messages in thread
From: Eli Zaretskii @ 2021-12-07  7:33 UTC (permalink / raw)
  To: Po Lu; +Cc: 52295

On December 7, 2021 7:51:32 AM GMT+02:00, Po Lu <luangruo@yahoo.com> wrote:
> Po Lu <luangruo@yahoo.com> writes:
> 
> > `globals_of_w32select' is called, but QANSICP is nil:
> >
> >   Fprint (QANSICP, Qexternal_debugging_output);
> >
> > Prints "nil" onto the console.
> 
> ??? It appears that coding_from_cp is actually returning nil in this
> case.
> 
> This must be a bug in intern, because I don't see how else it could
> possibly return nil.
> 

Maybe 'intern' signals an error?  There's a check_obarray test inside intern_1, which could signal an error.

If you print the value which 'intern' returns in coding_from_cp, do you see a nil value printed?





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-07  7:33                 ` Eli Zaretskii
@ 2021-12-07  9:20                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-12-07 10:07                     ` Eli Zaretskii
  0 siblings, 1 reply; 25+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-12-07  9:20 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 52295

Eli Zaretskii <eliz@gnu.org> writes:

> Maybe 'intern' signals an error?  There's a check_obarray test inside
> intern_1, which could signal an error.

No error is signalled:

> If you print the value which 'intern' returns in coding_from_cp, do
> you see a nil value printed?

`nil' is printed in this case.

Thanks.

(I will not have access to that machine for a while, so I can't perform
any further testing on it for the next week or so.)





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-07  9:20                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-12-07 10:07                     ` Eli Zaretskii
  2021-12-07 10:33                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 25+ messages in thread
From: Eli Zaretskii @ 2021-12-07 10:07 UTC (permalink / raw)
  To: Po Lu; +Cc: 52295

On December 7, 2021 11:20:10 AM GMT+02:00, Po Lu <luangruo@yahoo.com> wrote:
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Maybe 'intern' signals an error?  There's a check_obarray test inside
> > intern_1, which could signal an error.
> 
> No error is signalled:
> 
> > If you print the value which 'intern' returns in coding_from_cp, do
> > you see a nil value printed?
> 
> `nil' is printed in this case.
> 
> Thanks.
> 
> (I will not have access to that machine for a while, so I can't perform
> any further testing on it for the next week or so.)
> 

So I think there's no way around stepping into intern_1 and the functions it calls, and figuring out what happens there.  I thought you said GDB doesn't work on the target?  Then perhaps printfs will help?

Thanks.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-07 10:07                     ` Eli Zaretskii
@ 2021-12-07 10:33                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-12-07 10:50                         ` Eli Zaretskii
  0 siblings, 1 reply; 25+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-12-07 10:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 52295

Eli Zaretskii <eliz@gnu.org> writes:

> On December 7, 2021 11:20:10 AM GMT+02:00, Po Lu <luangruo@yahoo.com> wrote:
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > Maybe 'intern' signals an error?  There's a check_obarray test inside
>> > intern_1, which could signal an error.
>> 
>> No error is signalled:
>> 
>> > If you print the value which 'intern' returns in coding_from_cp, do
>> > you see a nil value printed?
>> 
>> `nil' is printed in this case.
>> 
>> Thanks.
>> 
>> (I will not have access to that machine for a while, so I can't perform
>> any further testing on it for the next week or so.)
>> 

> So I think there's no way around stepping into intern_1 and the
> functions it calls, and figuring out what happens there.  I thought
> you said GDB doesn't work on the target?  Then perhaps printfs will
> help?

Yes, GDB doesn't work there, but I modified coding_from_cp to look like
this:

static Lisp_Object
coding_from_cp (UINT codepage)
{
  char buffer[30];
  Lisp_Object sym;
  sprintf (buffer, "cp%d-dos", (int) codepage);
  sym = intern (buffer);
  Fprint (sym, Qexternal_debugging_output);
  return sym;
}

And it printed nil.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-07 10:33                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-12-07 10:50                         ` Eli Zaretskii
  0 siblings, 0 replies; 25+ messages in thread
From: Eli Zaretskii @ 2021-12-07 10:50 UTC (permalink / raw)
  To: Po Lu; +Cc: 52295

On December 7, 2021 12:33:26 PM GMT+02:00, Po Lu <luangruo@yahoo.com> wrote:
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > So I think there's no way around stepping into intern_1 and the
> > functions it calls, and figuring out what happens there.  I thought
> > you said GDB doesn't work on the target?  Then perhaps printfs will
> > help?
> 
> Yes, GDB doesn't work there, but I modified coding_from_cp to look like
> this:
> 
> static Lisp_Object
> coding_from_cp (UINT codepage)
> {
>   char buffer[30];
>   Lisp_Object sym;
>   sprintf (buffer, "cp%d-dos", (int) codepage);
>   sym = intern (buffer);
>   Fprint (sym, Qexternal_debugging_output);
>   return sym;
> }
> 
> And it printed nil.
> 

Yes.  But I meant you should go deeper, into 'intern' and its subroutines, starting from intern_1.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-07  5:51               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-12-07  7:33                 ` Eli Zaretskii
@ 2021-12-07 14:05                 ` Eli Zaretskii
  2021-12-12 10:58                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 25+ messages in thread
From: Eli Zaretskii @ 2021-12-07 14:05 UTC (permalink / raw)
  To: Po Lu; +Cc: 52295

> From: Po Lu <luangruo@yahoo.com>
> Cc: 52295@debbugs.gnu.org
> Date: Tue, 07 Dec 2021 13:51:32 +0800
> 
> Po Lu <luangruo@yahoo.com> writes:
> 
> > `globals_of_w32select' is called, but QANSICP is nil:
> >
> >   Fprint (QANSICP, Qexternal_debugging_output);
> >
> > Prints "nil" onto the console.
> 
> ??? It appears that coding_from_cp is actually returning nil in this
> case.
> 
> This must be a bug in intern, because I don't see how else it could
> possibly return nil.

It could also be some memory-related snafu, or some stupid omission
during startup when we run on Windows 9X.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-07 14:05                 ` Eli Zaretskii
@ 2021-12-12 10:58                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-12-12 11:22                     ` Eli Zaretskii
  2021-12-18  0:29                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 25+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-12-12 10:58 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 52295

Eli Zaretskii <eliz@gnu.org> writes:

>> ??? It appears that coding_from_cp is actually returning nil in this
>> case.
>> 
>> This must be a bug in intern, because I don't see how else it could
>> possibly return nil.

> It could also be some memory-related snafu, or some stupid omission
> during startup when we run on Windows 9X.

FWIW, the problem doesn't appear with an unexec build (though I did have
to fix the build process somewhat to get unexec to work on the build
system running MSYS).

I will build a pdumper build with all the usual debug options and see
what comes up.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-12 10:58                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-12-12 11:22                     ` Eli Zaretskii
  2021-12-12 12:47                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-12-18  0:29                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 25+ messages in thread
From: Eli Zaretskii @ 2021-12-12 11:22 UTC (permalink / raw)
  To: Po Lu; +Cc: 52295

> From: Po Lu <luangruo@yahoo.com>
> Cc: 52295@debbugs.gnu.org
> Date: Sun, 12 Dec 2021 18:58:22 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> ??? It appears that coding_from_cp is actually returning nil in this
> >> case.
> >> 
> >> This must be a bug in intern, because I don't see how else it could
> >> possibly return nil.
> 
> > It could also be some memory-related snafu, or some stupid omission
> > during startup when we run on Windows 9X.
> 
> FWIW, the problem doesn't appear with an unexec build

So I guess some code we need to run at startup doesn't get run in the
pdumper build.

> (though I did have to fix the build process somewhat to get unexec
> to work on the build system running MSYS).

Please tell the details, we should fix that.

> I will build a pdumper build with all the usual debug options and see
> what comes up.

Thanks.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-12 11:22                     ` Eli Zaretskii
@ 2021-12-12 12:47                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-12-12 13:31                         ` Eli Zaretskii
  0 siblings, 1 reply; 25+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-12-12 12:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 52295

Eli Zaretskii <eliz@gnu.org> writes:

> Please tell the details, we should fix that.

I had to remove `-Wl,-disable-dynamicbase' from LD_SWITCH_SYSTEM_TEMACS,
because the linker complained that option did not exist.






^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-12 12:47                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-12-12 13:31                         ` Eli Zaretskii
  2021-12-13  0:50                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 25+ messages in thread
From: Eli Zaretskii @ 2021-12-12 13:31 UTC (permalink / raw)
  To: Po Lu; +Cc: 52295

> From: Po Lu <luangruo@yahoo.com>
> Cc: 52295@debbugs.gnu.org
> Date: Sun, 12 Dec 2021 20:47:37 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Please tell the details, we should fix that.
> 
> I had to remove `-Wl,-disable-dynamicbase' from LD_SWITCH_SYSTEM_TEMACS,
> because the linker complained that option did not exist.

What version of Binutils do you have there, and where did you download
it?





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-12 13:31                         ` Eli Zaretskii
@ 2021-12-13  0:50                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-12-13  3:23                             ` Eli Zaretskii
  0 siblings, 1 reply; 25+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-12-13  0:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 52295

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Po Lu <luangruo@yahoo.com>
>> Cc: 52295@debbugs.gnu.org
>> Date: Sun, 12 Dec 2021 20:47:37 +0800
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > Please tell the details, we should fix that.
>> 
>> I had to remove `-Wl,-disable-dynamicbase' from LD_SWITCH_SYSTEM_TEMACS,
>> because the linker complained that option did not exist.
>
> What version of Binutils do you have there, and where did you download
> it?

It's binutils 2.32, which I downloaded from the MingGW Installation
Manager.

Thanks.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-13  0:50                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-12-13  3:23                             ` Eli Zaretskii
  0 siblings, 0 replies; 25+ messages in thread
From: Eli Zaretskii @ 2021-12-13  3:23 UTC (permalink / raw)
  To: Po Lu; +Cc: 52295

> From: Po Lu <luangruo@yahoo.com>
> Cc: 52295@debbugs.gnu.org
> Date: Mon, 13 Dec 2021 08:50:02 +0800
> 
> >> I had to remove `-Wl,-disable-dynamicbase' from LD_SWITCH_SYSTEM_TEMACS,
> >> because the linker complained that option did not exist.
> >
> > What version of Binutils do you have there, and where did you download
> > it?
> 
> It's binutils 2.32, which I downloaded from the MingGW Installation
> Manager.

Ah, okay.  This is an old version, so it doesn't support those
switches.  (You may wish to get a newer version from ezwinports.)  So
I think it is okay for such an old version to require manual changes.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-12 10:58                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-12-12 11:22                     ` Eli Zaretskii
@ 2021-12-18  0:29                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-12-18  6:48                       ` Eli Zaretskii
  1 sibling, 1 reply; 25+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-12-18  0:29 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 52295

Po Lu <luangruo@yahoo.com> writes:

> I will build a pdumper build with all the usual debug options and see
> what comes up.

An unoptimized pdumper build with CFLAGS='-O0'
--enable-checking="yes,glyphs" crashes when a dump file is present, so
there is definitely more here than meets the eye, but I have no idea how
to get a working debugger onto that Windows 9x system.

Is there some way to save a core dump (or backtrace) there for debugging
on a more recent MS-Windows machine?

Thanks.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-18  0:29                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-12-18  6:48                       ` Eli Zaretskii
  2021-12-18 18:30                         ` Eli Zaretskii
  2021-12-27  9:09                         ` bug#52295: windows 98: " Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 25+ messages in thread
From: Eli Zaretskii @ 2021-12-18  6:48 UTC (permalink / raw)
  To: Po Lu; +Cc: 52295

> From: Po Lu <luangruo@yahoo.com>
> Cc: 52295@debbugs.gnu.org
> Date: Sat, 18 Dec 2021 08:29:21 +0800
> 
> Po Lu <luangruo@yahoo.com> writes:
> 
> > I will build a pdumper build with all the usual debug options and see
> > what comes up.
> 
> An unoptimized pdumper build with CFLAGS='-O0'
> --enable-checking="yes,glyphs" crashes when a dump file is present, so
> there is definitely more here than meets the eye, but I have no idea how
> to get a working debugger onto that Windows 9x system.
> 
> Is there some way to save a core dump (or backtrace) there for debugging
> on a more recent MS-Windows machine?

Is this a real crash (segfault), or an abort where we pop up the Emacs
Abort dialog?  Since you compiled with --enable-checking, I think it's
the latter.

If it's a real crash, you could use the Windows Event log to find out
the address where it crashes, and then use GDB on another system to
see where that address is in the sources (but the address printed by
Windows needs to be "translated" into addresses that you submit to GDB
by adding some constant, AFAIR).

The other alternative is to insert many fprintf's to stderr into the
sources, and use that to determine where it crashes.

If it's an abort, then saying NO to the dialog will produce an
emacs_backtrace.txt file with addresses of the backtrace, which you
could take to another Windows system and use addr2line (from Binutils)
to recover the file names, function names, and line numbers that
correspond to the addresses; see the node "Crashing" in the Emacs
manual for how to do that.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-18  6:48                       ` Eli Zaretskii
@ 2021-12-18 18:30                         ` Eli Zaretskii
  2021-12-19  0:56                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-12-27  9:09                         ` bug#52295: windows 98: " Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 25+ messages in thread
From: Eli Zaretskii @ 2021-12-18 18:30 UTC (permalink / raw)
  To: luangruo; +Cc: 52295

> Date: Sat, 18 Dec 2021 08:48:07 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 52295@debbugs.gnu.org
> 
> If it's a real crash, you could use the Windows Event log to find out
> the address where it crashes, and then use GDB on another system to
> see where that address is in the sources (but the address printed by
> Windows needs to be "translated" into addresses that you submit to GDB
> by adding some constant, AFAIR).
> 
> The other alternative is to insert many fprintf's to stderr into the
> sources, and use that to determine where it crashes.
> 
> If it's an abort, then saying NO to the dialog will produce an
> emacs_backtrace.txt file with addresses of the backtrace, which you
> could take to another Windows system and use addr2line (from Binutils)
> to recover the file names, function names, and line numbers that
> correspond to the addresses; see the node "Crashing" in the Emacs
> manual for how to do that.

Btw, there's one more alternative: to debug Emacs on Windows 9X
remotely, via gdbserver.  Did you try that?  The advantage is that
gdbserver is a much smaller and simpler program, so chances are it
will be able to run on Windows 9X.  GDB itself will run on a different
system (could even be GNU/Linux, if you have GDB that was built to
support debugging Windows PE executables), where all the problems of
running a modern GDB don't exist.  You just need the target system to
be connected to a network, so that GDB and gdbserver could
communicate.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: 28.0.90; Killing text results in coding system complaint
  2021-12-18 18:30                         ` Eli Zaretskii
@ 2021-12-19  0:56                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 25+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-12-19  0:56 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 52295

Eli Zaretskii <eliz@gnu.org> writes:

> You just need the target system to be connected to a network, so that
> GDB and gdbserver could communicate.

Thanks, I'll try that.  The difficult part here is to connect the
Windows 9x system to a network from which I can access it.





^ permalink raw reply	[flat|nested] 25+ messages in thread

* bug#52295: windows 98: Killing text results in coding system complaint
  2021-12-18  6:48                       ` Eli Zaretskii
  2021-12-18 18:30                         ` Eli Zaretskii
@ 2021-12-27  9:09                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 25+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-12-27  9:09 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 52295

Eli Zaretskii <eliz@gnu.org> writes:

> Is this a real crash (segfault), or an abort where we pop up the Emacs
> Abort dialog?  Since you compiled with --enable-checking, I think it's
> the latter.

> If it's a real crash, you could use the Windows Event log to find out
> the address where it crashes, and then use GDB on another system to
> see where that address is in the sources (but the address printed by
> Windows needs to be "translated" into addresses that you submit to GDB
> by adding some constant, AFAIR).

It's a real crash: the system pops up a dialog that says:

  This program has performed an illegal operation and will be shut down.
  If the problem persists, contact the program vendor.

Underneath, it displays the contents of the program counter: 011c62d6.

But I have no idea how to convert that address with gdb on the machine
that built the binary.  Any ideas?

gdbserver complained about missing symbols in kernel32.dll, so that
didn't work either.

> The other alternative is to insert many fprintf's to stderr into the
> sources, and use that to determine where it crashes.

I will try that, thanks.





^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2021-12-27  9:09 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <875ys3sgfv.fsf.ref@yahoo.com>
2021-12-05  6:40 ` bug#52295: 28.0.90; Killing text results in coding system complaint luangruo--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-05  8:45   ` Eli Zaretskii
2021-12-05  8:58     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-05  9:12       ` Eli Zaretskii
2021-12-05  9:26         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-06 12:33           ` Eli Zaretskii
2021-12-07  3:42             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-07  5:51               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-07  7:33                 ` Eli Zaretskii
2021-12-07  9:20                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-07 10:07                     ` Eli Zaretskii
2021-12-07 10:33                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-07 10:50                         ` Eli Zaretskii
2021-12-07 14:05                 ` Eli Zaretskii
2021-12-12 10:58                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-12 11:22                     ` Eli Zaretskii
2021-12-12 12:47                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-12 13:31                         ` Eli Zaretskii
2021-12-13  0:50                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-13  3:23                             ` Eli Zaretskii
2021-12-18  0:29                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-18  6:48                       ` Eli Zaretskii
2021-12-18 18:30                         ` Eli Zaretskii
2021-12-19  0:56                           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-27  9:09                         ` bug#52295: windows 98: " Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors

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).