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

AssertError #45

Open
prabhu opened this issue Dec 13, 2023 · 4 comments
Open

AssertError #45

prabhu opened this issue Dec 13, 2023 · 4 comments

Comments

@prabhu
Copy link

prabhu commented Dec 13, 2023

Facing the below error when trying to generate bindings with the master.

core.exception.AssertError@src/google/protobuf/internal.d(47): Assertion failure
----------------
??:? _d_assertp [0x4e3df0]
src/google/protobuf/internal.d:47 const ubyte google.protobuf.internal.Varint.opIndex(ulong) [0x4d9cdf]
src/google/protobuf/internal.d:43 const @property ubyte google.protobuf.internal.Varint.front() [0x4d9c8e]
/home/prabhu/dlang/dmd-2.106.0/linux/bin64/../../src/phobos/std/range/package.d:1094 @property ubyte std.range.chain!(google.protobuf.internal.Varint, std.range.chain!(google.protobuf.internal.Varint, ubyte[]).chain(google.protobuf.internal.Varint, ubyte[]).Result).chain(google.protobuf.internal.Varint, std.range.chain!(google.protobuf.internal.Varint, ubyte[]).chain(google.protobuf.internal.Varint, ubyte[]).Result).Result.front() [0x4bbfc7]
/home/prabhu/dlang/dmd-2.106.0/linux/bin64/../../src/phobos/std/range/package.d:1094 @property ubyte std.range.chain!(std.range.chain!(google.protobuf.internal.Varint, std.range.chain!(google.protobuf.internal.Varint, ubyte[]).chain(google.protobuf.internal.Varint, ubyte[]).Result).chain(google.protobuf.internal.Varint, std.range.chain!(google.protobuf.internal.Varint, ubyte[]).chain(google.protobuf.internal.Varint, ubyte[]).Result).Result, google.protobuf.internal.sizedJoiner!(std.algorithm.iteration.MapResult!(google.protobuf.encoding.toProtobufByProto!(google.protobuf.common.Proto(15, 0, 0), google.protobuf.compiler.plugin.CodeGeneratorResponse.File[]).toProtobufByProto(google.protobuf.compiler.plugin.CodeGeneratorResponse.File[]).__lambda3, google.protobuf.compiler.plugin.CodeGeneratorResponse.File[]).MapResult).sizedJoiner(std.algorithm.iteration.MapResult!(google.protobuf.encoding.toProtobufByProto!(google.protobuf.common.Proto(15, 0, 0), google.protobuf.compiler.plugin.CodeGeneratorResponse.File[]).toProtobufByProto(google.protobuf.compiler.plugin.CodeGeneratorResponse.File[]).__lambda3, google.protobuf.compiler.plugin.CodeGeneratorResponse.File[]).MapResult).Result).chain(std.range.chain!(google.protobuf.internal.Varint, std.range.chain!(google.protobuf.internal.Varint, ubyte[]).chain(google.protobuf.internal.Varint, ubyte[]).Result).chain(google.protobuf.internal.Varint, std.range.chain!(google.protobuf.internal.Varint, ubyte[]).chain(google.protobuf.internal.Varint, ubyte[]).Result).Result, google....
/home/prabhu/dlang/dmd-2.106.0/linux/bin64/../../src/phobos/std/array.d:132 ubyte[] std.array.array!(std.range.chain!(std.range.chain!(google.protobuf.internal.Varint, std.range.chain!(google.protobuf.internal.Varint, ubyte[]).chain(google.protobuf.internal.Varint, ubyte[]).Result).chain(google.protobuf.internal.Varint, std.range.chain!(google.protobuf.internal.Varint, ubyte[]).chain(google.protobuf.internal.Varint, ubyte[]).Result).Result, google.protobuf.internal.sizedJoiner!(std.algorithm.iteration.MapResult!(google.protobuf.encoding.toProtobufByProto!(google.protobuf.common.Proto(15, 0, 0), google.protobuf.compiler.plugin.CodeGeneratorResponse.File[]).toProtobufByProto(google.protobuf.compiler.plugin.CodeGeneratorResponse.File[]).__lambda3, google.protobuf.compiler.plugin.CodeGeneratorResponse.File[]).MapResult).sizedJoiner(std.algorithm.iteration.MapResult!(google.protobuf.encoding.toProtobufByProto!(google.protobuf.common.Proto(15, 0, 0), google.protobuf.compiler.plugin.CodeGeneratorResponse.File[]).toProtobufByProto(google.protobuf.compiler.plugin.CodeGeneratorResponse.File[]).__lambda3, google.protobuf.compiler.plugin.CodeGeneratorResponse.File[]).MapResult).Result).chain(std.range.chain!(google.protobuf.internal.Varint, std.range.chain!(google.protobuf.internal.Varint, ubyte[]).chain(google.protobuf.internal.Varint, ubyte[]).Result).chain(google.protobuf.internal.Varint, std.range.chain!(google.protobuf.internal.Varint, ubyte[]).chain(google.protobuf.internal.Varint, ubyte[]).Result).Result, google....
protoc_gen_d/protoc-gen-d.d:20 _Dmain [0x4d274f]
--d_out: protoc-gen-d: Plugin failed with status code 1.

Proto file: https://github.com/AppThreat/atom/blob/main/specification/atom.proto

protoc -I . --d_out=bindings/d atom.proto
@dcarp
Copy link
Owner

dcarp commented Jan 19, 2024

Looks similar to this #43 (comment)
Could you try it with v2.103.1?

@cyrusmsk
Copy link

cyrusmsk commented Feb 5, 2024

I can confirm that my .proto file generated with ldc1.33, and didn't work with ldc 1.36

@cyrusmsk
Copy link

cyrusmsk commented Mar 3, 2024

@dcarp Will it be possible to rewrite part of the code, that using chain(...).init.empty behavior? based on comments from the bugzilla that this is "undefined behavior" in the range API currently...

@cyrusmsk
Copy link

cyrusmsk commented Mar 3, 2024

Maybe use?
import std.traits : isArray;
static if (isArray!(typeof(res)))

from https://forum.dlang.org/post/[email protected]

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