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

Segfault after usage of Lucene::SnapshotDeletionPolicy snapshot / release #49

Open
alian555 opened this issue Oct 30, 2013 · 1 comment

Comments

@alian555
Copy link

Hi,

I"ve a bug I try to spot.
I can't reproduce from a simple test now. What I see is a crash after this operation:
Lucene::SnapshotDeletionPolicy snapshot
Lucene::SnapshotDeletionPolicy release
If I close the writer now, and repopen no problem.
But If I don't close it, and delete a document, I hit an exception as soon I've a writer->commit operation:

It's like the commit work on an old list of files, already deleted so it crash when it go in deref.
#0 0x00007f8a5bff73d5 in raise () from /lib64/libc.so.6
#1 0x00007f8a5bff8858 in abort () from /lib64/libc.so.6
#2 0x00007f8a5bff02e2 in __assert_fail_base () from /lib64/libc.so.6
#3 0x00007f8a5bff0392 in __assert_fail () from /lib64/libc.so.6
#4 0x00007f8a5e63c765 in Lucene::RefCount::DecRef (this=) at /home/albert/albert/LucenePlusPlus/src/core/index/IndexFileDeleter.cpp:444
#5 0x00007f8a5e63e783 in Lucene::IndexFileDeleter::decRef (this=0x7f8a4c031fd0, fileName=...)

at /home/albert/albert/LucenePlusPlus/src/core/index/IndexFileDeleter.cpp:341

#6 0x00007f8a5e640ca6 in Lucene::IndexFileDeleter::deleteCommits (this=0x7f8a4c031fd0) at /home/albert/albert/LucenePlusPlus/src/core/index/IndexFileDeleter.cpp:181
#7 0x00007f8a5e642980 in Lucene::IndexFileDeleter::checkpoint (this=0x7f8a4c031fd0, segmentInfos=..., isCommit=)

at /home/albert/albert/LucenePlusPlus/src/core/index/IndexFileDeleter.cpp:279

#8 0x00007f8a5e6fc5b1 in Lucene::IndexWriter::finishCommit (this=0x7f8a4c02c7c0) at /home/albert/albert/LucenePlusPlus/src/core/index/IndexWriter.cpp:2216
#9 0x00007f8a5e6f65a7 in Lucene::IndexWriter::commit (this=0x7f8a4c02c7c0,

commitUserData=<error reading variable: DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjunction with DW_OP_piece or DW_OP_bit_piece.>) at /home/albert/albert/LucenePlusPlus/src/core/index/IndexWriter.cpp:2195

#10 0x00007f8a5e6fae76 in Lucene::IndexWriter::commit (this=0x4d0f) at /home/albert/albert/LucenePlusPlus/src/core/index/IndexWriter.cpp:2170

If I do the same without snapshot / release of course no problem. Any clue ?

Thanks !

@alian555
Copy link
Author

Ok I found from where it's come, not sure it's a bug ... As the snapshot() method never give "segments.gen", I add it to my method:

bool BaseLucene::Snapshot( Lucene::HashSet< Lucene::String > &files) {
Lucene::SnapshotDeletionPolicyPtr pol = _writer_acces[_dbname].pol;
Lucene::IndexCommitPtr commit = pol->snapshot();
files = commit->getFileNames();
files.add(Lucene::String(L"segments.gen"));
return true;
}

But on the next commit of lucene, it will try to decRef this "segments.gen" and of course crash ... files is not a copy, but a pointer, so if I update files, I update in the same time the list of commit.

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

1 participant