Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mingw-w64-x86_64-emacs-28.2-3-any.pkg.tar.zst has a problem #16190

Open
1 task done
kotsu63 opened this issue Mar 14, 2023 · 53 comments
Open
1 task done

mingw-w64-x86_64-emacs-28.2-3-any.pkg.tar.zst has a problem #16190

kotsu63 opened this issue Mar 14, 2023 · 53 comments
Labels

Comments

@kotsu63
Copy link

kotsu63 commented Mar 14, 2023

Description / Steps to reproduce the issue

The package does not properly run emacs after installation

Expected behavior

Emacs should boot properly.

Actual behavior

It does not boot.

Verification

Windows Version

Windows 10

Are you willing to submit a PR?

No response

@kotsu63 kotsu63 added the bug label Mar 14, 2023
@Biswa96
Copy link
Member

Biswa96 commented Mar 14, 2023

Working fine in my setup. I have installed emacs in clean mingw64 environment. Here is a screenshot of the welcome page in emacs.

image

@Biswa96 Biswa96 transferred this issue from msys2/MSYS2-packages Mar 14, 2023
@kotsu63
Copy link
Author

kotsu63 commented Mar 14, 2023

I see. In my case, emacs does not reach the welcome display at all. Let me try to identify the cause of this problem. Some original setups I have in my windows PC may be creating the problem. When the emacs contacts ``http://tromey.com/elpa/,'' it gets suck without reaching the welcome display.

@kotsu63
Copy link
Author

kotsu63 commented Mar 14, 2023

mingw-w64-x86_64-emacs-28.2-2 works totally, while mingw-w64-x86_64-emacs-28.2-3 does not work. In particular, it never reaches the welcome screen. Very mysterious

@Biswa96
Copy link
Member

Biswa96 commented Mar 14, 2023

I used the 28.2-3 version.

$ pacman -Qi $MINGW_PACKAGE_PREFIX-emacs | grep Version
Version         : 28.2-3

@kotsu63
Copy link
Author

kotsu63 commented Mar 14, 2023

Yes, I understand. I will keep thinking about the causes of this problem that may be due to some original setup in my windows pc.

@Biswa96
Copy link
Member

Biswa96 commented Mar 14, 2023

You could try in a clean install of msys2. Or reinstall emacs and its every dependencies which can be get from pactree -u $MINGW_PACKAGE_PREFIX-emacs command.

@kotsu63
Copy link
Author

kotsu63 commented Mar 14, 2023

Thank you so much. I will try what you suggest here.

@kotsu63
Copy link
Author

kotsu63 commented Mar 14, 2023

I tried reinstallation of all packages from ``pactree'' as suggested. After that, I install the emacs latest version. However, the emacs status does not change and never reaches the welcome display as it gets stuck with the following screen:
2023-03-14

@Biswa96
Copy link
Member

Biswa96 commented Mar 14, 2023

Why does Emacs wnt to contact that URL? How the issue can be reproduced?

@kotsu63
Copy link
Author

kotsu63 commented Mar 14, 2023

As of now, I may not want to install MSYS2 again from scratch due to the limitation of my available time

@kotsu63
Copy link
Author

kotsu63 commented Mar 14, 2023

My emacs init file contains a list of URLs for package management.

@kotsu63
Copy link
Author

kotsu63 commented Mar 14, 2023

I now delete them for checking some problems

@kotsu63
Copy link
Author

kotsu63 commented Mar 14, 2023

It appears that some codes in my init.el file disturb the emacs for having a welcome display. The removal of the following codes from my init file resolve the problem.

; Package management
(require 'package)
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/") t)
(add-to-list 'package-archives '("ELPA" . "http://tromey.com/elpa/") t)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t)
(package-initialize)
(package-refresh-contents)

; flyspell
;(add-hook 'prog-mode-hook 'flyspell-prog-mode)

After the removals, it works well and have the welcome display. I do not know why the removal of the above codes resolves the problem. In any event, thank you for your advice. I really appreciate it.

@Biswa96
Copy link
Member

Biswa96 commented Mar 14, 2023

Wait, this could be an issue in mingw emacs. I am not familiar with emacs. If you'd like to wait others may help. Meanwhile, I shall try to reproduce the issue in Linux or with msys2 emacs.

@kotsu63
Copy link
Author

kotsu63 commented Mar 14, 2023

After the emacs reaches a welcome display, I play around with some commands for emacs package installation and others. It appears that there are some errors in the processes that do not occur in the previous emacs version under my windows pc setup

@kotsu63
Copy link
Author

kotsu63 commented Mar 14, 2023

It is good for me to wait updating the emacs for a few months. As of now, it is unstable even for implementing the commands.

@kotsu63
Copy link
Author

kotsu63 commented Mar 14, 2023

I now gradually think that mingw emacs for the version 28.2-3 is an issue, agreeing with you. I am testing whether or not some commands work between emacs 18.2-2 and emacs 28.2-3

@kotsu63
Copy link
Author

kotsu63 commented Mar 14, 2023

If this is an issue of mingw emacs, what can we do? Should I claim something here or elsewhere?

@dr-scsi
Copy link

dr-scsi commented Mar 14, 2023

@kotsu63 - Try to start Emacs from MinGW64 shell with emacs -Q & which doesn't load your init file at all. If that works, you have to dig further into your init file. You can then put this

(setq debug-on-error t)

at the very beginning of your init file and restart Emacs without -Q. It should you give you an idea what's going wrong.

And also note that package-archives already contains an entry for ELPA:

("gnu" . "https://elpa.gnu.org/packages/")

If you want to use MELPA as well, just do:

(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)

and drop the 2 forms:

(add-to-list 'package-archives '("ELPA" . "http://tromey.com/elpa/") t)
(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t)

The first form is an outdated link (AFAICT) and Org is available from GNU ELPA.

@chdka
Copy link

chdka commented Mar 14, 2023

This morning after the update of the emacs package (UCRT) which contains the move to ctags (0b81343)
What I experienced is a high energy usage in my Windows taskmanager, and it kept on running 'Very High'
Also the eln-cache was not completely rebuild, it seems it is stuck somewhere.

After reverting back to the packages mingw-w64-ucrt-x86_64-universal-ctags-git and go back to mingw-w64-ucrt-x86_64-emacs-28.2-2 the system settled again in a normal behaviour.
The energy consumption is 'Very Low' again and no fans are spinning ;)

@kotsu63
Copy link
Author

kotsu63 commented Mar 14, 2023

The same as below happens to me as well. After removing some codes in my init file, the high energy consumption ceases. However, there remain several crucial problems. Therefore, as of now, I revert back to emacs 28.2-2, and it becomes normal.

