You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Petr Baudis <pa...@ucw.cz> on 2015/05/23 00:21:35 UTC

CasCopier breakages in uimaj-2.7.0

  Hi!

  I'm trying to bring uimaj-2.7.0 to my code, but I'm hitting some
trouble with my CasCopier code:

  * alreadyCopied(FeatureStructure fs) is gone without an obvious
    replacement; it seems to me that

	alreadyCopied(((FeatureStructureImpl) fs).getAddress())

    is the correct replacement after digging somewhat at CasCopier
    source code, but is that even really right?  I guess this
    is a bug as that interface was public...


  * Even with the fix above, my code, e.g.

	https://github.com/brmson/yodaqa/blob/master/src/main/java/cz/brmlab/yodaqa/analysis/passextract/PassFilter.java#L67

crashes with

	Caused by: java.util.ConcurrentModificationException
		at org.apache.uima.cas.impl.FSIndexRepositoryImpl$LeafPointerIterator.checkConcurrentModification(FSIndexRepositoryImpl.java:967)
		at org.apache.uima.cas.impl.FSIndexRepositoryImpl$LeafPointerIterator.ll_get(FSIndexRepositoryImpl.java:1002)
		at org.apache.uima.cas.impl.FSIndexRepositoryImpl$LeafPointerIterator.get(FSIndexRepositoryImpl.java:995)
		at org.apache.uima.cas.impl.FSIteratorWrapper.get(FSIteratorWrapper.java:53)
		at org.apache.uima.cas.impl.FSIteratorImplBase.next(FSIteratorImplBase.java:67)
		at org.apache.uima.cas.impl.FSIteratorImplBase.next(FSIteratorImplBase.java:33)
		at cz.brmlab.yodaqa.analysis.passextract.PassFilter.process(PassFilter.java:74)
		at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
		at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:385)
		... 26 more

     so it appears I cannot iterate a source view and simultaneously
     copyFs() from it? What are the exact rules for this?  It seems
     rather contraintuitive to me, and should be documented.
     Using the new .withSnapshotIterator() feature helps to work-around
     this, but it means I need to uglify code currently using JCasUtil
     selects...

  Thanks,

-- 
				Petr Baudis
	If you do not work on an important problem, it's unlikely
	you'll do important work.  -- R. Hamming
	http://www.cs.virginia.edu/~robins/YouAndYourResearch.html

Re: CasCopier breakages in uimaj-2.7.0

Posted by Richard Eckart de Castilho <re...@apache.org>.
I am thinking of switching uimaFIT select to generally use the
withSnapshotIterator(). Any opinion?

-- Richard

On 23.05.2015, at 00:21, Petr Baudis <pa...@ucw.cz> wrote:

>  Hi!
> 
>  I'm trying to bring uimaj-2.7.0 to my code, but I'm hitting some
> trouble with my CasCopier code:
> 
>  * alreadyCopied(FeatureStructure fs) is gone without an obvious
>    replacement; it seems to me that
> 
> 	alreadyCopied(((FeatureStructureImpl) fs).getAddress())
> 
>    is the correct replacement after digging somewhat at CasCopier
>    source code, but is that even really right?  I guess this
>    is a bug as that interface was public...
> 
> 
>  * Even with the fix above, my code, e.g.
> 
> 	https://github.com/brmson/yodaqa/blob/master/src/main/java/cz/brmlab/yodaqa/analysis/passextract/PassFilter.java#L67
> 
> crashes with
> 
> 	Caused by: java.util.ConcurrentModificationException
> 		at org.apache.uima.cas.impl.FSIndexRepositoryImpl$LeafPointerIterator.checkConcurrentModification(FSIndexRepositoryImpl.java:967)
> 		at org.apache.uima.cas.impl.FSIndexRepositoryImpl$LeafPointerIterator.ll_get(FSIndexRepositoryImpl.java:1002)
> 		at org.apache.uima.cas.impl.FSIndexRepositoryImpl$LeafPointerIterator.get(FSIndexRepositoryImpl.java:995)
> 		at org.apache.uima.cas.impl.FSIteratorWrapper.get(FSIteratorWrapper.java:53)
> 		at org.apache.uima.cas.impl.FSIteratorImplBase.next(FSIteratorImplBase.java:67)
> 		at org.apache.uima.cas.impl.FSIteratorImplBase.next(FSIteratorImplBase.java:33)
> 		at cz.brmlab.yodaqa.analysis.passextract.PassFilter.process(PassFilter.java:74)
> 		at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
> 		at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:385)
> 		... 26 more
> 
>     so it appears I cannot iterate a source view and simultaneously
>     copyFs() from it? What are the exact rules for this?  It seems
>     rather contraintuitive to me, and should be documented.
>     Using the new .withSnapshotIterator() feature helps to work-around
>     this, but it means I need to uglify code currently using JCasUtil
>     selects...
> 
>  Thanks,
> 
> -- 
> 				Petr Baudis
> 	If you do not work on an important problem, it's unlikely
> 	you'll do important work.  -- R. Hamming
> 	http://www.cs.virginia.edu/~robins/YouAndYourResearch.html


