Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibWeb: Stack overflow in WPT legend display test #2452

Open
1 task
tcl3 opened this issue Nov 20, 2024 · 0 comments
Open
1 task

LibWeb: Stack overflow in WPT legend display test #2452

tcl3 opened this issue Nov 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@tcl3
Copy link
Member

tcl3 commented Nov 20, 2024

Summary

The following WPT test now crashes with a segfault due to a stack overflow: http://wpt.live/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-display.html

Bisected to: a820308 and/or the followup commit c47d19d

Operating system

Linux

Steps to reproduce

  1. Open http://wpt.live/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-display.html
  2. 💥

Expected behavior

No crash

Actual behavior

A segfault occurs

URL for a reduced test case

http://wpt.live/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-display.html

HTML/SVG/etc. source for a reduced test case

N/A

Log output and (if possible) backtrace

#0  0x00007b054951d998 in fast_is<Web::Layout::TextNode> ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/TextNode.h:78
#1  is<Web::Layout::TextNode, Web::Layout::Node const> ()
    at /home/tim/repos/ladybird/AK/TypeCasts.h:21
#2  next_without_lookahead ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/InlineLevelIterator.cpp:208
#3  0x00007b054951d928 in next ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/InlineLevelIterator.cpp:140
#4  0x00007b054951b341 in generate_line_boxes ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/InlineFormattingContext.cpp:266
#5  0x00007b054951b16c in run ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/InlineFormattingContext.cpp:85
#6  0x00007b05494f7c79 in layout_inside ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/FormattingContext.cpp:244
#7  0x00007b054951c58d in dimension_box_on_line ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/InlineFormattingContext.cpp:186
#8  0x00007b054951da47 in next_without_lookahead ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/InlineLevelIterator.cpp:362
#9  0x00007b054951d928 in next ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/InlineLevelIterator.cpp:140
#10 0x00007b054951b341 in generate_line_boxes ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/InlineFormattingContext.cpp:266
#11 0x00007b054951b16c in run ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/InlineFormattingContext.cpp:85
#12 0x00007b05494f7c79 in layout_inside ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/FormattingContext.cpp:244
#13 0x00007b054951c58d in dimension_box_on_line ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/InlineFormattingContext.cpp:186
#14 0x00007b054951da47 in next_without_lookahead ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/InlineLevelIterator.cpp:362
--Type <RET> for more, q to quit, c to continue without paging--
#15 0x00007b054951d928 in next ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/InlineLevelIterator.cpp:140
#16 0x00007b054951b341 in generate_line_boxes ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/InlineFormattingContext.cpp:266
#17 0x00007b054951b16c in run ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/InlineFormattingContext.cpp:85
#18 0x00007b05494f7c79 in layout_inside ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/FormattingContext.cpp:244
#19 0x00007b054951c58d in dimension_box_on_line ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/InlineFormattingContext.cpp:186
#20 0x00007b054951da47 in next_without_lookahead ()
    at /home/tim/repos/ladybird/Libraries/LibWeb/Layout/InlineLevelIterator.cpp:362
(33077 further stack frames omitted)

Screenshots or screen recordings

No response

Build flags or config settings

No response

Contribute a patch?

  • I’ll contribute a patch for this myself.
@tcl3 tcl3 changed the title LibWeb: Segfault in WPT legend display test LibWeb: Stack overflow in WPT legend display test Nov 20, 2024
@tcl3 tcl3 added the bug Something isn't working label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant