From 994485a855267dda40f6d656c33f4ec68903fda8 Mon Sep 17 00:00:00 2001 From: defanor Date: Fri, 23 Feb 2018 18:33:50 +0300 Subject: Force the triples with deepseq Not quite sure if it's the proper fix, but appears to fix an occasional segfault on RDF reading. --- Text/Pandoc/Readers/RDF.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Text/Pandoc/Readers/RDF.hs') diff --git a/Text/Pandoc/Readers/RDF.hs b/Text/Pandoc/Readers/RDF.hs index 23d3ca7..0d9aa26 100644 --- a/Text/Pandoc/Readers/RDF.hs +++ b/Text/Pandoc/Readers/RDF.hs @@ -48,6 +48,7 @@ import System.Directory ( getXdgDirectory, XdgDirectory(..) , createDirectoryIfMissing ) import Control.Monad (zipWithM) import Data.Maybe (mapMaybe) +import Control.DeepSeq import Redland @@ -157,8 +158,9 @@ readRDF bu rf t = do cacheDir <- getXdgDirectory XdgCache "pancake" createDirectoryIfMissing True cacheDir withWSMU "hashes" [("hash-type", "bdb"), ("dir", cacheDir)] - "rdf-cache" "" (uriToString id bu "") $ \world' _ model' _ -> - mapM (readTriple (world', model')) $ prepareTriples triples + "rdf-cache" "" (uriToString id bu "") $ \world' _ model' _ -> do + r <- mapM (readTriple (world', model')) $ prepareTriples triples + r `deepseq` pure r readTriple :: ( ForeignPtr RedlandWorld , ForeignPtr RedlandModel) -> Triple @@ -170,3 +172,4 @@ readRDF bu rf t = do -- rdfproc rdf-cache parse http://xmlns.com/foaf/0.1/ -- rdfproc rdf-cache parse http://www.w3.org/1999/02/22-rdf-syntax-ns +-- rdfproc rdf-cache parse http://www.w3.org/2000/01/rdf-schema -- cgit v1.2.3