Re: CasCopier breakages in uimaj-2.7.0

Posted by Petr Baudis <pa...@ucw.cz>.
  Hi!

On Sun, May 24, 2015 at 12:38:52AM -0400, Marshall Schor wrote:
> Hmmm, yes, it seems that the alreadyCopied method signature was accidentally
> changed.  Jiras issue https://issues.apache.org/jira/browse/UIMA-4428 was
> created for this, and the fix is done (in the trunk). 
> 
> Sorry about that!

  Thanks a lot!  You are right, I should've created jira issues about
this instead.  I've created an issue for the second problem I mentioned
now: https://issues.apache.org/jira/browse/UIMA-4463

  Best,

-- 
				Petr Baudis
	If you have good ideas, good data and fast computers,
	you can do almost anything. -- Geoffrey Hinton

Re: CasCopier breakages in uimaj-2.7.0

Posted by Marshall Schor <ms...@schor.com>.
Hmmm, yes, it seems that the alreadyCopied method signature was accidentally
changed.  Jiras issue https://issues.apache.org/jira/browse/UIMA-4428 was
created for this, and the fix is done (in the trunk). 

Sorry about that!

-Marshall

On 5/22/2015 6:21 PM, Petr Baudis wrote:
>   Hi!
>
>   I'm trying to bring uimaj-2.7.0 to my code, but I'm hitting some
> trouble with my CasCopier code:
>
>   * alreadyCopied(FeatureStructure fs) is gone without an obvious
>     replacement; it seems to me that
>
> 	alreadyCopied(((FeatureStructureImpl) fs).getAddress())
>
>     is the correct replacement after digging somewhat at CasCopier
>     source code, but is that even really right?  I guess this
>     is a bug as that interface was public...
>
>
>   * Even with the fix above, my code, e.g.
>
> 	https://github.com/brmson/yodaqa/blob/master/src/main/java/cz/brmlab/yodaqa/analysis/passextract/PassFilter.java#L67
>
> crashes with
>
> 	Caused by: java.util.ConcurrentModificationException
> 		at org.apache.uima.cas.impl.FSIndexRepositoryImpl$LeafPointerIterator.checkConcurrentModification(FSIndexRepositoryImpl.java:967)
> 		at org.apache.uima.cas.impl.FSIndexRepositoryImpl$LeafPointerIterator.ll_get(FSIndexRepositoryImpl.java:1002)
> 		at org.apache.uima.cas.impl.FSIndexRepositoryImpl$LeafPointerIterator.get(FSIndexRepositoryImpl.java:995)
> 		at org.apache.uima.cas.impl.FSIteratorWrapper.get(FSIteratorWrapper.java:53)
> 		at org.apache.uima.cas.impl.FSIteratorImplBase.next(FSIteratorImplBase.java:67)
> 		at org.apache.uima.cas.impl.FSIteratorImplBase.next(FSIteratorImplBase.java:33)
> 		at cz.brmlab.yodaqa.analysis.passextract.PassFilter.process(PassFilter.java:74)
> 		at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
> 		at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:385)
> 		... 26 more
>
>      so it appears I cannot iterate a source view and simultaneously
>      copyFs() from it? What are the exact rules for this?  It seems
>      rather contraintuitive to me, and should be documented.
>      Using the new .withSnapshotIterator() feature helps to work-around
>      this, but it means I need to uglify code currently using JCasUtil
>      selects...
>
>   Thanks,
>