This morning after the update of the emacs package (UCRT) which contains the move to ctags (0b81343) What I experienced is a high energy usage in my Windows taskmanager, and it kept on running 'Very High' Also the eln-cache was not completely rebuild, it seems it is stuck somewhere.

After reverting back to the packages mingw-w64-ucrt-x86_64-universal-ctags-git and go back to mingw-w64-ucrt-x86_64-emacs-28.2-2 the system settled again in a normal behaviour. The energy consumption is 'Very Low' again and no fans are spinning ;)

@kotsu63
Copy link
Author

kotsu63 commented Mar 14, 2023

Thank you so much. I will try everything below. Let me see how it goes.

@kotsu63 - Try to start Emacs from MinGW64 shell with emacs -Q & which doesn't load your init file at all. If that works, you have to dig further into your init file. You can then put this

(setq debug-on-error t)

at the very beginning of your init file and restart Emacs without -Q. It should you give you an idea what's going wrong.

And also note that package-archives already contains an entry for ELPA:

("gnu" . "https://elpa.gnu.org/packages/")

If you want to use MELPA as well, just do:

(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)

and drop the 2 forms:

(add-to-list 'package-archives '("ELPA" . "http://tromey.com/elpa/") t)
(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t)

The first form is an outdated link (AFAICT) and Org is available from GNU ELPA.

@Tom9729
Copy link

Tom9729 commented Mar 19, 2023

There is definitely something wrong with 28.2-3. Trying to use package-install which reaches out to Melpa just hangs on "contacting host". Reverting to 28.2-2 by downloading it from https://repo.msys2.org/mingw/x86_64/ and running pacman -U on it works around the issue for now.

If you don't use packages or you already have your packages installed then you won't run into this.

To be clear, the description/steps to reproduce are wrong. Emacs does run, but if you have anything that does package-install in your init file it will hang on startup.

@kotsu63
Copy link
Author

kotsu63 commented Mar 19, 2023

Thank you so much for your comment. Yes, I did it, having run emacs without any problem as of now. However, I just wonder when the fix appears.

There is definitely something wrong with 28.2-3. Trying to use package-install which reaches out to Melpa just hangs on "contacting host". Reverting to 28.2-2 by downloading it from https://repo.msys2.org/mingw/x86_64/ and running pacman -U on it works around the issue for now.

If you don't use packages or you already have your packages installed then you won't run into this.

To be clear, the description/steps to reproduce are wrong. Emacs does run, but if you have anything that does package-install in your init file it will hang on startup.

@svraka
Copy link
Contributor

svraka commented Mar 21, 2023

I can confirm that 28.2-3 does not work properly in a fresh MSYS2 install and the problems happen when Emacs shells out to other programs.

Here’re the steps to reproduce. Running emacs -Q (i.e. Emacs without any custom profile) will launch Emacs, and I can interact with Emacs (opening and saving files, modifying buffers, running all kinds of Elisp code, etc.). It seems to me that problems start happening when Emacs shells out to a program. It happens with package management as other people mentioned earlier but it can be reproduced without requiring any network access.

  1. Running an async shell command. M-& dir will list a directory's contents but Emacs it will consume 100% CPU on a single core (hence the high energy usage and spinning fan that was reported above by @chdka and @kotsu63) and quickly use up several gigs of memory. If I kill the buffer with the shell command's output, Emacs will show this prompt:

    Buffer "*Async Shell Command*" has a running process; kill it? (yes or no)
    

    Which shouldn't happen, the command should have finished. The same things happen with M-& python -c "print('Hello world')" but in this case the output is garbled, I get ello world. Interestingly, running the same commands synchronously with M-! works and gives proper output and Emacs keeps working.

    I guess native compilation also happens via async commands, thus the incomplete eln-cache directory reported by @chdka.

  2. Alternatively, running something in an inferior shell, which is Emacs-speak for a REPL (e.g. M-x shell, or M-x run-python). I can see in Process Explorer that the shells are launched, however Emacs hangs and I cannot regain control with C-g either. Meanwhile with a cmd shell I can see a prompt, with Python just an empty buffer. If I kill the shell process form outside Emacs, it will be responsive after C-g but continues to eat up resources as described above.

I tried rebuilding the package on my system, and the same problems appear with my build as well.

Reverting to 28.2-2 from the repo solved these issues for me as well.

I'm not an expert on either Emacs, or MINGW but I doubt that the recent ctags update in 0b81343 has anything to do with these issues. There might have been some update between 28.2-2 and 28.2-3, where building against some newer version of a dependency, or library causes these issue. Running a git bisect could help but I think you would need to rebuild the whole MINGW system to find the culprit.

@oscarfv
Copy link
Contributor

oscarfv commented Mar 21, 2023

What @svraka describes seem to point to a problem related to the handling of sub-processes, although I'm not sure those are involved on the ELPA-related issues described earlier.

It is not possible that by just changing the package name of universal-ctags this problem can arise. Since Emacs source code is the same, it has to be a change on some dependency that causes effects at compile-time. It could be the C Runtime, but there are reports for mingw-w64 and UCRT, so scratch that. Remains the compiler (gcc) and libwinpthreads.

Installing the libwinpthreads package that was current when 28.2-2 was built (circa October 9 2022) together with 28.2-3 would tell if the problem is there.

As for checking gcc/gcc-libs, that's easy: just try the clang64 build.

@dr-scsi
Copy link

dr-scsi commented Mar 22, 2023

@oscarfv - I downloaded the sources from here and built it myself in an up to date MinW64 shell:

./configure --without-native-compilation --without-pop
make
cd src
./emacs -Q &

I don't get the issues @svraka describes. gcc --version says 12.2.0, and it is with

mingw-w64-x86_64-libwinpthread-git 10.0.0.r234.g283e5b23a-1

@svraka
Copy link
Contributor

svraka commented Mar 22, 2023

Thanks for the pointers @oscarfv! I get the same issues on the clang64 build. Will also try older versions of the libwinpthreads package, they are still available in the repo.

@dr-scsi
Copy link

dr-scsi commented Mar 24, 2023

@oscarfv - I built Emacs from the tarball again (native-compilation activated this time):

./configure --with-native-compilation --without-pop
make
cd src
./emacs -Q &

M-x list-packages RET throws an error about Failed to verify signature, but native-compiling works as expected.

@kotsu63
Copy link
Author

kotsu63 commented Mar 27, 2023

Thank you for your contribution. As of now, I download the file ``mingw-w64-x86_64-emacs-28.2-4-any.pkg.tar.zst'' from the link you provided, and confirm that it does not work in my window PC after installing it via pacman -U. It appears that the mingw-w64-x86_64-emacs-28.2-3 is fundamentally problematic.

Following @dr-scsi 's line, I re-made the packages. You can download them here:

https://github.com/oscarfv/MINGW-packages/actions/runs/4491198704#artifacts

