-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
SIGSEGV when indexing nullable value tuple with value #4703
Comments
Thanks for reporting @leo-labs. Looks like |
Stack trace on netcoreapp3.1 on Windows
|
Thanks for investigating! On a different note, I would like to point out that the behavior with named value tuples is counterintuitive: If I have |
The semantic names are syntactical sugar that Roslyn can understand, but ultimately, the IL generates void Main()
{
var example = new ExampleDoc
{
tupleNullable = ("somestring", 42)
};
var info = example.tupleNullable.Value.info;
}
public class ExampleDoc
{
public (string info, int number)? tupleNullable { get; set; }
} generates the following IL
You can see that assigning the value of |
This commit adds special serialization handling for nullable ValueTuples. Specialized handling is required as without, a nullable ValueTuple type ends up falling into CustomDyanmicObjectResolver inside of NestFormatterResolver, which will build a dynamic formatter using MetaType et.al, which enumerates interfaces and can cause a CLR error when calling `at System.Runtime.CompilerServices.ITuple.get_Length()`. Fixes #4703
This commit adds special serialization handling for nullable ValueTuples. Specialized handling is required as without, a nullable ValueTuple type ends up falling into CustomDyanmicObjectResolver inside of NestFormatterResolver, which will build a dynamic formatter using MetaType et.al, which enumerates interfaces and can cause a CLR error when calling `at System.Runtime.CompilerServices.ITuple.get_Length()`. Fixes #4703
This commit adds special serialization handling for nullable ValueTuples. Specialized handling is required as without, a nullable ValueTuple type ends up falling into CustomDyanmicObjectResolver inside of NestFormatterResolver, which will build a dynamic formatter using MetaType et.al, which enumerates interfaces and can cause a CLR error when calling `at System.Runtime.CompilerServices.ITuple.get_Length()`. Fixes #4703
This commit adds special serialization handling for nullable ValueTuples. Specialized handling is required as without, a nullable ValueTuple type ends up falling into CustomDyanmicObjectResolver inside of NestFormatterResolver, which will build a dynamic formatter using MetaType et.al, which enumerates interfaces and can cause a CLR error when calling `at System.Runtime.CompilerServices.ITuple.get_Length()`. Fixes #4703
This commit adds special serialization handling for nullable ValueTuples. Specialized handling is required as without, a nullable ValueTuple type ends up falling into CustomDyanmicObjectResolver inside of NestFormatterResolver, which will build a dynamic formatter using MetaType et.al, which enumerates interfaces and can cause a CLR error when calling `at System.Runtime.CompilerServices.ITuple.get_Length()`. Fixes #4703
…4715) This commit adds special serialization handling for nullable ValueTuples. Specialized handling is required as without, a nullable ValueTuple type ends up falling into CustomDyanmicObjectResolver inside of NestFormatterResolver, which will build a dynamic formatter using MetaType et.al, which enumerates interfaces and can cause a CLR error when calling `at System.Runtime.CompilerServices.ITuple.get_Length()`. Fixes #4703 Co-authored-by: Russ Cam <russ.cam@elastic.co>
…4716) This commit adds special serialization handling for nullable ValueTuples. Specialized handling is required as without, a nullable ValueTuple type ends up falling into CustomDyanmicObjectResolver inside of NestFormatterResolver, which will build a dynamic formatter using MetaType et.al, which enumerates interfaces and can cause a CLR error when calling `at System.Runtime.CompilerServices.ITuple.get_Length()`. Fixes #4703 Co-authored-by: Russ Cam <russ.cam@elastic.co>
This is now fixed and nullable ValueTuples supported in 7.7.1 |
I'm facing this in ElasticSearch.Net 7.7.1, seems It's not able to serialize |
@xsoheilalizadeh |
@russcam, I'm already working on implementing its formatter, will make the issue for that. |
NEST/Elasticsearch.Net version:
7.6.1/7.7
Elasticsearch version:
7.6.2
Runtime/OS info
dotnet 3.1.201 on Mac OS X 10.14.4 (BuildVersion: 18E226)
Description of the problem including expected versus actual behavior:
Indexing a document that contains a property that is a nullable value tuple such as
(string info, int number)?
with a value that is not null produces aSIGSEGV
and the whole application crashes.Steps to reproduce:
The issue can be reproduced with the following code:
Expected behavior
The expected bahavior is to either throw an exception if this usecase is not supported or to successfully index the document
The text was updated successfully, but these errors were encountered: