[Git][haskell-team/DHG_packages][master] haskell-hoogle: revert upstream PR 339 to fix an armhf index corruption bug

Gianfranco Costamagna (@locutusofborg) gitlab at salsa.debian.org
Tue Jun 15 09:47:11 BST 2021



Gianfranco Costamagna pushed to branch master at Debian Haskell Group / DHG_packages


Commits:
6137ae6d by Gianfranco Costamagna at 2021-06-15T10:46:41+02:00
haskell-hoogle: revert upstream PR 339 to fix an armhf index corruption bug

- - - - -


3 changed files:

- p/haskell-hoogle/debian/changelog
- + p/haskell-hoogle/debian/patches/339-revert.patch
- p/haskell-hoogle/debian/patches/series


Changes:

=====================================
p/haskell-hoogle/debian/changelog
=====================================
@@ -1,3 +1,10 @@
+haskell-hoogle (5.0.18.1+dfsg1-2) unstable; urgency=medium
+
+  * Revert upstream pull request 339 (Addresses: #971832)
+    to fix an armhf corruption bug (see upstream issue #359)
+
+ -- Gianfranco Costamagna <locutusofborg at debian.org>  Tue, 11 May 2021 09:37:01 +0200
+
 haskell-hoogle (5.0.18.1+dfsg1-1) unstable; urgency=medium
 
   * New upstream release.


=====================================
p/haskell-hoogle/debian/patches/339-revert.patch
=====================================
@@ -0,0 +1,65 @@
+Description: Revert https://github.com/ndmitchell/hoogle/pull/339/files to possibly fix https://github.com/ndmitchell/hoogle/issues/359
+
+--- haskell-hoogle-5.0.18.1+dfsg1.orig/src/Output/Types.hs
++++ haskell-hoogle-5.0.18.1+dfsg1/src/Output/Types.hs
+@@ -128,15 +128,11 @@ searchFingerprintsDebug store query answ
+ 
+ data TypesNames a where TypesNames :: TypesNames (BStr0, V.Vector Name) deriving Typeable
+ 
+--- At around 7000 packages, Word16 becomes insufficient
+--- because there are more than 2^16 Names, so we use Word32.
+-type NameWord = Word32
+-
+ -- Must be a unique Name per String.
+ -- First 0-99 are variables, rest are constructors.
+ -- More popular type constructors have higher numbers.
+ -- There are currently about 14K names, so about 25% of the bit patterns are taken
+-newtype Name = Name NameWord deriving (Eq,Ord,Show,Data,Typeable,Storable,Binary)
++newtype Name = Name Word16 deriving (Eq,Ord,Show,Data,Typeable,Storable,Binary)
+ 
+ name0 = Name 0 -- use to represent _
+ 
+@@ -154,7 +150,7 @@ prettyName x@(Name i)
+ -- | Give a name a popularity, where 0 is least popular, 1 is most popular
+ popularityName :: Name -> Double
+ popularityName (Name n) | isVar $ Name n = error "Can't call popularityName on a Var"
+-                        | otherwise = fromIntegral (n - 100) / fromIntegral (maxBound - 100 :: NameWord)
++                        | otherwise = fromIntegral (n - 100) / fromIntegral (maxBound - 100 :: Word16)
+ 
+ newtype Names = Names {lookupName :: Str -> Maybe Name}
+ 
+@@ -194,10 +190,10 @@ spreadNames [] = []
+ spreadNames (sortOn (negate . snd) -> xs@((_,limit):_)) = check $ f (99 + fromIntegral (length xs)) maxBound xs
+     where
+         check xs | all (isCon . snd) xs && length (nubOrd $ map snd xs) == length xs = xs
+-                 | otherwise = error $ "Invalid spreadNames, length=" ++ show (length xs)
++                 | otherwise = error "Invalid spreadNames"
+ 
+         -- I can only assign values between mn and mx inclusive
+-        f :: NameWord -> NameWord -> [(a, Int)] -> [(a, Name)]
++        f :: Word16 -> Word16 -> [(a, Int)] -> [(a, Name)]
+         f !mn !mx [] = []
+         f mn mx ((a,i):xs) = (a, Name real) : f (mn-1) (real-1) xs
+             where real = fromIntegral $ max mn $ min mx ideal
+@@ -266,16 +262,14 @@ fpRaresFold :: (b -> b -> b) -> (Name ->
+ fpRaresFold g f Fingerprint{..} = f fpRare1 `g` f fpRare2 `g` f fpRare3
+ 
+ instance Storable Fingerprint where
+-    sizeOf _ = 3*sizeOf name0 + 2
++    sizeOf _ = 64
+     alignment _ = 4
+     peekByteOff ptr i = Fingerprint
+-        <$> peekByteOff ptr (i+0) <*> peekByteOff ptr (i+1*w) <*> peekByteOff ptr (i+2*w)
+-        <*> peekByteOff ptr (i+3*w) <*> peekByteOff ptr (i+3*w + 1)
+-        where w = sizeOf name0
++        <$> peekByteOff ptr (i+0) <*> peekByteOff ptr (i+2) <*> peekByteOff ptr (i+4)
++        <*> peekByteOff ptr (i+6) <*> peekByteOff ptr (i+7)
+     pokeByteOff ptr i Fingerprint{..} = do
+-        pokeByteOff ptr (i+0) fpRare1 >> pokeByteOff ptr (i+1*w) fpRare2 >> pokeByteOff ptr (i+2*w) fpRare3
+-        pokeByteOff ptr (i+3*w) fpArity >> pokeByteOff ptr (i+3*w + 1) fpTerms
+-        where w = sizeOf name0
++        pokeByteOff ptr (i+0) fpRare1 >> pokeByteOff ptr (i+2) fpRare2 >> pokeByteOff ptr (i+4) fpRare3
++        pokeByteOff ptr (i+6) fpArity >> pokeByteOff ptr (i+7) fpTerms
+ 
+ toFingerprint :: Sig Name -> Fingerprint
+ toFingerprint sig = Fingerprint{..}


=====================================
p/haskell-hoogle/debian/patches/series
=====================================
@@ -1,2 +1,3 @@
 global_database
 remove_embedded_copies
+339-revert.patch



View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/-/commit/6137ae6dd697d32a5ba5da9397e2cfe2d70ec2b9

-- 
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/-/commit/6137ae6dd697d32a5ba5da9397e2cfe2d70ec2b9
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-commits/attachments/20210615/b8586de0/attachment-0001.htm>


More information about the Pkg-haskell-commits mailing list