Possibly solving this issue is as simple as rebuilding, although it would be nice to have some hint about the origin.

@svraka
Copy link
Contributor

svraka commented Apr 20, 2023

Did anyone figure out anything? I did a bit of digging with restoring old package versions and rebuilding Emacs. The scripts used can be found here. They are seriously jerry-rigged, so be careful if you want to play around but I think they do the job.

I ran git bisect, tried to figure out the current package versions in each revision for Emacs's build dependencies, install them from a local copy of the MSYS repo, then build Emacs and run a little test.

Unfortunately it didn't help. There are a bunch of revisions around the merge of #13528 where Emacs wouldn't even build in any MINGW environment, and this coincided with the time of 28.2-2. But in most cases it can be built but I couldn't find a revision where it works properly. Although I haven't gone back much before 28.2-2 yet.

Is there something fundamentally broken here? I only restored old versions of MinGW packages but didn't touch MSYS2 packages because I didn't want to deal with down/upgrading pacman, bash, etc. Could that be an issue? Maybe old versions of autotools should also be checked?

BTW, I also built Emacs 29.0.90 in MINGW64 without any changes to the PKGBUILD file. The build was completed but the bug persists.

@oscarfv
Copy link
Contributor

oscarfv commented Apr 20, 2023

@svraka : you can try building the package with

options=('!strip' 'debug' '!zipman')

in PKGBUILD. Then run emacs.exe under gdb. Then Control-C on the gdb console and see where emacs is stuck. Please note that Emacs runs several threads.

@svraka
Copy link
Contributor

svraka commented Apr 24, 2023

Thanks for the tip, @oscarfv. Here's the GDB output:

PS> gdb .\mingw-w64-emacs\pkg\mingw-w64-ucrt-x86_64-emacs\ucrt64\bin\emacs.exe
GNU gdb (GDB) 13.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from .\mingw-w64-emacs\pkg\mingw-w64-ucrt-x86_64-emacs\ucrt64\bin\emacs.exe...
(gdb) run
Starting program: C:\Users\...\mingw-w64-emacs\pkg\mingw-w64-ucrt-x86_64-emacs\ucrt64\bin\emacs.exe
[New Thread 6084.0x4f64]
[New Thread 6084.0x5174]
[New Thread 6084.0x16b0]
[New Thread 6084.0x1610]
[New Thread 6084.0x6058]
[New Thread 6084.0x5fc4]
[New Thread 6084.0x8f8]
[New Thread 6084.0x1b40]
[New Thread 6084.0x11e8]
[New Thread 6084.0x66c4]
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(1) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(2) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(3) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(4) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(5) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(6) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(7) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(8) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(9) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(10) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(11) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(12) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(13) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(14) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(15) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(16) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(17) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(18) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(19) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(20) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(21) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(22) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(23) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(24) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(25) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(26) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(27) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(28) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(29) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(30) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(31) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(32) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(33) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(34) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(35) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(36) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(37) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(38) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(39) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(40) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(41) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(42) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(43) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(44) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(45) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(46) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(47) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(48) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(49) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(50) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(51) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(52) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(53) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(54) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(55) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(56) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(57) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(58) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(59) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(60) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(61) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(62) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(63) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(64) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(65) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(66) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(67) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(68) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(69) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(70) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(71) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(72) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(73) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(74) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(75) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(76) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(77) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(78) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(79) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(80) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(81) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(82) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(83) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(84) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(85) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(86) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(87) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(88) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(89) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(90) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(91) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(92) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(93) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(94) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(95) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(96) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(97) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(98) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(99) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(100) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(101) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(102) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(103) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(104) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(105) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(106) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(107) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(108) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(109) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(110) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(111) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(112) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(113) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(114) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(115) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(116) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(117) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(118) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(119) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(120) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(121) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(122) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(123) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(124) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(125) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(126) tid(66c4) 80040154 Class not registered
warning: onecore\com\combase\objact\objact.cxx(4070)\combase.dll!00007FFD81C25905: (caller: 00007FFD81C2D65A) ReturnHr(127) tid(66c4) 80040154 Class not registered
[New Thread 6084.0xd14]
[Thread 6084.0x66c4 exited with code 0]
[Thread 6084.0xd14 exited with code 0]
[New Thread 6084.0x5594]

Thread 13 received signal SIGINT, Interrupt.
[Switching to Thread 6084.0x5594]
0x00007ffd8141245e in KERNELBASE!CtrlRoutine () from C:\WINDOWS\System32\KernelBase.dll

This comes from running Emacs without any arguments and an empty .emacs.d directory. With emacs -Q the warnings do not appear.

At this point Emacs is simply stuck. Is there anything specific I should look for?

@oscarfv
Copy link
Contributor

oscarfv commented Apr 24, 2023

@svraka : after pressing Control-C in gdb's console while Emacs is stuck, a backtrace of all threads will be interesting:

thread apply all bt

@svraka
Copy link
Contributor

svraka commented Apr 25, 2023

Here's a backtrace of just launching Emacs:

GDB backtrace
Reading symbols from .\pkg\mingw-w64-ucrt-x86_64-emacs\ucrt64\bin\emacs.exe...
(gdb) run
Starting program: C:\...\pkg\mingw-w64-ucrt-x86_64-emacs\ucrt64\bin\emacs.exe --quick
[New Thread 24424.0x5a28]
[New Thread 24424.0x5934]
[New Thread 24424.0x5d14]
[New Thread 24424.0x5ff4]
[New Thread 24424.0x51bc]
[New Thread 24424.0x476c]

Thread 7 received signal SIGINT, Interrupt.
[Switching to Thread 24424.0x476c]
0x00007ff86339157f in TlsGetValue () from C:\WINDOWS\System32\KernelBase.dll
(gdb) thread apply all bt

Thread 7 (Thread 24424.0x476c):
#0  0x00007ff86339157f in TlsGetValue () from C:\WINDOWS\System32\KernelBase.dll
#1  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#2  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#3  0x0000000000000000 in ?? ()

Thread 6 (Thread 24424.0x51bc):
#0  0x00007ff863171104 in win32u!NtUserGetMessage () from C:\WINDOWS\System32\win32u.dll
#1  0x00007ff865671b9e in USER32!GetMessageW () from C:\WINDOWS\System32\user32.dll
#2  0x00007ff691e5476a in w32_msg_pump (msg_buf=msg_buf@entry=0x5bcfeb0) at ../../emacs-28.2/src/w32fns.c:3248
#3  0x00007ff691e5483e in w32_msg_worker (arg=<optimized out>) at ../../emacs-28.2/src/w32fns.c:3486
#4  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#5  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#6  0x0000000000000000 in ?? ()

