apple / apple/foundationdb

More strict format validation of trace file

Open
#3,546 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
16.7k
Forks
1.6k
Avg merge
1d 20h
Merged PRs (30d)
126

Description

In simulation test, current [validateFormat](https://github.com/apple/foundationdb/blob/3c1f594b6e97a3367819d96f5210e925dac2bad8/flow/Trace.cpp#L1415) only check whether a field has a camel-case name.
I suppose it could be better if it also checks whether the name makes an illegal XML file. For example, in the following line
```

```
the “/” in “TLog/4922367cf5565541cde2f2b60920e541" will make TestHarness terminate its trace*.xml parsing in advance (refer to file [contrib/TraceLogHelper/XmlParser.cs](https://github.com/apple/foundationdb/blob/96af97c2944f460b6dbd8e7fd153f12e88bc43ad/contrib/TraceLogHelper/XmlParser.cs#L189) ).
This lets people get confused because TestHarness.exe just outputs `TestUnexpectedlyNotFinished` rather than indicates this is an XML parsing exception.

Contributor guide

Open the contributing guide

Research direction

Start in flow/Trace.cpp at validateFormat and compare its checks with the XML parsing behavior described in contrib/TraceLogHelper/XmlParser.cs. Reproduce the malformed trace attribute name containing '/'; done means the simulation validation rejects or clearly reports names that produce invalid XML instead of allowing TestHarness.exe to end with only TestUnexpectedlyNotFinished.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, csharp
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.