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

Bug: std::println() and std::format() cause cosmoc++ to fail #1252

Open
jcbhmr opened this issue Aug 8, 2024 · 0 comments
Open

Bug: std::println() and std::format() cause cosmoc++ to fail #1252

jcbhmr opened this issue Aug 8, 2024 · 0 comments
Labels
medium severity Used to report medium severity bugs (e.g. Malfunctioning Features but still useable)

Comments

@jcbhmr
Copy link
Contributor

jcbhmr commented Aug 8, 2024

Contact Details

[email protected]

What happened?

Trying to use std::println() seems to cause cosmoc++ to hang and crash.

#include <print>

int main() {
  std::println("Hello {}!", "Ada Lovelace");
  return 0;
}
cosmoc++ -std=c++23 main.cpp
cosmoc++: x86_64 succeeded but aarch64 failed to build object
aarch64-linux-cosmo-g++: fatal error: SIGTERM signal terminated program cc1plus
compilation terminated.

The same program works fine with Zig v0.13.0 (Clang v18.1.6) zig c++

zig c++ -std=c++23 main.cpp
./a.out
Hello Ada Lovelace!

I'm using GitHub Codespaces default image. Ubuntu 20.04 x86_64

This same thing also happens with std::format().

#include <format>
#include <iostream>

int main() {
  std::cout << std::format("Hello {}!", "Alan Turing") << "\n";
  return 0;
}
x86_64-linux-cosmo-g++: fatal error: SIGTERM signal terminated program cc1plus
compilation terminated.

I ran it multiple times and it's weird: if I run cosmoc++ -std=c++23 main.cpp on either of the std::println() or std::format() programs there's like a 50/50 chance the x86_64 one will fail, or else it will succeed but the aarch64 one fails. I don't know what it is.

Version

cosmocc (GCC) 14.1.0

What operating system are you seeing the problem on?

Linux

Relevant log output

# std::println()
cosmoc++: x86_64 succeeded but aarch64 failed to build object
aarch64-linux-cosmo-g++: fatal error: SIGTERM signal terminated program cc1plus
compilation terminated.
# OR
x86_64-linux-cosmo-g++: fatal error: SIGTERM signal terminated program cc1plus
compilation terminated.



# std::format()
x86_64-linux-cosmo-g++: fatal error: SIGTERM signal terminated program cc1plus
compilation terminated.
# OR
cosmoc++: x86_64 succeeded but aarch64 failed to build object
aarch64-linux-cosmo-g++: fatal error: SIGTERM signal terminated program cc1plus
compilation terminated.
@jcbhmr jcbhmr added the medium severity Used to report medium severity bugs (e.g. Malfunctioning Features but still useable) label Aug 8, 2024
@jcbhmr jcbhmr changed the title Bug: std::println() causes cosmoc++ to fail Bug: std::println() and std::format() cause cosmoc++ to fail Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium severity Used to report medium severity bugs (e.g. Malfunctioning Features but still useable)
Projects
None yet
Development

No branches or pull requests

1 participant