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

json_ptr.hpp:514:102: internal compiler error: Segmentation fault #158

Closed
chill1n opened this issue Feb 8, 2023 · 4 comments
Closed

json_ptr.hpp:514:102: internal compiler error: Segmentation fault #158

chill1n opened this issue Feb 8, 2023 · 4 comments

Comments

@chill1n
Copy link

chill1n commented Feb 8, 2023

Building with GCC 10.3 (-std=c++20) on Ubuntu 20.04 and cmake 3.22.0 I get the following issue during build:

/home/developer/workspace/test/glaze/release/_deps/glaze-src/include/glaze/json/json_ptr.hpp: In function ‘constexpr bool glz::valid()’:
/home/developer/workspace/test/glaze/release/_deps/glaze-src/include/glaze/json/json_ptr.hpp:514:102: internal compiler error: Segmentation fault
514 | using G = member_getter<V, glz::detail::string_literal_from_view<key_str.size()>(key_str)>;
| ^
0x7f275468208f ???
/build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x7f2754663082 __libc_start_main
../csu/libc-start.c:308
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.

In the project I would like to use glaze I'm restricted to gcc 10.3.0 at this moment.
Is there a way to work-around this issue?

You should be able to reproduce this using the code snippet:

#include <glaze/glaze.hpp>

int main()
{

    glz::recorder<double, float> rec;

    double x = 0.0;
    float y = 0.f;

    rec["x"] = x;
    rec["y"] = y;

    for (int i = 0; i < 100; ++i) {
       x += 1.5;
       y += static_cast<float>(i);
       rec.update(); // saves the current state of x and y
    }

    glz::write_file_json(rec, "recorder_out.json");
    
}
@stephenberry
Copy link
Owner

We'll have to look into whether we can get gcc 10 to work. Right now we're just supporting gcc 11 and beyond. Thanks for pointing this out.

@stephenberry
Copy link
Owner

After looking more at the gcc 10 support for C++20 I just don't think we'll be able to support that compiler version. We're trying to embrace C++20 with Glaze and gcc 10 just lacks too many useful features from C++20. Sorry for this inconvenience.

@mwalcott3 mwalcott3 added the wontfix This will not be worked on label Feb 21, 2023
@mwalcott3 mwalcott3 removed the wontfix This will not be worked on label Mar 6, 2023
@mwalcott3
Copy link
Collaborator

gcc10 support was added by @fregate in #190 and has been added as a tested compiler in the in #199.

@chill1n
Copy link
Author

chill1n commented Mar 11, 2023

Very nice, and thanks a lot. But I already migrated to gcc-11 to enjoy more of c++20. :)
I'm sure this will increase the application range for glaze, though.

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

No branches or pull requests

3 participants