[Haskell-cafe] segfault depending on code position in source file
Damien Mattei
damien.mattei at gmail.com
Thu Feb 21 18:21:29 UTC 2019
i had attached the whole file, so anyone can read the whole code, perheaps
it could help, saying me if there is compilation error on other ghc
versions, with mine no error at compilation.
The problem to test is that without the database connection which is behind
a firewall of course ,the code can not be executed.
Me i have no more idea, i will install tomorrow an earlier version of ghc
and continue to test.... if it's really a problem i could output the
partial result and continue in another language such as Racket or Python...
but i'm not at this point and hope to continue with Haskell...
Damien
On Thu, Feb 21, 2019 at 5:35 PM Artem Pelenitsyn <a.pelenitsyn at gmail.com>
wrote:
> Damien,
>
> It is really hard to tell anything without the ability to reproduce the
> problem on other systems. Try to come up with some example which is easy to
> get running AND segfaulting on other computers, so that we could play with
> it. Maybe post the minimal code in separate github repo and provide the
> link.
>
> --
> Best, Artem
>
> On Thu, 21 Feb 2019 at 10:14 Damien Mattei <damien.mattei at gmail.com>
> wrote:
>
>> my code is structured like this , in summary:
>>
>>
>> -- this function will return th N°BD from Sidonie for a given name
>> -- note: names have been standardized between Sidonie and WDS
>> getAlphaDelta :: Connection -> String -> IO (Double,Double)
>> getAlphaDelta conn name = do
>> let qry_head_AlphaDelta_AngularDistance = "select alpha,delta
>> from AngularDistance where Nom = ?" :: Query
>> (alpha_delta_rows :: [(Double,Double)]) <- query conn
>> qry_head_AlphaDelta_AngularDistance (Only (name::String))
>> -- putStrLn $ show alpha_delta_rows
>> return (head alpha_delta_rows)
>>
>>
>> main =
>>
>> do
>> conn <- connect defaultConnectInfo
>> { connectHost = "moita",
>> connectUser = "mattei",
>> connectPassword = "sidonie2",
>> connectDatabase = "sidonie" }
>>
>>
>> -- check getAlphaDelta works:
>>
>> let name3 = "A 7"
>> putStrLn $ show name3
>> ad3 <- getAlphaDelta conn name3
>> putStr "ad3 ="
>> putStrLn $ show ad3
>>
>> this works i got result such as:
>> "A 7"
>> ad3 =(11297.0,-619.0)
>>
>>
>> if i move the 5 lines of code at the end of file it segfault
>>
>> between the begin and end i have some DB connection and queriung ,
>> filtering, mapping...
>>
>>
>> any idea?
>>
>> should i really upgrade the version of GHCI?
>>
>> Damien
>> _______________________________________________
>> Haskell-Cafe mailing list
>> To (un)subscribe, modify options or view archives go to:
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>> Only members subscribed via the mailman list are allowed to post.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20190221/8e33ad71/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UpdateSidonie.hs
Type: application/octet-stream
Size: 18701 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20190221/8e33ad71/attachment.obj>
More information about the Haskell-Cafe
mailing list