Thread 5 (Thread 24424.0x5ff4):
#0  0x00007ff86598d744 in ntdll!ZwDelayExecution () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ff86331b16e in SleepEx () from C:\WINDOWS\System32\KernelBase.dll
#2  0x00007ff691e86520 in timer_loop (arg=0x7ff6923107c0 <real_itimer>) at ../../emacs-28.2/src/w32proc.c:473
#3  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#4  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#5  0x0000000000000000 in ?? ()

Thread 4 (Thread 24424.0x5d14):
#0  0x00007ff865990b14 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ff865942e17 in ntdll!TpReleaseCleanupGroupMembers () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#3  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x0000000000000000 in ?? ()

Thread 3 (Thread 24424.0x5934):
#0  0x00007ff865990b14 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ff865942e17 in ntdll!TpReleaseCleanupGroupMembers () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#3  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x0000000000000000 in ?? ()

Thread 2 (Thread 24424.0x5a28):
#0  0x00007ff865990b14 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ff865942e17 in ntdll!TpReleaseCleanupGroupMembers () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#3  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x0000000000000000 in ?? ()

Thread 1 (Thread 24424.0x426c):
#0  0x00007ff86317a104 in win32u!NtUserMsgWaitForMultipleObjectsEx () from C:\WINDOWS\System32\win32u.dll
#1  0x00007ff8656707ee in USER32!MsgWaitForMultipleObjectsEx () from C:\WINDOWS\System32\user32.dll
#2  0x00007ff691e8838f in sys_select (nfds=<optimized out>, rfds=0xbfee48, wfds=0xbfee50, efds=<optimized out>, timeout=0xbfee30, ignored=0x0) at ../../emacs-28.2/src/w32proc.c:2467
#3  0x00007ff691e49683 in really_call_select (arg=0xbfebc0) at ../../emacs-28.2/src/thread.c:596
#4  0x00007ff691dc8bd9 in flush_stack_call_func1 (func=0x1486, func@entry=0x7ff691e4961a <really_call_select>, arg=0x2, arg@entry=0xbfeca0) at ../../emacs-28.2/src/alloc.c:5150
#5  0x00007ff691e49c44 in flush_stack_call_func (arg=0xbfeca0, func=0x7ff691e4961a <really_call_select>) at ../../emacs-28.2/src/lisp.h:3834
#6  thread_select (func=<optimized out>, max_fds=<optimized out>, rfds=rfds@entry=0xbfee48, wfds=<optimized out>, efds=<optimized out>, efds@entry=0x0, timeout=<optimized out>, timeout@entry=0xbfee30, sigmask=<optimized out>, sigmask@entry=0x0) at ../../emacs-28.2/src/thread.c:628
#7  0x00007ff691e2c468 in wait_reading_process_output (time_limit=time_limit@entry=0, nsecs=nsecs@entry=0, read_kbd=<optimized out>, read_kbd@entry=-1, do_display=true, wait_for_cell=wait_for_cell@entry=0x0, wait_proc=wait_proc@entry=0x0, just_wait_proc=just_wait_proc@entry=0) at ../../emacs-28.2/src/process.c:5600
#8  0x00007ff691d81449 in kbd_buffer_get_event (kbp=kbp@entry=0xbfefd8, used_mouse_menu=used_mouse_menu@entry=0xbff51b, end_time=end_time@entry=0x0) at ../../emacs-28.2/src/keyboard.c:3926
#9  0x00007ff691d81924 in read_event_from_main_queue (end_time=end_time@entry=0x0, local_getcjmp=local_getcjmp@entry=0xbff200, used_mouse_menu=used_mouse_menu@entry=0xbff51b) at ../../emacs-28.2/src/keyboard.c:2198
#10 0x00007ff691d81a46 in read_decoded_event_from_main_queue (end_time=end_time@entry=0x0, local_getcjmp=local_getcjmp@entry=0xbff200, prev_event=prev_event@entry=0x0, used_mouse_menu=used_mouse_menu@entry=0xbff51b) at ../../emacs-28.2/src/keyboard.c:2261
#11 0x00007ff691d829e8 in read_char (commandflag=1, map=map@entry=0x5c458a3, prev_event=0x0, used_mouse_menu=used_mouse_menu@entry=0xbff51b, end_time=end_time@entry=0x0) at ../../emacs-28.2/src/keyboard.c:2892
#12 0x00007ff691d83988 in read_key_sequence (keybuf=keybuf@entry=0xbff630, prompt=prompt@entry=0x0, dont_downcase_last=dont_downcase_last@entry=false, can_return_switch_frame=can_return_switch_frame@entry=true, fix_current_buffer=fix_current_buffer@entry=true, prevent_redisplay=prevent_redisplay@entry=false) at ../../emacs-28.2/src/keyboard.c:9635
#13 0x00007ff691d84ab8 in command_loop_1 () at ../../emacs-28.2/src/keyboard.c:1392
#14 0x00007ff691de4757 in internal_condition_case (bfun=bfun@entry=0x7ff691d8485f <command_loop_1>, handlers=handlers@entry=0x90, hfun=hfun@entry=0x7ff691d7b7cd <cmd_error>) at ../../emacs-28.2/src/eval.c:1450
#15 0x00007ff691d764e3 in command_loop_2 (handlers=0x90) at ../../emacs-28.2/src/keyboard.c:1133
#16 0x00007ff691de46c8 in internal_catch (tag=tag@entry=0xf210, func=func@entry=0x7ff691d764c5 <command_loop_2>, arg=arg@entry=0x90) at ../../emacs-28.2/src/eval.c:1181
#17 0x00007ff691d76416 in command_loop () at ../../emacs-28.2/src/keyboard.c:1111
#18 0x00007ff691d7b3f6 in recursive_edit_1 () at ../../emacs-28.2/src/keyboard.c:720
#19 0x00007ff691d7b700 in Frecursive_edit () at ../../emacs-28.2/src/keyboard.c:803
#20 0x00007ff691d75992 in main (argc=<optimized out>, argv=0xddcf00) at ../../emacs-28.2/src/emacs.c:2358

And here's one with running dir as an async command:

GDB backtrace
Reading symbols from .\pkg\mingw-w64-ucrt-x86_64-emacs\ucrt64\bin\emacs.exe...
(gdb) run
Starting program: C:\...\pkg\mingw-w64-ucrt-x86_64-emacs\ucrt64\bin\emacs.exe --quick
[New Thread 20700.0x5868]
[New Thread 20700.0x3cb0]
[New Thread 20700.0x1d5c]
[New Thread 20700.0x4f90]
[New Thread 20700.0x5918]
[New Thread 20700.0x3838]
[New Thread 20700.0x505c]
[Thread 20700.0x3838 exited with code 0]
[New Thread 20700.0x16e0]

