-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testsuite write-merge failing #14
Comments
Hi, First and foremost, thank you very much for a detailed and extensive description of the issue! I'm aware of this bug and I initially thought that it was introduced along with the incremental parser that recently got merged into I think that your analysis may very well be correct, especially given the currently known issues with varying event types (i.e. headers) being emitted by different GHC versions. However, I haven't gotten around to investigating this more in recent days. I'd like to do so in the future but that is unlikely to happen in the coming couple of months at least. However, if you work is affected by this issue, I'll assign it a higher priority than I would otherwise. In addition, if you're interested in poking around this further, I can either try to provide assistance or would at least make use of your findings when I get around to working on this further. Last but not least - and completely out of curiosity - you are one of the few people that are showing active interest in [1] Note that the |
Hi Karl,
The Maybe I can drill in a bit more for this bug, but I have limited time to spend. |
I see, consolidating the two libraries would definitely be helpful to the As for the bug, sounds like one of us will have to look more into it as we |
I just briefly looked at this issue. At least for the exception thrown for
I'm still not sure what the best way to address this. Would we like to replace these deprecated events with the alternatives when deserializing, or restore original events when serializing? |
I think it's fine to emit the newer alternatives when serialising -- I'm not aware of any other notable consumers of eventlogs besides In addition, this has been broken literally for years, at this point a solution would be a good solution. |
Thanks @maoe for bumping this. ghc-events/src/GHC/RTS/Events/Binary.hs Line 881 in 58aefed
stopThread treatment: I had to drop the special case of GHC-7.8.2 on the floor. The example analysed above is a different case, one where two distinct events in the log generate the same information in the HS data structure. In both cases the log can only be written back one way, so there is no fix for the property...
Just though: If the |
I'm not totally sure if this is the case. The set of parsers varies depending on the GHC version as you said but it's constructed from the header content, which is also available in the serializer. I'll take a deeper look into this issue when I have time. |
Does anyone even need the write-back-to-disk functionality? It seems like an odd feature to me to be able to write our own event logs when we're not the compiler. If we got rid of it, a lot of code would go away... |
@mboes I think the write back functionality can be useful. For example, we can write a tool to slice and/or filter specific events from a huge eventlog file to a smaller chunk. It's like the tcpslice for pcap files. |
Also it's used publicly at least in this package: https://hackage.haskell.org/package/linux-perf |
I've been told that it's also useful for assembling the full eventlog for a run of a distributed program where all the workers would be writing their own eventlogs. |
You might think... (we did for some time when we built EdenTV), but actually the first thing any log-consuming software will do is take it apart into the separate eventlogs :) |
Sorry, I didn't mean to close this. |
I haven't debugged this myself yet, but my understanding is that this problem occurs because there are multiple ways to parse an event (in other words we map different events to the same
So basically when parsing we map more stuff to less stuff and lose information. Two ways to deal with this:
But before putting more effort into this I'd suggest dropping support for some ancient GHC versions. I don't know what the policy for dropping support and what's the support window, but I can see in the .cabal file that the earliest GHC we support is currently 7.8.4. So perhaps just drop GHC 6 tests, add GHC 7 (or 8) tests, drop GHC 6 parsers etc. Also, this problem will disappear if we drop GHC 6 support and none of the GHC 7 and 8 events have different formats in different GHC versions (I don't know if this is really the case, haven't checked yet). Any suggestions? |
This test fails due to haskell#14. Until it's fixed we disable the test.
This test fails due to haskell#14. Until it's fixed we disable the test.
The new test suite
write-merge
fails on master (f5ac7a0
) with an index-out-of-bounds error:(This is with GHC-7.8.4) but does not seem to relate to the GHC version used to compile the library.
A quick first analysis indicates that
serialiseEventLog
is causing the failure for older trace files. It seems as though some assumptions about the admissible events are baked into the code?GHCI session:
GHC-6.12.3 knew 19 event types, GHC-7.0.2 knew 22, test files produced by newer GHCs contain many more event types, and those files work as expected:
The failure with GHC-7.8.2 is expected (see code https://github.com/haskell/ghc-events/blob/master/GHC/RTS/Events.hs#L1184 ) . One could probably modify the file header of the written log file (adding the event that identifies GHC-7.8.3) to fix it - the format which is written is the one of 7.8.3.
Unclear what causes the failure with
mandelbrot-mmc-2011-06-14.eventlog
. This file has many event types, whose numbers are neither consecutive nor ordered in the file, which might be the reason.The text was updated successfully, but these errors were encountered: