Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,360
    • Issues 5,360
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 567
    • Merge requests 567
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #18043
Closed
Open
Issue created Apr 11, 2020 by Dmitry Ivanov@ethercrowReporter

RTS flushTrace function doesn't flush the eventlog

Summary

The flushTrace function flushes the eventlog file descriptor, but doesn't flush the event buffers to that descriptor.

For example, here's a fragment of RTS startup code:

    /* Trace some basic information about the process */
    traceWallClockTime(); // (1)
    traceOSProcessInfo(); // (2)
    flushTrace(); // (3)

The intention of this code is to have this info at the very beginning of the eventlog. But I observe these events near the very end for my programs. Looks like (1) and (2) write to some memory buffers but don't touch the eventlog file descriptor, and (3) is flushing said descriptor but doesn't flush said memory buffer.

Steps to reproduce

Compile some meaningful multithreaded program with -eventlog -threaded and run with +RTS -l -N. I could probably attach something small but sufficient if necessary.

Observe that the Wallclock event is somewhere not at the beginning of the eventlog.

Expected behavior

WallClock event being at the beginning of the eventlog file, before events emitted by the application code like Debug.Trace.traceEventIO.

Environment

  • GHC version used: 8.8.3, 8.10.1

Optional:

  • Operating System: macOS high sierra
  • System Architecture: x86_64
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking