Veit,

Apparently Ben has been working on the same issues on his branch. I applied
your patches along with his work, plus some more cleanup, into the
atomicthreads branch. Unfortunately, while it compiles and runs perfectly
well on Win32, it throws Segmentation Fault on my Ubuntu machine. Since the
ben_working branch compiles and runs just fine, I might have overridden an
important change while merging the various committs into something that
makes sense, or some of your changes contradict one another. Can you look
into that (note: Ben's branch is using Boost)?

Another important thing to note is the LuceneBase class, which is being used
by the thread-safe classes to define an _LUCENE_ATOMIC_INT to refcount with.
This probably has impact on your smartpointers work.

Itamar. 

-----Original Message-----
From: Veit Jahns [mailto:nuncupa...@googlemail.com] 
Sent: Wednesday, April 14, 2010 3:46 PM
To: clucene-developers@lists.sourceforge.net
Subject: Re: [CLucene-dev] Multithreaded write and search

Itamar and all,

attached the patches solving this issue.

- ThreadLocal.cpp.diff: Unregistering the current thread, if a thread local
storage is destroyed.
- FieldsReader.cpp.diff: One of my colleagues observed that uninitialized
variables may also lead to crashes in this scenario too.
In particular, if exceptions are caught and ignored. Then these fields stay
uninitialized but will be used afterwards.
- CompoundFile.cpp.diff: ditto

Our systems seems to run very stable now with these patches.

Kind regards,

Veit

2010/3/24 Veit Jahns <nuncupa...@googlemail.com>:
> Itamar,
>
> thank you for your answer!
>
>> What OS / compiler were you testing this with?
>
> I tested with Vista/VS9 and Linux/gcc-4.4.1. This error occurs with 
> both OS/compilers.
>
>> I'm not sure, but this could
>> be due to the same threading issue we already aware of. Were you able 
>> to run the atomic tests from the test suite successfully?
>
> Yes the atomic tests run successfully. But if I add
>
> Term term(_T("id"), _T("ten"));
> TermDocs* td = r->termDocs(&term);
> _CLDELETE(td);
>
> to atomicSearchTest (diff attached), then I get the same error. I 
> investigated it a little bit and my assumption is that the reason for 
> this error lies the ThreadLocal class:
>
> If the IndexReader or the IndexSearcher is created and deleted within 
> a thread, then they will also delete their ThreadLocal object and its 
> content. But this object is also added to the ThreadLocals map, but 
> not removed, when the thread itself deletes the ThreadLocal object. As 
> a consequence the program tries to reference an already deleted object 
> (in ThreadLocal::setNull()) during the unregistration of a thread.
>
> This error don't occur, if nothing is put into the thread local 
> storage, which happens in the original atomic tests.
>
> Maybe this problem is the same which Celto reported some months ago [1].
>
> I will try to fix this error. But any suggestions are much appreciated.
>
>> In the meantime,
>> try perhaps applying the threading related fixes Ben has pushed 
>> recently to his branch (ben_working), and let me know how it goes.
>
> I did, but they don't changed anything.
>
> Kind regards,
>
> Veit
>
> [1] 
>
http://sourceforge.net/tracker/?func=detail&aid=2900857&group_id=80013&atid=
558446
>



------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers

Reply via email to