This paper presents the rst approximation method of the nite-failure set of a logic program by set-based analysis. In a dual view, the method yields a type analysis for programs with ongoing behaviors (perpetual processes). Our technical contributions are (1) the semantical characterization of nite failure of logic programs over in nite trees and (2) the design and soundness proof of the rst set-based analysis of logic programs with the greatest-model semantics. Finally, we exhibit the connection between nite failure and the inevitability of the `inconsistentstore' error in fair executions of concurrent constraint programs where no process suspends forever. This indicates a potential application to error diagnosis for concurrent constraint programs