Bug 55504 - Use of uninitialized value in numeric lt (<) at Tools/Scripts/old-run-webkit-tests line 1778 seen on Qt bots after a crash
Summary: Use of uninitialized value in numeric lt (<) at Tools/Scripts/old-run-webkit-...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-01 14:02 PST by Joseph Pecoraro
Modified: 2011-03-02 13:24 PST (History)
6 users (show)

See Also:


Attachments
Don't try to capture crash logs on platforms that haven't implemented that feature (1.84 KB, patch)
2011-03-02 09:03 PST, Adam Roben (:aroben)
joepeck: review+
joepeck: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2011-03-01 14:02:48 PST
Perl old-run-webkit-tests issue seen on the build bots after a crash:

    Use of uninitialized value in numeric lt (<) at Tools/Scripts/old-run-webkit-tests line 1778.
Comment 1 Alexey Proskuryakov 2011-03-01 23:02:22 PST
Line 1778:

        # The crash log must have been created after this script started running.
        $crashLog = $newestCrashLog if -M $newestCrashLog < 0;
Comment 2 Adam Roben (:aroben) 2011-03-02 06:18:57 PST
A little more context:

# We assume that the newest crash log in matching the glob is the one that corresponds to the crash that just occurred.
if (my $newestCrashLog = findNewestFileMatchingGlob($glob)) {
    # The crash log must have been created after this script started running.
    $crashLog = $newestCrashLog if -M $newestCrashLog < 0;
}

So $newestCrashLog itself is defined. I guess -M is returning undefined. The docs say this will happen if the file doesn't exist. Maybe the file was deleted between when it was found by findNewestFileMatchingGlob and when we tested it with -M?

Joe, which bot did this happen on? Do you have a link to the test output that shows the error?
Comment 3 Joseph Pecoraro 2011-03-02 08:53:27 PST
findNewestFileMatchingGlob can early return, which I think returns the undefined value. I saw this on the Qt bot.
Comment 4 Adam Roben (:aroben) 2011-03-02 08:56:47 PST
Ah, that makes sense. Should be easy to fix then.
Comment 5 Adam Roben (:aroben) 2011-03-02 08:57:31 PST
We should probably make captureSavedCrashLog bail if we don't have a $glob (which should be the case on Qt).
Comment 6 Adam Roben (:aroben) 2011-03-02 08:58:25 PST
(In reply to comment #3)
> findNewestFileMatchingGlob can early return, which I think returns the undefined value. I saw this on the Qt bot.

Hm, but if findNewestFileMatchingGlob returns undefined, we shouldn't even get to line 1778, since $newestCrashLog will be undefined.
Comment 7 Adam Roben (:aroben) 2011-03-02 08:59:35 PST
Ah, the "return unless @paths" check in findNewestFileMatchingGlob is buggy.
Comment 8 Adam Roben (:aroben) 2011-03-02 09:03:12 PST
Created attachment 84423 [details]
Don't try to capture crash logs on platforms that haven't implemented that feature
Comment 9 Joseph Pecoraro 2011-03-02 11:40:15 PST
Comment on attachment 84423 [details]
Don't try to capture crash logs on platforms that haven't implemented that feature

View in context: https://bugs.webkit.org/attachment.cgi?id=84423&action=review

r=me with that fix! Thanks!

> Tools/Scripts/old-run-webkit-tests:1793
> +    return unless $#paths;

"$#paths" returns the last index in the array. So if there is 1 item, the last index will
be 0, and this might still bail. As you mentioned on IRC, an alternative to getting the
size of the array is "scalar(@paths)". That seems better.
Comment 10 Adam Roben (:aroben) 2011-03-02 11:47:31 PST
Committed r80152: <http://trac.webkit.org/changeset/80152>
Comment 11 WebKit Review Bot 2011-03-02 13:24:25 PST
http://trac.webkit.org/changeset/80152 might have broken GTK Linux 64-bit Debug
The following tests are not passing:
fast/css-generated-content/005.html
fast/css-generated-content/beforeAfter-interdocument.html
fast/css-generated-content/no-openclose-quote.html
fast/invalid/residual-style.html