Thread 9 received signal SIGINT, Interrupt.
[Switching to Thread 20700.0x16e0]
0x00007ff86339157f in TlsGetValue () from C:\WINDOWS\System32\KernelBase.dll
(gdb) thread apply all bt

Thread 9 (Thread 20700.0x16e0):
#0  0x00007ff86339157f in TlsGetValue () from C:\WINDOWS\System32\KernelBase.dll
#1  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#2  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#3  0x0000000000000000 in ?? ()

Thread 8 (Thread 20700.0x505c):
#0  0x00007ff86598d144 in ntdll!ZwWaitForSingleObject () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ff8632f306e in WaitForSingleObjectEx () from C:\WINDOWS\System32\KernelBase.dll
#2  0x00007ff691e84ece in reader_thread (arg=0x7ff69230f030 <child_procs+144>) at ../../emacs-28.2/src/w32proc.c:1258
#3  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#4  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#5  0x0000000000000000 in ?? ()

Thread 6 (Thread 20700.0x5918):
#0  0x00007ff863171104 in win32u!NtUserGetMessage () from C:\WINDOWS\System32\win32u.dll
#1  0x00007ff865671b9e in USER32!GetMessageW () from C:\WINDOWS\System32\user32.dll
#2  0x00007ff691e5476a in w32_msg_pump (msg_buf=msg_buf@entry=0x5cffeb0) at ../../emacs-28.2/src/w32fns.c:3248
#3  0x00007ff691e5483e in w32_msg_worker (arg=<optimized out>) at ../../emacs-28.2/src/w32fns.c:3486
#4  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#5  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#6  0x0000000000000000 in ?? ()

Thread 5 (Thread 20700.0x4f90):
#0  0x00007ff86598d744 in ntdll!ZwDelayExecution () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ff86331b16e in SleepEx () from C:\WINDOWS\System32\KernelBase.dll
#2  0x00007ff691e86520 in timer_loop (arg=0x7ff6923107c0 <real_itimer>) at ../../emacs-28.2/src/w32proc.c:473
#3  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#4  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#5  0x0000000000000000 in ?? ()

Thread 4 (Thread 20700.0x1d5c):
#0  0x00007ff865990b14 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ff865942e17 in ntdll!TpReleaseCleanupGroupMembers () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#3  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x0000000000000000 in ?? ()

Thread 3 (Thread 20700.0x3cb0):
#0  0x00007ff865990b14 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ff865942e17 in ntdll!TpReleaseCleanupGroupMembers () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#3  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x0000000000000000 in ?? ()

Thread 2 (Thread 20700.0x5868):
#0  0x00007ff865990b14 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ff865942e17 in ntdll!TpReleaseCleanupGroupMembers () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#3  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x0000000000000000 in ?? ()

Thread 1 (Thread 20700.0x868):
#0  0x00007ff86317a104 in win32u!NtUserMsgWaitForMultipleObjectsEx () from C:\WINDOWS\System32\win32u.dll
#1  0x00007ff8656707ee in USER32!MsgWaitForMultipleObjectsEx () from C:\WINDOWS\System32\user32.dll
#2  0x00007ff691e8838f in sys_select (nfds=<optimized out>, rfds=0xbff028, wfds=0xbff030, efds=<optimized out>, timeout=0xbff010, ignored=0x0) at ../../emacs-28.2/src/w32proc.c:2467
#3  0x00007ff691e49683 in really_call_select (arg=0xbfeda0) at ../../emacs-28.2/src/thread.c:596
#4  0x00007ff691dc8bd9 in flush_stack_call_func1 (func=0x1486, func@entry=0x7ff691e4961a <really_call_select>, arg=0x4, arg@entry=0xbfee80) at ../../emacs-28.2/src/alloc.c:5150
#5  0x00007ff691e49c44 in flush_stack_call_func (arg=0xbfee80, func=0x7ff691e4961a <really_call_select>) at ../../emacs-28.2/src/lisp.h:3834
#6  thread_select (func=<optimized out>, max_fds=<optimized out>, rfds=rfds@entry=0xbff028, wfds=<optimized out>, efds=<optimized out>, efds@entry=0x0, timeout=<optimized out>, timeout@entry=0xbff010, sigmask=<optimized out>, sigmask@entry=0x0) at ../../emacs-28.2/src/thread.c:628
#7  0x00007ff691e2c468 in wait_reading_process_output (time_limit=<optimized out>, nsecs=<optimized out>, read_kbd=<optimized out>, do_display=do_display@entry=true, wait_for_cell=wait_for_cell@entry=0x0, wait_proc=wait_proc@entry=0x0, just_wait_proc=just_wait_proc@entry=0) at ../../emacs-28.2/src/process.c:5600
#8  0x00007ff691cda3b6 in sit_for (timeout=timeout@entry=0x7a, reading=reading@entry=true, display_option=display_option@entry=1) at ../../emacs-28.2/src/dispnew.c:6184
#9  0x00007ff691d828b8 in read_char (commandflag=1, map=map@entry=0x6032e83, prev_event=0x0, used_mouse_menu=used_mouse_menu@entry=0xbff51b, end_time=end_time@entry=0x0) at ../../emacs-28.2/src/lisp.h:725
#10 0x00007ff691d83988 in read_key_sequence (keybuf=keybuf@entry=0xbff630, prompt=prompt@entry=0x0, dont_downcase_last=dont_downcase_last@entry=false, can_return_switch_frame=can_return_switch_frame@entry=true, fix_current_buffer=fix_current_buffer@entry=true, prevent_redisplay=prevent_redisplay@entry=false) at ../../emacs-28.2/src/keyboard.c:9635
#11 0x00007ff691d84ab8 in command_loop_1 () at ../../emacs-28.2/src/keyboard.c:1392
#12 0x00007ff691de4757 in internal_condition_case (bfun=bfun@entry=0x7ff691d8485f <command_loop_1>, handlers=handlers@entry=0x90, hfun=hfun@entry=0x7ff691d7b7cd <cmd_error>) at ../../emacs-28.2/src/eval.c:1450
#13 0x00007ff691d764e3 in command_loop_2 (handlers=0x90) at ../../emacs-28.2/src/keyboard.c:1133
#14 0x00007ff691de46c8 in internal_catch (tag=tag@entry=0xf210, func=func@entry=0x7ff691d764c5 <command_loop_2>, arg=arg@entry=0x90) at ../../emacs-28.2/src/eval.c:1181
#15 0x00007ff691d76416 in command_loop () at ../../emacs-28.2/src/keyboard.c:1111
#16 0x00007ff691d7b3f6 in recursive_edit_1 () at ../../emacs-28.2/src/keyboard.c:720
#17 0x00007ff691d7b700 in Frecursive_edit () at ../../emacs-28.2/src/keyboard.c:803
#18 0x00007ff691d75992 in main (argc=<optimized out>, argv=0xdbe830) at ../../emacs-28.2/src/emacs.c:2358

