all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: eller.helmut@gmail.com, gerd.moellmann@gmail.com
Cc: emacs-devel@gnu.org
Subject: Re: MPS: Forwording symbols
Date: Tue, 18 Jun 2024 20:54:54 +0300	[thread overview]
Message-ID: <86r0cup24x.fsf@gnu.org> (raw)
In-Reply-To: <86v826p346.fsf@gnu.org> (message from Eli Zaretskii on Tue, 18 Jun 2024 20:33:45 +0300)

> Date: Tue, 18 Jun 2024 20:33:45 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: gerd.moellmann@gmail.com, emacs-devel@gnu.org
> 
> > Can you access it after calling igc_postmortem?  Maybe barriers
> > work differently on Windows.
> 
> No idea if this helps, but here's what I get then:
> 
>   #0  igc_on_pdump_loaded (dump_base=dump_base@entry=0xb000008,
>       hot_start=hot_start@entry=0xb000080, hot_end=0xb585408,
>       cold_start=0xb5b0008, cold_end=cold_end@entry=0xba8b6c8,
>       cold_user_data_start=0xb7038c0, heap_end=0xb707b10) at igc.c:3769
>   3769      eassert (((struct igc_header *)cold_start)->obj_type
>   (gdb) p ((struct igc_header *)cold_start)->obj_type
>   Cannot access memory at address 0xb5b0008
>   (gdb) call igc_postmortem()
> 
>   Thread 5 received signal SIGTRAP, Trace/breakpoint trap.
>   [Switching to Thread 60368.0xb908]
>   0x77c79031 in ntdll!DbgBreakPoint () from C:\WINDOWS\SysWOW64\ntdll.dll
>   The program received a signal in another thread while
>   making a function call from GDB.
>   Evaluation of the expression containing the function
>   (igc_postmortem) will be abandoned.
>   When the function is done executing, GDB will silently stop.
>   (gdb) c
>   Continuing.
>   [Thread 60368.0xb908 exited with code 0]
> 
>   Thread 1 received signal SIGTRAP, Trace/breakpoint trap.
>   [Switching to Thread 60368.0xcaa8]
>   0x774996c3 in KERNELBASE!DebugBreak () from C:\WINDOWS\SysWOW64\KernelBase.dll
>   (gdb) thread 1
>   [Switching to thread 1 (Thread 60368.0xcaa8)]
>   #0  0x774996c3 in KERNELBASE!DebugBreak ()
>      from C:\WINDOWS\SysWOW64\KernelBase.dll
>   (gdb) bt
>   #0  0x774996c3 in KERNELBASE!DebugBreak ()
>      from C:\WINDOWS\SysWOW64\KernelBase.dll
>   #1  0x0092477c in emacs_abort () at w32fns.c:11279
>   #2  0x007d4c70 in terminate_due_to_signal (sig=sig@entry=22,
>       backtrace_limit=backtrace_limit@entry=2147483647) at emacs.c:481
>   #3  0x009032bf in igc_assert_fail (
>       file=0xdfce76 <__mon_yday+45622> "protw3.c", line=36,
>       msg=0xdf1c80 <__mon_yday+64> "unreachable code") at igc.c:82
>   #4  0x009f9d53 in mps_lib_assert_fail (
>       condition=0xdf1c80 <__mon_yday+64> "unreachable code", line=36,
>       file=0xdfce76 <__mon_yday+45622> "protw3.c") at mpsliban.c:87
>   #5  ProtSet (base=0xb590000, limit=0xb591000, mode=0) at protw3.c:36
>   #6  ProtSet (base=0xb590000, limit=0xb591000, mode=0) at protw3.c:19
>   #7  0x009f9f70 in arenaExpose (arena=0x9220000) at traceanc.c:588
>   #8  ArenaPostmortem (globals=0x9220008) at traceanc.c:617
>   #9  0x009fa035 in mps_arena_postmortem (arena=<optimized out>) at mpsi.c:292
>   #10 0x0090530d in igc_postmortem () at igc.c:3612
>   #11 <function called from gdb>
>   #12 igc_on_pdump_loaded (dump_base=dump_base@entry=0xb000008,
>       hot_start=hot_start@entry=0xb000080, hot_end=0xb585408,
>       cold_start=0xb5b0008, cold_end=cold_end@entry=0xba8b6c8,
>       cold_user_data_start=0xb7038c0, heap_end=0xb707b10) at igc.c:3769
>   #13 0x008571b8 in pdumper_load (dump_filename=<optimized out>,
>       argv0=<optimized out>,
>       argv0@entry=0xacf0850 "d:\\gnu\\git\\emacs\\feature\\src\\emacs.exe")
>       at pdumper.c:6051
>   #14 0x00a19ae5 in load_pdump (dump_file=<optimized out>, argv=0x93325d0,
>       argc=<optimized out>) at emacs.c:991
>   #15 main (argc=<optimized out>, argv=<optimized out>) at emacs.c:1443
>   (gdb)
> 
> IOW, the call to igc_postmortem itself hits assertion violation.

