Closed Bug 1632722 Opened 5 years ago Closed 4 years ago

IO.read hits "too many arguments" error when calling Page.printToPDF with printBackground:true

Categories

(Remote Protocol :: CDP, defect, P1)

defect

Tracking

(firefox81 fixed)

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: impossibus, Assigned: impossibus)

References

(Blocks 2 open bugs, )

Details

Attachments

(1 file)

Originally filed as https://github.com/puppeteer/puppeteer/issues/5671

1587125621499   RemoteAgent     TRACE   (connection {c236c872-af3d-7f40-8239-c03ac2d5072c})-> {"sessionId":1,"method":"Page.printToPDF","params":{"transferMode":"ReturnAsStream","landscape":false,"displayHeaderFooter":false,"headerTemplate":"","footerTemplate":"","printBackground":true,"scale":1,"paperWidth":8.5,"paperHeight":11,"marginTop":0,"marginBottom":0,"marginLeft":0,"marginRight":0,"pageRanges":"","preferCSSPageSize":false},"id":18}
1587125622620   RemoteAgent     TRACE   <-(connection {c236c872-af3d-7f40-8239-c03ac2d5072c}) {"sessionId":1,"id":18,"result":{"data":null,"stream":"18c71222-e870-4f4d-b68b-11f51869596a"}}
1587125622632   RemoteAgent     TRACE   (connection {c236c872-af3d-7f40-8239-c03ac2d5072c})-> {"sessionId":1,"method":"IO.read","params":{"handle":"18c71222-e870-4f4d-b68b-11f51869596a"},"id":19}
1587125622640   RemoteAgent     TRACE   <-(connection {c236c872-af3d-7f40-8239-c03ac2d5072c}) {"id":19,"sessionId":1,"error":{"message":"too many arguments provided for a function call","data":"read@chrome://remote/cont ... dy@chrome://remote/content/server/HTTPD.jsm:1632:14\nonInputStreamReady@chrome://remote/content/server/HTTPD.jsm:1511:14\n"}}
(node:95348) UnhandledPromiseRejectionWarning: Error: Protocol error (IO.read): too many arguments provided for a function call read@chrome://remote/content/domains/parent/IO.jsm:105:43

The example code which triggers that is:

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=800, height=800">
    <style>
        .bg {
            background-image: url('https://images.unsplash.com/photo-1586973699006-2a096c90f847?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2734&q=80');
            height: 800px;
            width: 800px;
            background-size: cover;
        }
    </style>
</head>
<body>
<div class="bg"></div>
</body>
</html>
Blocks: 1600050
Priority: -- → P3

Hilariously, this is due to apply being passed an array of more than 500 000 items, which hits the limit of arguments.length in the JS engine.

Assignee: nobody → mjzffr
Severity: -- → S3
Priority: P3 → P1
Pushed by mjzffr@gmail.com: https://hg.mozilla.org/integration/autoland/rev/c52d1bf844e8 IO.read hits 'too many arguments' r=remote-protocol-reviewers,jgraham
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
Component: CDP: IO → CDP
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: