Skip to content

[Bug]: Intermittent failure in the "supports specifying a custom origin" viewer integration test #19951

@timvandermeij

Description

@timvandermeij

Attach (recommended) or Link to PDF file

N/A

Web browser and its version

Firefox 138.0.3

Operating system and its version

Arch Linux

PDF.js version

5.2.133

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

The following traceback showed up recently as one of the most occurring intermittents (the most recent one from http://54.193.163.58:8877/13f5eafa0bf6ee8/output.txt):

3) PDF viewer Zoom origin supports specifiying a custom origin
  Message:
�[31m    In firefox, zoom in: Expected 'Hence, recording and compiling a trace speculates that the path andtyping will be exactly as they were during recording for subsequentiterations of the loop.Every compiled trace contains all the guards (checks) requiredto validate the speculation. If one of the guards fails (if controlflow is different, or a value of a different type is generated), thetrace exits. If an exit becomes hot, the VM can record a branchtrace starting at the exit to cover the new path. In this way, the VMrecords a trace tree covering all the hot paths through the loop.Nested loops can be difficult to optimize for tracing VMs. Ina na¨ıve implementation, inner loops would become hot first, andthe VM would start tracing there. When the inner loop exits, theVM would detect that a different branch was taken. The VM wouldtry to record a branch trace, and find that the trace reaches not theinner loop header, but the outer loop header. At this point, the VMcould continue tracing until it reaches the inner loop heade ... to be 'guards'.�[0m
  Stack:
        at <Jasmine>
        at file:///C:/pdfjs/botio-files-pdfjs/private/13f5eafa0bf6ee8/test/integration/viewer_spec.mjs:87:14
        at async Promise.all (index 0)
        at async UserContext.<anonymous> (file:///C:/pdfjs/botio-files-pdfjs/private/13f5eafa0bf6ee8/test/integration/viewer_spec.mjs:62:7)
  Message:
�[31m    In firefox, zoom out: Expected 'Hence, recording and compiling a trace speculates that the path andtyping will be exactly as they were during recording for subsequentiterations of the loop.Every compiled trace contains all the guards (checks) requiredto validate the speculation. If one of the guards fails (if controlflow is different, or a value of a different type is generated), thetrace exits. If an exit becomes hot, the VM can record a branchtrace starting at the exit to cover the new path. In this way, the VMrecords a trace tree covering all the hot paths through the loop.Nested loops can be difficult to optimize for tracing VMs. Ina na¨ıve implementation, inner loops would become hot first, andthe VM would start tracing there. When the inner loop exits, theVM would detect that a different branch was taken. The VM wouldtry to record a branch trace, and find that the trace reaches not theinner loop header, but the outer loop header. At this point, the VMcould continue tracing until it reaches the inner loop heade ... to be 'guards'.�[0m
  Stack:
        at <Jasmine>
        at file:///C:/pdfjs/botio-files-pdfjs/private/13f5eafa0bf6ee8/test/integration/viewer_spec.mjs:101:14
        at async Promise.all (index 0)
        at async UserContext.<anonymous> (file:///C:/pdfjs/botio-files-pdfjs/private/13f5eafa0bf6ee8/test/integration/viewer_spec.mjs:62:7

What is the expected behavior?

The integration test should pass consistently.

What went wrong?

The integration test fails intermittently.

Link to a viewer

No response

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions