mbox to maildir conversion: allocation size overflow
Categories
(MailNews Core :: Backend, defect)
Tracking
(Not tracked)
People
(Reporter: d4629635, Assigned: benc)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file, 14 obsolete files)
(deleted),
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
Comment 5•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 9•6 years ago
|
||
Comment 10•6 years ago
|
||
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
Comment 13•6 years ago
|
||
Assignee | ||
Comment 14•6 years ago
|
||
Comment 15•6 years ago
|
||
Comment 16•6 years ago
|
||
Comment 17•6 years ago
|
||
Assignee | ||
Comment 18•6 years ago
|
||
Assignee | ||
Comment 19•6 years ago
|
||
Comment 20•6 years ago
|
||
Comment 21•6 years ago
|
||
Comment 22•6 years ago
|
||
Comment 23•6 years ago
|
||
Comment 24•6 years ago
|
||
Comment 25•6 years ago
|
||
Comment 26•6 years ago
|
||
Comment 27•6 years ago
|
||
Comment 28•6 years ago
|
||
Assignee | ||
Comment 29•6 years ago
|
||
Assignee | ||
Comment 30•6 years ago
|
||
Assignee | ||
Comment 31•6 years ago
|
||
Comment 32•6 years ago
|
||
Comment 33•6 years ago
|
||
Comment 34•6 years ago
|
||
Comment 35•6 years ago
|
||
Comment 36•6 years ago
|
||
Comment 37•6 years ago
|
||
Comment 38•6 years ago
|
||
Comment 39•6 years ago
|
||
Comment 40•6 years ago
|
||
Comment 41•6 years ago
|
||
Assignee | ||
Comment 42•6 years ago
|
||
Assignee | ||
Comment 43•6 years ago
|
||
Comment 44•6 years ago
|
||
Assignee | ||
Comment 45•6 years ago
|
||
Comment 46•6 years ago
|
||
Comment 47•6 years ago
|
||
Assignee | ||
Comment 48•6 years ago
|
||
Assignee | ||
Comment 49•6 years ago
|
||
Comment 50•6 years ago
|
||
Comment 51•6 years ago
|
||
Assignee | ||
Comment 52•6 years ago
|
||
Assignee | ||
Comment 53•6 years ago
|
||
Comment 54•6 years ago
|
||
Comment 55•6 years ago
|
||
Comment 56•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 57•6 years ago
|
||
Comment 58•6 years ago
|
||
Comment 59•6 years ago
|
||
Comment 60•6 years ago
|
||
Assignee | ||
Comment 61•6 years ago
|
||
Assignee | ||
Comment 62•6 years ago
|
||
Comment 63•6 years ago
|
||
Assignee | ||
Comment 64•6 years ago
|
||
Assignee | ||
Comment 65•6 years ago
|
||
Comment 66•6 years ago
|
||
Comment 67•6 years ago
|
||
Comment 68•6 years ago
|
||
Assignee | ||
Comment 69•6 years ago
|
||
Comment 70•6 years ago
|
||
Assignee | ||
Comment 71•6 years ago
|
||
Assignee | ||
Comment 72•6 years ago
|
||
Assignee | ||
Comment 73•6 years ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #70)
Please for all the function documentation, use JSDoc/JavaDoc style
documentation, i.e./**
- .........
*/// is just for code comments, but wouldn't included in generated
documentation and such
I probably need come clarification here on jsdoc policy. We don't want all functions included in generated documentation, right? Just the ones that are exported or otherwise visible from the outside, and not the internal helper/support functions.
What I've done is document all the top-level functions using the jsdoc conventions.
But I've only used the "/**
" marker for blocks that should appear in generated API docs - ie external-facing stuff.
And I've used plain "/*
" markers for internal functions, to prevent them from cluttering up the generated documentation with noise.
ie:
/**
* ... jsdoc-style block to appear in generated docs ...
*/
vs
/*
* ... jsdoc-style block, not appearing in docs ...
*/
Does that do what we want?
::: mailnews/base/util/converterWorker.js
- // Helper to check start of byte array for "From ".
- let startsWithFromMarker = function(b) {
why a helper function when it's used only once?
It started off a lot more verbose :-) I've inlined it.
@@ +408,5 @@
perhaps add the types to the message to ease debugging if this ever happensthrow new Error(
Unsupported conversion: ${srcType} => ${destType}
);
Good idea. Done.
Comment 74•6 years ago
|
||
(In reply to Ben Campbell from comment #73)
I probably need come clarification here on jsdoc policy. We don't want all
functions included in generated documentation, right? Just the ones that are
exported or otherwise visible from the outside, and not the internal
helper/support functions.
I think it's standard practice to still use /** */ style comments for all documentation, internal or not. Internal is a vague concept anyway since we're not really doing an interface. It's all internal code.
/* */ style comments should be avoided in general, since they prevent commenting out larger blocks. Use // style instead.
Assignee | ||
Comment 75•6 years ago
|
||
Thanks - that sounds like a good policy.
I've converted all the "internal" jsdoc blocks back to /**
.
I'm looking forward to when it becomes an issue and we find ourselves with too much internal documentation :-)
Comment 76•6 years ago
|
||
Comment 77•6 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/67c263d7544b
refactored mbox<->maildir conversion, also fixing bug 1135309 (don't use "From -" for maildir files). r=mkmelin
Updated•6 years ago
|
Comment 78•6 years ago
|
||
Backout:
https://hg.mozilla.org/comm-central/rev/6c36a1eb832351416d0a9e6ff513ce9f1745aa43
Backed out changeset 67c263d7544b (bug 1491228) for test failures in test_converterImap.js. a=backout DONTBUILD
Magnus: I'd appreciate if you let me do the checkins since I coordinate them overall (unless it's an urgent bustage fix).
Ben: Please run tests locally or on try before presenting for review. Hint: The reviewer can run them, too. As far as I know, there are three tests covering this area, so it's easy to run those three.
I checked whether I could fix the failing test quickly, but I couldn't as there appear to be multiple problems:
First something goes wrong and then the error handling is faulty, too:
JavaScript strict warning: resource:///modules/mailstoreConverter.jsm, line 59: ReferenceError: reference to undefined property "lineno"
A came to the conclusion that fixing this secondary error wouldn't have helped, so I opted for a backout :-(
Assignee | ||
Comment 79•6 years ago
|
||
(In reply to Jorg K (GMT+1) from comment #78)
Ben: Please run tests locally or on try before presenting for review. Hint: The reviewer can run them, too. As far as I know, there are three tests covering this area, so it's easy to run those three.
Sorry about that - I thought test_mailstoreConverter.js was the only one (along with new round-trip test from Bug 1508931). No excuse for not doing the try build though...
I checked whether I could fix the failing test quickly, but I couldn't as there appear to be multiple problems:
First something goes wrong and then the error handling is faulty, too:
JavaScript strict warning: resource:///modules/mailstoreConverter.jsm, line 59: ReferenceError: reference to undefined property "lineno"
I think the original error is something simple (I think the converter is assuming the source mbox file exists, which may not be the case for an unsynced imap account).
But yeah, always embarrassing when the error-handling code fails :-)
A came to the conclusion that fixing this secondary error wouldn't have helped, so I opted for a backout :-(
In any case, I need to update this patch now that the patch for bug 1259040 has landed (both affect the mailstore converter code).
Comment 80•6 years ago
|
||
There are three tests, all from the original bug 856087:
test_mailstoreConverter.js
test_converterImap.js
test_converterDeferredAccount.js
https://hg.mozilla.org/comm-central/rev/cb57855b5455
Assignee | ||
Comment 81•6 years ago
|
||
Patch updated:
- now uses .eml extension on maildir messages (resolving clash with bug 1259040).
- fixed up some bad exception handling which was exposed by test_converterImap.js.
- fixed up test_converterImap.js (turns out it never worked anyway. It was tearing down its test imap account before running the test (yay async js! :-). So the conversion would fail and throw an exception which bypassed any Assert() calls which would have flagged up the test failure).
Comment 82•6 years ago
|
||
Assignee | ||
Comment 83•6 years ago
|
||
OK, nits addressed. I'm assuming new patch requires new r+ flag, so I've marked it for review again.
Try build here:
Assignee | ||
Comment 84•6 years ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #82)
::: mailnews/base/util/converterWorker.js
+/* eslint-env mozilla/chrome-worker, node */
what does this do?
It suppresses a few undefined-symbol lint warnings (importScripts
, OS
) which would otherwise trigger on chrome workers.
I need to figure out if there's an equivalent eslint-env for unit tests. The xpcshell tests suffer lots of spurious undefined-symbol lint errors.
Comment 85•6 years ago
|
||
Updated•6 years ago
|
Comment 86•6 years ago
|
||
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/d156755548d3
refactored mbox<->maildir conversion (also fixes Bug 1135309). r=mkmelin
Description
•