<div dir="ltr"><div class="gmail_default" style="font-size:large">well , good news :-)</div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">i tested the same code on a 64 bits Linux Centos 7.2 with GHC 8.4 and it works fine...</div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">so the problem is only under 32bits Linux Fedora Core 29 with GHC 8.2</div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">we had a system failure or security issue last month and i had to upgrade the 32 bit CPU 3 weeks ago to latest Linux Fedora Core version</div><div class="gmail_default" style="font-size:large">but this had the side effect to downgrade the Haskell GHC compiler to 8.2 version <br></div><div class="gmail_default" style="font-size:large">and the 8.2 version or 32 bit platform have bugs <br></div><div class="gmail_default" style="font-size:large">if i can i will try to test with the 8.4 GHC on the 32 bit platform to see if the problem was with 32bit vs 64bit; possible difference with Fedora and CentOS also, but i think it's the 8.2 compiler that cause the bug...</div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">regards,</div><div class="gmail_default" style="font-size:large">damien<br> </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 22, 2019 at 10:55 AM Damien Mattei <<a href="mailto:damien.mattei@gmail.com">damien.mattei@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:large">well i understand the difficulty, i just pos because ,really some times i get incredible help that i coulmdn not even think it possible.</div><div class="gmail_default" style="font-size:large">i admit the code is and the database connection is a stop help.</div><div class="gmail_default" style="font-size:large">for the database i cannot do ,for the code i commented a lot  and i can resume with this concise code that recreate the problem:</div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">it's quite simple i noticed that after one lines (see in code the lines and the upper case comments) the query to DB in getAlphaDelta does not works anymore (as it worked before ) but other functions making queries works that what is strange...<br></div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">{-# LANGUAGE OverloadedStrings #-}<br>{-# LANGUAGE ScopedTypeVariables #-}<br>{-# LANGUAGE FlexibleInstances #-}<br>{-# LANGUAGE MultiParamTypeClasses #-}<br></div><div class="gmail_default" style="font-size:large">import Database.MySQL.Simple<br>import Database.MySQL.Simple.QueryResults<br>import Database.MySQL.Simple.Result<br><br>import Database.MySQL.Simple.QueryParams<br>import Database.MySQL.Simple.Param<br><br><br>import Control.Monad<br>import qualified Data.Text as Tx<br>import Debug.Trace<br>import Data.Maybe as Maybe<br>import Text.Read<br>import Data.Tuple.Extra</div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">getAlphaDelta :: Connection -> String -> IO (Double,Double)<br>getAlphaDelta conn name = do<br>            let qry_head_AlphaDelta_AngularDistance = "select alpha,delta from AngularDistance where Nom = ?" :: Query<br>            (alpha_delta_rows :: [(Double,Double)]) <- query conn qry_head_AlphaDelta_AngularDistance (Only (name::String))<br>            return (head alpha_delta_rows)<br></div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">main :: IO ()<br><br>main =<br><br>  do<br>    conn <- connect defaultConnectInfo<br>      { connectHost = "moita",<br>        connectUser = "mattei",<br>        connectPassword = "sidonie2",<br>        connectDatabase = "sidonie" }<br><br><br>-- check getAlphaDelta works:</div><div class="gmail_default" style="font-size:large">-- HERE getAlphaDelta WORKS<br></div><div class="gmail_default" style="font-size:large">    let name = "WOR   7"<br>    putStrLn $ show name<br>    ad <- getAlphaDelta conn name<br>    putStr "ad ="<br>    putStrLn $ show ad<br><br>    (names ::[Only Tx.Text])<- query_ conn "SELECT Nom FROM AngularDistance WHERE distance > 0.000278"<br></div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">-- AFTER THE PREVIOUS LINE getAlphaDelta WILL NOT WORKS AND ISSUE A SEGFAULT IN GHCI<br></div><div class="gmail_default" style="font-size:large">    let name3 = "A     7"<br>    putStrLn $ show name3<br>    ad3 <- getAlphaDelta conn name3<br>    putStr "ad3 ="<br>    putStrLn $ show ad3<br></div></div></div></div></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><div style="font-size:large" class="gmail_default">close conn</div><br></div><div dir="ltr"><br></div><div dir="ltr"><div style="font-size:large" class="gmail_default">here is the output:</div><div style="font-size:large" class="gmail_default"><br></div><div style="font-size:large" class="gmail_default">[mattei@localhost Haskell]$ ghci<br>GHCi, version 8.2.2: <a href="http://www.haskell.org/ghc/" target="_blank">http://www.haskell.org/ghc/</a>  :? for help<br>Prelude> :load UpdateSidonie.hs<br>[1 of 1] Compiling Main             ( UpdateSidonie.hs, interpreted )<br>Ok, one module loaded.<br>*Main> main<br>"WOR   7"<br>ad =(17386.0,7120.0)<br>"A     7"<br>Segmentation fault (core dumped)</div><div style="font-size:large" class="gmail_default"><br></div><div style="font-size:large" class="gmail_default">as you see the first call to getAlphaDelta is ok but the second issue a Segmentation fault.</div><div style="font-size:large" class="gmail_default"><br></div><div style="font-size:large" class="gmail_default">i will try now with ghci 8.4 .... and hiope to give you some news...</div><div style="font-size:large" class="gmail_default"><br></div><div style="font-size:large" class="gmail_default">Damien<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 21, 2019 at 8:15 PM Sven Panne <<a href="mailto:svenpanne@gmail.com" target="_blank">svenpanne@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Am Do., 21. Feb. 2019 um 19:22 Uhr schrieb Damien Mattei <<a href="mailto:damien.mattei@gmail.com" target="_blank">damien.mattei@gmail.com</a>>:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-size:large">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.</div></div></blockquote><div><br></div><div>I very much doubt that anyone likes to read >500 lines of Haskell code with lots of external dependencies to help you with your problem. A good hint for Open Source SW in general: If you think you might have found a bug, cut down your example as much as possible, throw out as many external dependencies as you can while still reproducing your problem, then, and only then, post it to other people. You simply can't expect that other people will do that debugging work for you in their spare time. The code you post doesn't really have to make sense, it should just be the minimum amount of code needed to reproduce the problem.</div><div><br></div><div>In a nutshell: The probability that you get some help is inversely proportional to the size of your example, and even more inversely proportional to the number of external dependencies (libraries etc.).</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-size:large">The problem to test is that without the database connection which is behind a firewall of course ,the code can not be executed. [...]</div></div></blockquote><div><br></div><div>Well, that is basically a show stopper for getting help... </div><div><br></div><div> I don't want to be mean, quite the opposite: I just want to explain why you probably won't receive any help in the current form. This is not special to the Haskell community, the situation would be very much the same if you posted an equivalent problem of similar size to the Racket/Python/... community. I'm quite sure that most maintainer would be happy to have a look e.g. at a program consisting of a dozen lines without external dependencies.</div></div></div>
</blockquote></div></div></div></div></div></div></div>
</blockquote></div>