@svraka
Copy link
Contributor

svraka commented Apr 28, 2023

For what is worth, the GNU build of Emacs 29.0.90 works correctly (after copying files to share/emacs/29.0.90/etc, for some reason they didn't include those in this package version). According to their README:

These dependencies were produced from an updated msys2 at the point of the first pre-test. It is not intended that these will be updated after that point.

Can this info help us nailing down where the MSYS build fails?

I've attached GDB backtraces for both builds. In Thread 1 there are some differences which functions are called. The MSYS build seems to call a few additional functions (read_decoded_event_from_main_queuey, kbd_buffer_get_eventy, flush_stack_call_funcy, flush_stack_call_func1). Note that I didn't interact with Emacs in either case.

GNU build
Reading symbols from .\emacs-29.0.90\src\emacs.exe...
(gdb) run
Starting program: C:\...\emacs-29.0.90\src\emacs.exe --quick
[New Thread 16704.0x61ac]
[New Thread 16704.0x506c]
[New Thread 16704.0x1e9c]
[New Thread 16704.0x18c4]
[New Thread 16704.0x5e54]
[New Thread 16704.0x2c4]

Thread 7 received signal SIGINT, Interrupt.
[Switching to Thread 16704.0x2c4]
0x00007ff86339157f in TlsGetValue () from C:\WINDOWS\System32\KernelBase.dll
(gdb) thread apply all bt

Thread 7 (Thread 16704.0x2c4):
#0  0x00007ff86339157f in TlsGetValue () from C:\WINDOWS\System32\KernelBase.dll
#1  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#2  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#3  0x0000000000000000 in ?? ()

Thread 6 (Thread 16704.0x5e54):
#0  0x00007ff863171104 in win32u!NtUserGetMessage () from C:\WINDOWS\System32\win32u.dll
#1  0x00007ff865671b9e in USER32!GetMessageW () from C:\WINDOWS\System32\user32.dll
#2  0x00007ff7abe255a9 in w32_msg_pump ()
#3  0x00007ff7abe25cdb in w32_msg_worker ()
#4  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#5  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#6  0x0000000000000000 in ?? ()

Thread 5 (Thread 16704.0x18c4):
#0  0x00007ff86598d744 in ntdll!ZwDelayExecution () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ff86331b16e in SleepEx () from C:\WINDOWS\System32\KernelBase.dll
#2  0x00007ff7abe5dff0 in timer_loop ()
#3  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#4  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#5  0x0000000000000000 in ?? ()

Thread 4 (Thread 16704.0x1e9c):
#0  0x00007ff865990b14 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ff865942e17 in ntdll!TpReleaseCleanupGroupMembers () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#3  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x0000000000000000 in ?? ()

Thread 3 (Thread 16704.0x506c):
#0  0x00007ff865990b14 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ff865942e17 in ntdll!TpReleaseCleanupGroupMembers () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#3  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x0000000000000000 in ?? ()

Thread 2 (Thread 16704.0x61ac):
#0  0x00007ff865990b14 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ff865942e17 in ntdll!TpReleaseCleanupGroupMembers () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#3  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x0000000000000000 in ?? ()

Thread 1 (Thread 16704.0x2974):
#0  0x00007ff86317a104 in win32u!NtUserMsgWaitForMultipleObjectsEx () from C:\WINDOWS\System32\win32u.dll
#1  0x00007ff8656707ee in USER32!MsgWaitForMultipleObjectsEx () from C:\WINDOWS\System32\user32.dll
#2  0x00007ff7abe60c42 in sys_select ()
#3  0x00007ff7abe0eec5 in really_call_select ()
#4  0x00007ff7abe0f8fe in thread_select ()
#5  0x00007ff7abde7222 in wait_reading_process_output ()
#6  0x00007ff7abd01e17 in read_event_from_main_queue ()
#7  0x00007ff7abd078dc in read_char ()
#8  0x00007ff7abd09bc5 in read_key_sequence ()
#9  0x00007ff7abd0b756 in command_loop_1 ()
#10 0x00007ff7abd8376d in internal_condition_case ()
#11 0x00007ff7abcf6f5e in command_loop_2 ()
#12 0x00007ff7abd836db in internal_catch ()
#13 0x00007ff7abcf6eec in command_loop ()
#14 0x00007ff7abcff43d in recursive_edit_1 ()
#15 0x00007ff7abcff800 in Frecursive_edit ()
#16 0x00007ff7abe9c7ab in main ()
Local MSYS2 build
Reading symbols from .\mingw-w64-x86_64-emacs-29.0.90-1-any\mingw64\bin\emacs.exe...
(gdb) run
Starting program: C:\...\mingw-w64-x86_64-emacs-29.0.90-1-any\mingw64\bin\emacs.exe --quick
[New Thread 25000.0x3288]
[New Thread 25000.0x59ec]
[New Thread 25000.0xcac]
[New Thread 25000.0x4590]
[New Thread 25000.0x5e78]
[New Thread 25000.0x3c48]

Thread 7 received signal SIGINT, Interrupt.
[Switching to Thread 25000.0x3c48]
0x00007ff86339157f in TlsGetValue () from C:\WINDOWS\System32\KernelBase.dll
(gdb) thread apply all bt

Thread 7 (Thread 25000.0x3c48):
#0  0x00007ff86339157f in TlsGetValue () from C:\WINDOWS\System32\KernelBase.dll
#1  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#2  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#3  0x0000000000000000 in ?? ()

Thread 6 (Thread 25000.0x5e78):
#0  0x00007ff863171104 in win32u!NtUserGetMessage () from C:\WINDOWS\System32\win32u.dll
#1  0x00007ff865671b9e in USER32!GetMessageW () from C:\WINDOWS\System32\user32.dll
#2  0x00007ff6ca97e86d in w32_msg_pump (msg_buf=msg_buf@entry=0x624feb0) at ../../emacs-29.0.90/src/w32fns.c:3336
#3  0x00007ff6ca97e941 in w32_msg_worker (arg=<optimized out>) at ../../emacs-29.0.90/src/w32fns.c:3574
#4  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#5  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#6  0x0000000000000000 in ?? ()

Thread 5 (Thread 25000.0x4590):
#0  0x00007ff86598d744 in ntdll!ZwDelayExecution () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ff86331b16e in SleepEx () from C:\WINDOWS\System32\KernelBase.dll
#2  0x00007ff6ca9b2aa7 in timer_loop (arg=0x7ff6caf7eb20 <real_itimer>) at ../../emacs-29.0.90/src/w32proc.c:476
#3  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#4  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#5  0x0000000000000000 in ?? ()

Thread 4 (Thread 25000.0xcac):
#0  0x00007ff865990b14 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ff865942e17 in ntdll!TpReleaseCleanupGroupMembers () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#3  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x0000000000000000 in ?? ()

Thread 3 (Thread 25000.0x59ec):
#0  0x00007ff865990b14 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ff865942e17 in ntdll!TpReleaseCleanupGroupMembers () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#3  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x0000000000000000 in ?? ()

Thread 2 (Thread 25000.0x3288):
#0  0x00007ff865990b14 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ff865942e17 in ntdll!TpReleaseCleanupGroupMembers () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ff863cd7614 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#3  0x00007ff8659426a1 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x0000000000000000 in ?? ()

Thread 1 (Thread 25000.0x67cc):
#0  0x00007ff86317a104 in win32u!NtUserMsgWaitForMultipleObjectsEx () from C:\WINDOWS\System32\win32u.dll
#1  0x00007ff8656707ee in USER32!MsgWaitForMultipleObjectsEx () from C:\WINDOWS\System32\user32.dll
#2  0x00007ff6ca9b49d2 in sys_select (nfds=<optimized out>, rfds=0xbfed48, wfds=0xbfed50, efds=<optimized out>, timeout=0xbfed30, ignored=0x0) at ../../emacs-29.0.90/src/w32proc.c:2504
#3  0x00007ff6ca9703d0 in really_call_select (arg=0xbfeac0) at ../../emacs-29.0.90/src/thread.c:612
#4  0x00007ff6ca8e7402 in flush_stack_call_func1 (func=0x1486, func@entry=0x7ff6ca970367 <really_call_select>, arg=0x2, arg@entry=0xbfeba0) at ../../emacs-29.0.90/src/alloc.c:5207
#5  0x00007ff6ca970995 in flush_stack_call_func (arg=0xbfeba0, func=0x7ff6ca970367 <really_call_select>) at ../../emacs-29.0.90/src/lisp.h:4232
#6  thread_select (func=<optimized out>, max_fds=<optimized out>, rfds=rfds@entry=0xbfed48, wfds=<optimized out>, efds=<optimized out>, efds@entry=0x0, timeout=<optimized out>, timeout@entry=0xbfed30,
 sigmask=<optimized out>, sigmask@entry=0x0) at ../../emacs-29.0.90/src/thread.c:644
