hvr / ThreadScope

Official upstream repo for ThreadScope (issue tracker still using trac)
http://trac.haskell.org/ThreadScope
Other
0 stars 0 forks source link

TS crash under Windows 7 #20

Closed ghc-mirror closed 10 years ago

ghc-mirror commented 10 years ago

Original reporter: MikolajKonarski

TS (with widgetSetCanFocus commented out, see #21) crashes under Windows 7 every time an eventlog is loaded.

Backtrace is:

_cairo_win32_scaled_font_ucs4_to_index:GetGlyphIndicesW: Unknown GDI error>threa
dscope: user error (out of memory)

Versions: Haskell Platform is 2011.4.0.0, gtk2hs is 0.12.2, TS is 0.2.1 and GTK is 2.24.8. Look system-specific and was not reproduced with any other GTK version or on any other system, hence the minor priority.

Gtk2hs was installed without any problems, demos were compiled and launched succesfully.

See the full report by Kirill Kolodyazhniy on parallel-haskell.

ghc-mirror commented 10 years ago

Original reporter: duncan@

Reproduced by at least two other people, including me.

I got it using:

I think the other chap was using a more recent GTK and GHC, but probably same gtk2hs and TS.

I narrowed the problem down to this block in GUI.Timeline.Ticks.drawXTicks

    when (atMajorTick || atMidTick || tickWidthInPixels > 70) $ do
      tExtent <- textExtents tickTimeText
      let tExtentWidth = textExtentsWidth tExtent
      move_to textPos
      m <- getMatrix
      identityMatrix
      when (floor (pos + incr) <= endPos
            && (tExtentWidth + tExtentWidth / 3 < width || atMajorTick)) $
        showText tickTimeText
      setMatrix m

I didn't get the detailed runtime error message about GetGlyphIndicesW, but I presume that's just a GTK version difference. So it looks like a text rendering issue.

I wonder if it's due to using a large scaling factor in the cairo context.

ghc-mirror commented 10 years ago

Original reporter: MikolajKonarski

On other Windows machines (presumably also Windows 7, but a newer gtk) it crashes only in some cases, e.g.:

15:20 < JaffaCake> except when I zoomed all the way out, then it crashed
ghc-mirror commented 10 years ago

Original reporter: MikolajKonarski

I've rewritten the offending ticks code not to use scaling:

https://github.com/Mikolaj/ThreadScope/commit/a37094db611e79e8f5470ac25e75a5586cd0094a

Let's hope it helps, please reopen if the bug persists. Right now it's only in the devel version. To be released soon.