Custom Query (152 matches)

Filters
 
Columns

Show under each result:


Results (1 - 3 of 152)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#1109 worksforme toggleActionIsActive in ToggleActionEntry not changed when user checks or unchecks menu item axel guest

Reported by guest, 7 years ago.

description

Using the package ghc682-gtk2hs - 0.9.12.1-6.fc8.i386 for Fedora 8, the field

toggleActionIsActive

is not changed when the user checks or unchecks a menu item.

data ToggleActionEntry = ToggleActionEntry {
toggleActionName :: String
toggleActionLabel :: String
toggleActionStockId :: (Maybe String)
toggleActionAccelerator :: (Maybe String)
toggleActionTooltip :: (Maybe String)
toggleActionCallback :: (IO ())
toggleActionIsActive :: Bool
}

There is a workaround, because the toggleActionCallback function does work when the user checks or unchecks an item. This can be used to set or unset an IORef. Example:

myTog :: IORef Bool -> IO ()
myTog chk = do old <- readIORef chk
               writeIORef chk (not old)

in:

duptogg = ToggleActionEntry "DupCheck" "Check Data" (Just stockConvert) Nothing 
                             (Just "Check facts for duplicates") (myTog dupcheck) True
#1111 worksforme RadioActionEntry not initialized correctly somebody guest

Reported by guest, 7 years ago.

description

On:

data RadioActionEntry = RadioActionEntry {
radioActionName :: String
radioActionLabel :: String
radioActionStockId :: (Maybe String)
radioActionAccelerator :: (Maybe String)
radioActionTooltip :: (Maybe String)
radioActionValue :: Int
}

the function:

actionGroupAddRadioActions :: 
              ActionGroup -> [RadioActionEntry] -> Int -> (RadioAction -> IO ()) -> IO ()

does not initialize to the 3rd (Int) argument as it should. The last item in the list is always initialized visually, regardless of the argument's value. The function:

radioActionGetCurrentValue 

is defined as:

radioActionGetCurrentValue
:: RadioActionClass self	
=> self	
-> IO Int

but GHCi complains there is no instance for a

RadioActionEntry type. 

However, the function can be used inside the callback function (4th argument) to get the current value.

#1279 worksforme segmentation fault in compiled program, involves gtk, selinux somebody guest

Reported by guest, 23 months ago.

description

I wrote a multithreaded GUI program for a research project using gtk2hs, and it works fine on fedora 17, which uses ghc 7.0.4. It crashes almost as soon as it starts when compiled and run on fedora 18 (ghc 7.4.1). There's a message on the console that it was killed because of a segmentation fault and that's about all it tells me. I tracked down the code that causes crash, and it seems to happen because I add an action to the gtk loop:

timeoutAddFull action ...

and the crash happens when the action runs the first time. I thought it was a bug in ghc 7.4.1, because I found a bug report that talks about a crash involving STM and multithreading, and supposedly was fixed in 7.4.2. So I set up a virtual machine and installed fedora 18 then upgraded it to rawhide to try my program under 7.4.2. But, the same crash happens on my rawhide machine.

However, it happened that I had to disable selinux on my rawhide machine using the boot command line because something started going wrong, still not sure what (hey, it's rawhide). Now my program does not crash. I just tested this on my fedora 18 laptop (still ghc 7.4.1) using both the version compiled on fedora 18 and the files from where I compiled it on rawhide: when I disable selinux, my program runs fine, but when it's enabled (even if set to permissive rather than enforcing) my program seg faults.

There's nothing useful in /var/log/messages, no indication of what selinux is unhappy about. I did find this: http://www.haskell.org/pipermail/haskell-cafe/2007-August/031120.html but at least in that problem, there was a definite error message about memory mapping, and I'm not getting one.

So as best I can tell, ghc 7.4.1&2 must both be doing something strange, maybe marking some piece of memory as data instead of code, maybe when performing calls to gtk, maybe in building thunks for use by timeoutAddFull, and eventually triggering a security problem.

My original program is huge. The problem must be some unexpected interaction between ghc's newer run time systems, gtk, and selinux. I'm attaching the smallest test case I could concoct and the build command. When you run the resulting program, it does nothing for about 2 seconds, then the action to print "tick" runs, and it crashes.

I'm filing the bug here because it might be a problem in gtk2hs.

I also filed it here under ghc because it might be a problem in the run time system: http://hackage.haskell.org/trac/ghc/ticket/7629

Here's the minimal test case (couldn't attach the file in trac for some reason):

module Try1 where

import Graphics.UI.Gtk
    
main = do
  
  initGUI
  
  timeoutAddFull (putStrLn "tick" >> return True) priorityDefaultIdle 2000
  
  mainGUI
  
  return ()

To build:

ghc --make Try1 -debug -threaded -main-is Try1.main
1 2 3 4 5 6 7 8 9 10 11
Note: See TracQuery for help on using queries.