#7  0x00007ff6ca951bc5 in wait_reading_process_output (time_limit=time_limit@entry=0, nsecs=nsecs@entry=0, read_kbd=<optimized out>, read_kbd@entry=-1, do_display=true, wait_for_cell=wait_for_cell@entry=0x0, wait_proc=wait_proc@entry=0x0, just_wait_proc=just_wait_proc@entry=0) at ../../emacs-29.0.90/src/process.c:5693
#8  0x00007ff6ca89bc26 in kbd_buffer_get_event (kbp=kbp@entry=0xbfef28, used_mouse_menu=used_mouse_menu@entry=0xbff4cb, end_time=end_time@entry=0x0) at ../../emacs-29.0.90/src/keyboard.c:4010
#9  0x00007ff6ca89c505 in read_event_from_main_queue (end_time=end_time@entry=0x0, local_getcjmp=local_getcjmp@entry=0xbff1a0, used_mouse_menu=used_mouse_menu@entry=0xbff4cb) at ../../emacs-29.0.90/src/keyboard.c:2277
#10 0x00007ff6ca89c627 in read_decoded_event_from_main_queue (end_time=end_time@entry=0x0, local_getcjmp=local_getcjmp@entry=0xbff1a0, prev_event=prev_event@entry=0x0, used_mouse_menu=used_mouse_menu@entry=0xbff4cb) at ../../emacs-29.0.90/src/keyboard.c:2340
#11 0x00007ff6ca89d65e in read_char (commandflag=1, map=map@entry=0x62aab93, prev_event=0x0, used_mouse_menu=used_mouse_menu@entry=0xbff4cb, end_time=end_time@entry=0x0) at ../../emacs-29.0.90/src/keyboard.c:2971
#12 0x00007ff6ca89e719 in read_key_sequence (keybuf=keybuf@entry=0xbff610, prompt=prompt@entry=0x0, dont_downcase_last=dont_downcase_last@entry=false, can_return_switch_frame=can_return_switch_frame@entry=true, fix_current_buffer=fix_current_buffer@entry=true, prevent_redisplay=prevent_redisplay@entry=false) at ../../emacs-29.0.90/src/keyboard.c:10081
#13 0x00007ff6ca89f85b in command_loop_1 () at ../../emacs-29.0.90/src/keyboard.c:1382
#14 0x00007ff6ca90513f in internal_condition_case (bfun=bfun@entry=0x7ff6ca89f62c <command_loop_1>, handlers=handlers@entry=0x90, hfun=hfun@entry=0x7ff6ca895616 <cmd_error>) at ../../emacs-29.0.90/src/eval.c:1474
#15 0x00007ff6ca88fd07 in command_loop_2 (handlers=0x90) at ../../emacs-29.0.90/src/keyboard.c:1131
#16 0x00007ff6ca9050b0 in internal_catch (tag=tag@entry=0x10380, func=func@entry=0x7ff6ca88fce9 <command_loop_2>, arg=arg@entry=0x90) at ../../emacs-29.0.90/src/eval.c:1197
#17 0x00007ff6ca88fc35 in command_loop () at ../../emacs-29.0.90/src/keyboard.c:1109
#18 0x00007ff6ca8951cd in recursive_edit_1 () at ../../emacs-29.0.90/src/keyboard.c:718
#19 0x00007ff6ca89551b in Frecursive_edit () at ../../emacs-29.0.90/src/keyboard.c:801
#20 0x00007ff6ca88f0b0 in main (argc=2, argv=<optimized out>) at ../../emacs-29.0.90/src/emacs.c:2529

@kotsu63
Copy link
Author

kotsu63 commented May 24, 2023

Yesterday, with MSYS2, I updated emacs to be in mingw-w64-x86_64-emacs-28.2-4 on Windows 10. However, it does neither still function nor display a welcome screen. Unfortunately, the problem below remains from mingw-w64-x86_64-emacs-28.2-3 on MSYS2 packages.

Description / Steps to reproduce the issue

The package does not properly run emacs after installation

Expected behavior

Emacs should boot properly.

Actual behavior

It does not boot.

Verification

Windows Version

Windows 10

Are you willing to submit a PR?

No response

@Biswa96
Copy link
Member

Biswa96 commented May 24, 2023

However, it does neither still function nor display a welcome screen.

emacs working fine in my setup. Here is a screenshot of latest mingw emacs welcome screen.

image

Please provide any further log or error message for your issue.

@kotsu63
Copy link
Author

