[
https://issues.apache.org/jira/browse/LUCENENET-554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14604694#comment-14604694
]
Thomas D commented on LUCENENET-554:
------------------------------------
The exception is:
{noformat}
An unhandled exception of type 'System.AccessViolationException' occurred in
HDIndexing.dll
Additional information: Attempted to read or write protected memory. This is
often an indication that other memory is corrupt
{noformat}
The call stack doesn't give any info, the crash is when calling the Lucene API
from my function:
{noformat}
>
> HDIndexing.dll!Indexing.Indexer.SearchAllForThumbs(Common.Common.SearchFlags
> Flags, int Skip, int Limit) Line 101 C#
ReIndex.exe!ReIndex.Program.Main(string[] Arguments) Line 22 C#
[Native to Managed Transition]
Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
Unknown
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext
executionContext, System.Threading.ContextCallback callback, object state,
bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext
executionContext, System.Threading.ContextCallback callback, object state,
bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext
executionContext, System.Threading.ContextCallback callback, object state)
Unknown
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() Unknown
{noformat}
The disassembly, on the other hand, shows the problem:
{noformat}
var Hits0 = _Searcher.Search(ParsedQuery, null, Skip +
Limit, SortSetting);
00007FFF856C3613 mov rax,qword ptr [rbp+330h]
00007FFF856C361A mov rax,qword ptr [rax+18h]
00007FFF856C361E mov qword ptr [rbp+0F8h],rax
00007FFF856C3625 mov eax,dword ptr [rbp+348h]
00007FFF856C362B mov r9d,dword ptr [rbp+340h]
00007FFF856C3632 add r9d,eax
00007FFF856C3635 mov rcx,qword ptr [rbp+0F8h]
00007FFF856C363C mov r10,qword ptr [rbp+0F8h]
00007FFF856C3643 mov r10,qword ptr [r10]
00007FFF856C3646 mov r10,qword ptr [r10+40h]
00007FFF856C364A mov rax,qword ptr [rbp+2E8h]
00007FFF856C3651 mov qword ptr [rsp+20h],rax
00007FFF856C3656 xor r8d,r8d
00007FFF856C3659 mov rdx,qword ptr [rbp+300h]
00007FFF856C3660 call qword ptr [r10+38h] <--- THE CRASH OCCURS HERE
00007FFF856C3664 mov qword ptr [rbp+100h],rax
00007FFF856C366B mov rax,qword ptr [rbp+100h]
00007FFF856C3672 mov qword ptr [rbp+2E0h],rax
{noformat}
It is crashing when calling the API method itself.
> Crash using the search function
> --------------------------------
>
> Key: LUCENENET-554
> URL: https://issues.apache.org/jira/browse/LUCENENET-554
> Project: Lucene.Net
> Issue Type: Bug
> Components: .NET API, Lucene.Net Core
> Affects Versions: Lucene.Net 3.0.3
> Environment: .NET 4.5.3
> Reporter: Thomas D
> Priority: Critical
> Labels: Crash
>
> I can repeat the crash with with the following code:
> {code:java}
> Document.Add(new NumericField("TimeStamp", Field.Store.YES,
> true).SetLongValue(Data.TimeStamp.ToBinary()));
> {code}
>
> And I have the following query:
> {code:java}
> var Sort = new Sort(new SortField("TimeStamp", SortField.LONG, true));
> var ParsedQuery = ParseQuery(_Parser, SearchQuery);
> var Filter = new QueryWrapperFilter(ParsedQuery);
> var Hits = _Searcher.Search(ParsedQuery, Filter, Skip + Limit, Sort);
> {code}
>
> But it crashes when executing the search method with the following:
> {noformat}
> A first chance exception of type
> 'Lucene.Net.QueryParsers.QueryParser.LookaheadSuccess' occurred in
> Lucene.Net.dll
> A first chance exception of type 'System.IO.IOException' occurred in
> Lucene.Net.dll
> A first chance exception of type 'System.IO.IOException' occurred in
> Lucene.Net.dll
> A first chance exception of type 'System.AccessViolationException' occurred
> in HDIndexing.dll
> Additional information: Attempted to read or write protected memory. This is
> often an indication that other memory is corrupt.
> {noformat}
> The weird thing is that when executing this code:
> {code:java}
> var Hits = _Searcher.Search(ParsedQuery, null, Skip + Limit, Sort.RELEVANCE);
> var SortSetting = Sort.RELEVANCE;
> var Hits0 = _Searcher.Search(ParsedQuery, null, Skip + Limit, SortSetting);
> {code}
> The first call doesn't crash, but the second one does.
> When looking at the disassembly, the crash happens when calling the search
> method (http://imgur.com/MFmAwzC).
> I made a video illustrating the problem: http://imgur.com/NGyFRdS
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)