Btw, the "unreachable" code in this case is this:

  void ProtSet(Addr base, Addr limit, AccessSet mode)
  {
    DWORD newProtect;
    DWORD oldProtect;

    AVER(base < limit);
    AVER(base != 0);
    AVERT(AccessSet, mode);

    newProtect = PAGE_EXECUTE_READWRITE;
    if((mode & AccessWRITE) != 0)
      newProtect = PAGE_EXECUTE_READ;
    if((mode & AccessREAD) != 0)
      newProtect = PAGE_NOACCESS;

    if(VirtualProtect((LPVOID)base, (SIZE_T)AddrOffset(base, limit),
		      newProtect, &oldProtect) == 0)
      NOTREACHED; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  }

It means that VirtualProtect failed.  Since 'mode' is zero, it means
the function was called to remove protection from the mmemory block,
and it failed, probably because the specified memory region was out of
the program's address space?



  parent reply	other threads:[~2024-06-18 17:54 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-16  9:43 MPS: Forwording symbols Gerd Möllmann
2024-06-16 10:15 ` Gerd Möllmann
2024-06-16 19:27 ` Helmut Eller
2024-06-16 19:39   ` Gerd Möllmann
2024-06-17 10:57     ` Eli Zaretskii
2024-06-17 12:15       ` Gerd Möllmann
2024-06-17 12:24         ` Eli Zaretskii
2024-06-17 12:58           ` Gerd Möllmann
2024-06-17  3:43   ` Gerd Möllmann
2024-06-17 11:47     ` Eli Zaretskii
2024-06-17 18:10     ` Helmut Eller
2024-06-17 18:39       ` Gerd Möllmann
2024-06-17 18:50         ` Gerd Möllmann
2024-06-17 19:05           ` Helmut Eller
2024-06-17 19:19             ` Gerd Möllmann
2024-06-17 19:25               ` Helmut Eller
2024-06-17 20:07                 ` Gerd Möllmann
2024-06-18  6:32                   ` Gerd Möllmann
2024-06-18  9:05                     ` Helmut Eller
2024-06-18  9:24                       ` Gerd Möllmann
2024-06-18 10:44                         ` Gerd Möllmann
2024-06-18 11:55                           ` Helmut Eller
2024-06-18 12:21                             ` Gerd Möllmann
2024-06-18 19:36                               ` Helmut Eller
2024-06-18 19:55                                 ` Gerd Möllmann
2024-06-20 14:18                                   ` Helmut Eller
2024-06-20 15:16                                     ` Gerd Möllmann
2024-06-20 16:17                                       ` Helmut Eller
2024-06-20 16:27                                         ` Gerd Möllmann
2024-06-18 12:05                         ` Helmut Eller
2024-06-18 12:29                           ` Gerd Möllmann
2024-06-18 13:08                           ` Eli Zaretskii
2024-06-18 12:36                   ` Eli Zaretskii
2024-06-18 16:20                     ` Helmut Eller
2024-06-18 16:29                       ` Eli Zaretskii
2024-06-18 16:43                       ` Gerd Möllmann
2024-06-18 16:37                     ` Helmut Eller
2024-06-18 17:33                       ` Eli Zaretskii
2024-06-18 17:51                         ` Helmut Eller
2024-06-18 18:18                           ` Eli Zaretskii
2024-06-18 17:54                         ` Eli Zaretskii [this message]
2024-06-18 18:11                           ` Gerd Möllmann
2024-06-18 18:20                             ` Eli Zaretskii
2024-06-18 18:23                               ` Gerd Möllmann
2024-06-18 18:12                           ` Helmut Eller
2024-06-18 18:22                             ` Eli Zaretskii
2024-06-18 19:27                               ` Helmut Eller
2024-06-18 19:33                                 ` Gerd Möllmann
2024-06-19 11:22                                   ` Eli Zaretskii
2024-06-17 19:06           ` Gerd Möllmann
2024-06-21 15:36 ` Helmut Eller
2024-06-21 15:41   ` Gerd Möllmann
2024-06-21 16:20     ` Gerd Möllmann
2024-06-22 18:02       ` Helmut Eller
2024-06-22 18:27         ` Gerd Möllmann
2024-06-22 18:53           ` Helmut Eller
2024-06-22 19:26             ` Gerd Möllmann
2024-06-23  3:28               ` Gerd Möllmann
2024-06-23  4:10                 ` Gerd Möllmann
2024-06-23 19:59               ` Helmut Eller
2024-06-24  3:45                 ` Gerd Möllmann
2024-06-24 15:13                   ` Helmut Eller
2024-06-24 16:14                     ` Gerd Möllmann
2024-06-24 16:32                       ` Eli Zaretskii
2024-06-24 17:00                         ` Gerd Möllmann
2024-06-23 15:59           ` Helmut Eller
2024-06-23 16:26             ` Gerd Möllmann
2024-06-21 16:15   ` Ihor Radchenko
2024-06-21 16:25     ` Gerd Möllmann

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

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

  git send-email \
    --in-reply-to=86r0cup24x.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=eller.helmut@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=gerd.moellmann@gmail.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.