Incorrect relative header path debug information when object directory is under source directory
Categories
(Core :: Storage: Quota Manager, task, P3)
Tracking
()
People
(Reporter: jari, Assigned: jari, NeedInfo)
Details
(Whiteboard: dom-lws-bugdash-triage)
Attachments
(1 file)
In function mozilla::dom::quota::MakeSourceFileRelativePath, in file dom/quota/QuotaCommon.cpp, header file path from macro __FILE__ is compared to top of the source directory, and if the beginnings of the paths match, the rest of the header file path is returned as the relative path.
When the object directory is under the top of the source directory, for example when using the macro @TOPSRCDIR@ in the mozconfig file, this leads to an incorrect relative file path.
The issue was found by tests TEST(QuotaCommon_MakeSourceFileRelativePath, DomQuotaSourceFile_Exported) and TEST(QuotaCommon_MakeSourceFileRelativePath, DomLocalstorageSourceFile_Exported_Mapped).
Because it is less common to have the source under the object directory, one way out might be to check for this possibility first, as is later done in the code.
The issue impacts only debug message information.
Updated•4 years ago
|
Updated•2 years ago
|
| Assignee | ||
Updated•10 months ago
|
| Assignee | ||
Comment 1•1 month ago
|
||
On Windows, FILE can produce paths with backslashes, but the
quota manager's error logging compares against hardcoded forward-slash
suffixes. This causes an assertion failure in GetTreeBase.
Additionally, when the objdir is under the source tree, the source
tree base is a prefix of the objdir base, so exported headers
incorrectly match the source tree check first.
Fix both by adding a constexpr NormalizedSourcePath template that
normalizes backslashes to forward slashes at compile time, used in the
QM_HANDLE_ERROR macros and in GetSourceTreeBase/GetObjdirDistInclude-
TreeBase. Also reorder the objdir check before the source tree check
in MakeSourceFileRelativePath.
Updated•1 month ago
|
Comment 4•7 days ago
|
||
Backed out for causing build bustages as QuotaCommon.h
Backout Link
Push with failures
Failure Log
Failure line /builds/worker/checkouts/gecko/dom/quota/QuotaCommon.h:1379:13: error: bad implicit conversion constructor for 'NormalizedSourcePath'
backed out for causing test failure ( by request ) : https://hg.mozilla.org/integration/autoland/rev/a12ec7fc8b37e39c4af837959cf8fb475f55ba47
Updated•6 days ago
|
Updated•1 day ago
|
Comment 9•13 hours ago
|
||
| bugherder | ||
Description
•