Comments (7)
@jbbjarnason, I discovered this last night as well, as my company uses gcc 13 in production. I do not currently have a bugzilla account, so feel free to go ahead and report this. I'm going to try to simplify the code this morning so that gcc will build. I was able to simplify the code last night so that the compiler no longer segfaults, but its errors are bogus.
from glaze.
So this is a problem with gcc 13, I added a PR with gcc 13 in github workflows here, #605 which reproduces the error.
@stephenberry do you have an account at gcc bugzilla or should I make one to report this?
from glaze.
Here is a simplified test that causes the segfault:
struct put_action
{
};
struct delete_action
{
};
using tagged_variant = std::variant<put_action, delete_action>;
template <>
struct glz::meta<tagged_variant>
{
static constexpr std::string_view tag = "action";
static constexpr auto ids = std::array{"PUT", "DELETE"}; // Defaults to glz::name_v of the type
};
suite tagged_variant_tests = [] {
"tagged_variant_read_tests"_test = [] {
tagged_variant var{};
expect(glz::read_json(var, R"({})") == glz::error_code::none);
};
};
from glaze.
you two rock. sad about the error, but good finds
from glaze.
I found a workaround, for some reason GCC 13 is corrupting the capture by reference for std::array<std::string_view, get_max_keys<T, N>> data{};
This is for the function: get_combined_keys_from_variant
The fix is that we can just change this to a pointer and GCC will properly capture the pointer:
auto* data_ptr = &data; // This intermediate pointer is necessary for GCC 13 (otherwise segfaults with reflection logic)
from glaze.
Fixed in #605
from glaze.
Great job
from glaze.
Related Issues (20)
- The executable glaze_ide is built but not installed HOT 2
- Need more examples and improved documentation HOT 5
- Add support for unions (like variants) HOT 9
- Document current support and add more support for JSON Merge Patch
- `validate_json` returns `syntax_error` if buffer contains non-ASCII chars HOT 3
- Support 0 and 1 as boolean values HOT 1
- Bazel support HOT 2
- ASIO REPE example bad file descriptor error HOT 2
- minify_json compiler errors when including header directly HOT 5
- Function signatures inconsistency between write_file_json and read_file_json HOT 2
- Stack overflow when returning intermediate object to serialize in_addr HOT 6
- Bug: Malformed JSON string produced HOT 10
- Build and test for 32-bit in Actions
- std::pair arrays roundtrip
- `float` member issue with `clang++-15` and `g++-12` HOT 3
- `json_test.cpp(7840): warning C4267: '=': conversion from 'size_t' to 'uint16_t', possible loss of data` HOT 1
- glz::reader/glz::writer for incremental reading/writing HOT 5
- Partial read for BEVE
- glz::raw without quotes question HOT 1
- Binary serialization of hidden members HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glaze.