kotsu63 commented May 24, 2023

I see. Thank you for your info. Let me see what is my trouble and I will update it if anything.

However, it does neither still function nor display a welcome screen.

emacs working fine in my setup. Here is a screenshot of latest mingw emacs welcome screen.

image

Please provide any further log or error message for your issue.

@Tom9729
Copy link

Tom9729 commented May 24, 2023

However, it does neither still function nor display a welcome screen.

emacs working fine in my setup. Here is a screenshot of latest mingw emacs welcome screen.

image

Please provide any further log or error message for your issue.

Just to clarify, does your Emacs configuration load any packages? The problem only happens if you have a configuration which tries to reach out to ELPA/MELPA on startup. You can also reproduce the issue with M-x package-refresh-contents and then M-x package-install something. Emacs will hang when attempting to connect out to the internet.

I have not tried the latest build yet though, so it's possible this really is fixed and if that is the case sorry for wasting your time. 👍

@Biswa96
Copy link
Member

Biswa96 commented May 24, 2023

Just to clarify, does your Emacs configuration load any packages?

No, not in my setup. Thanks for the clarification. Previous comments mentioned about using packages. I can try to set those up.

@kotsu63
Copy link
Author

kotsu63 commented May 24, 2023

In fact, yes. Let me try booting emacs without loading any packages.

Just to clarify, does your Emacs configuration load any packages?
No, not in my setup. Thanks for the clarification. Previous comments mentioned about using packages. I can try to set those up.

@kotsu63
Copy link
Author

kotsu63 commented May 24, 2023

However, it does neither still function nor display a welcome screen.

emacs working fine in my setup. Here is a screenshot of latest mingw emacs welcome screen.
image
Please provide any further log or error message for your issue.

Just to clarify, does your Emacs configuration load any packages? The problem only happens if you have a configuration which tries to reach out to ELPA/MELPA on startup. You can also reproduce the issue with M-x package-refresh-contents and then M-x package-install something. Emacs will hang when attempting to connect out to the internet.

I have not tried the latest build yet though, so it's possible this really is fixed and if that is the case sorry for wasting your time. 👍

Thank you for your advice. I will try to do it following your advice and let me see.

@cyrilarnould
Copy link

Yesterday, with MSYS2, I updated emacs to be in mingw-w64-x86_64-emacs-28.2-4 on Windows 10. However, it does neither still function nor display a welcome screen. Unfortunately, the problem below remains from mingw-w64-x86_64-emacs-28.2-3 on MSYS2 packages.

Try renaming/deleting your local .emacs.d directory. emacs-28.2-4 is compiled without native compilation, so if you try to load an .emacs.d directory with natively compiled packages I can imagine there to be problems.

My setup redownloads missing packages automatically; the UCRT64 build of emacs-28.2-4 seems to manage this. Other than that though, emacs-28.2-4 still seems pretty broken:

  • I get high CPU utilization if I restart emacs a second time after all packages had been reinstalled on the first bootup. I believe there might be issues with loading byte-compiled packages, the emacs profiler generates the following output after launching:
         132  67% - command-execute
         132  67%  - call-interactively
         132  67%   - byte-code
         132  67%    - read-extended-command
         132  67%     - completing-read
         132  67%        completing-read-default
          65  32% - timer-event-handler
          65  32%  - apply
          65  32%   + #<compiled 0x184bb7e9b30aa3fd>
           0   0% + ...
  • I cannot open .tex files, but my setup is somewhat elaborate, using AUCTeX, company, company-auctex, reftex-mode, flyspell and guess-tex-master (this last one isn't available on MELPA).
  • @svraka's bug with the async command persists.

BTW, there's a possibly related issue in the upstream bug tracker, at least as far as native compilation is concerned: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63365

@oscarfv
Copy link
Contributor

oscarfv commented May 24, 2023

@cyrilarnould : removing .emacs.d is quite blunt, there are quite a few things there besides .eln files. Emacs will ignore native-compiled .eln files if it was built without nativecomp support.

OTOH, the problem existed previous to the release of gcc 13.

Emacs is utterly broken in MinGW-w64. I have some ideas about the potential problematic areas (too convoluted to explain), but I have no time to investigate at this moment.

@Biswa96 : is it posible to re-release a previously-built package so it overrides current version of the package? That is, publish emacs-28.2-5 containing the same verbatim binary files as emacs-28.2-2.

@Biswa96
Copy link
Member

Biswa96 commented May 24, 2023

is it posible to re-release a previously-built package so it overrides current version of the package?

Unfortunately, I do not think it is possible to do that. Packages should be compiled from source code.

Emacs is utterly broken in MinGW-w64.

Then we should wait for upstream to fix the issue.

Though it is easy to downgrade package. For example, older mingw64 emacs can be installed with this command.

pacman -U https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-emacs-28.2-2-any.pkg.tar.zst

To prevent pacman to update the package, add the package name (like mingw-w64-x86_64-emacs) in IgnorePkg= line in /etc/pacman.conf file.

@oscarfv
Copy link
Contributor

oscarfv commented May 24, 2023

is it posible to re-release a previously-built package so it overrides current version of the package?

Unfortunately, I do not think it is possible to do that. Packages should be compiled from source code.

"Compile" has a broad meaning :-)

Someone (TM) can make a new PKGBUILD that overrides emacs and is "compiled" by getting the contents from emacs-28.2-2. Horrible, I know, but it would resolve the problem for those users who neither are pacman-savvy nor monitor this issue tracker.

Then we should wait for upstream to fix the issue.

The Emacs project has very limited Windows-related manpower. So I'm afraid that this will have to wait until I or someone else have several free hours to look into it.

@kotsu63
Copy link
Author

kotsu63 commented May 29, 2023

Today, I took the update procedures with pacmn -Syuu and the updated emacs appears to function perfectly as ``mingw-w64-x86_64-emacs-28.2-2-any.pkg.tar.zst.'' The updated version is 28-2-5 and let me see how it function from now when you make some operations with it.

@kotsu63
Copy link
Author

kotsu63 commented May 29, 2023

Today, I took the update procedures with pacmn -Syuu and the updated emacs appears to function perfectly as ``mingw-w64-x86_64-emacs-28.2-2-any.pkg.tar.zst.'' The updated version is 28-2-5 and let me see how it function from now when you make some operations with it.

So far, there is no problem for any type of operations, using emacs 28-2-5. I guess that somebody in the upstream has addressed the fundamental issue.

@svraka
Copy link
Contributor

svraka commented May 29, 2023

So far, there is no problem for any type of operations, using emacs 28-2-5. I guess that somebody in the upstream has addressed the fundamental issue.

No, it was fixed in #17342 but the root cause needs further investigations, see #17343. Nevertheless, I think this issue should be closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants