parcel-bundler / lightningcss

An extremely fast CSS parser, transformer, bundler, and minifier written in Rust.
https://lightningcss.dev
Mozilla Public License 2.0
6.47k stars 188 forks source link

Segmentation faults #590

Closed khaxan closed 1 week ago

khaxan commented 1 year ago

I get a segmentation fault when running the following CSS from a third-party site. It happens with the CLI as well as the npm package. I have noticed the same issue with other CSS as well.


.active\::before\:met_w--18.active::before {
    width: 18px
}

.after\:met_w--1::after {
    width: 1px
}

.met_h--12 {
    height: 12px
}

.met_h--16 {
    height: 16px
}

.met_h--20 {
    height: 20px
}

.met_h--24 {
    height: 24px
}

.met_h--48 {
    height: 48px
}

.before\:met_h--4::before {
    height: 4px
}

.before\:met_h--16::before {
    height: 16px
}

.before\:met_h--19::before {
    height: 19px
}

.before\:met_h--48::before {
    height: 48px
}

.active\::before\:met_h--18.active::before {
    height: 18px
}

.after\:met_h--1::after {
    height: 1px
}

.after\:met_content::after, .before\:met_content::before {
    content: " "
}

.met_pos--fixed {
    position: fixed
}

.met_pos--relative {
    position: relative
}

.met_pos--absolute {
    position: absolute
}

.before\:met_pos--absolute::before {
    position: absolute
}

.after\:met_pos--absolute::after {
    position: absolute
}

.met_top--0 {
    top: 0
}

.met_top--15 {
    top: 15px
}

.met_top--20 {
    top: 20px
}

.met_top--50p {
    top: 50%
}

.met_top--100p {
    top: 100%
}

.before\:met_top--0::before {
    top: 0
}

.before\:met_top--5::before {
    top: 5px
}

.before\:met_top--12::before {
    top: 12px
}

.before\:active\:met_top--13.active::before {
    top: 13px
}

.after\:met_top--m1::after {
    top: -1px
}

.after\:met_top--5::after {
    top: 5px
}

.met_bottom--0 {
    bottom: 0
}

.met_bottom--20 {
    bottom: 20px
}

.met_bottom--100p {
    bottom: 100%
}

.before\:met_bottom--0::before {
    bottom: 0
}

.met_left--0 {
    left: 0
}

.met_left--1 {
    left: 1px
}

.met_left--20 {
    left: 20px
}

.met_left--50p {
    left: 50%
}

.met_left--100p {
    left: 100%
}

.before\:met_left--0::before {
    left: 0
}

.before\:met_left--5::before {
    left: 5px
}

.before\:met_left--12::before {
    left: 12px
}

.before\:active\:met_left--13.active::before {
    left: 13px
}

.after\:met_left--m1::after {
    left: -1px
}

.after\:met_left--5::after {
    left: 5px
}

.met_right--0 {
    right: 0
}

.met_right--20 {
    right: 20px
}

.met_right--100p {
    right: 100%
}

.met_mx--m40 {
    margin-left: -40px;
    margin-right: -40px
}

.met_mx--m28 {
    margin-left: -28px;
    margin-right: -28px
}

.met_mx--12 {
    margin-left: 12px;
    margin-right: 12px
}

.met_mx--20 {
    margin-left: 20px;
    margin-right: 20px
}

.met_mx--24 {
    margin-left: 24px;
    margin-right: 24px
}

.met_mx--36 {
    margin-left: 36px;
    margin-right: 36px
}

.met_my--m40 {
    margin-top: -40px;
    margin-bottom: -40px
}

.met_my--m28 {
    margin-top: -28px;
    margin-bottom: -28px
}

.met_my--12 {
    margin-top: 12px;
    margin-bottom: 12px
}

.met_my--20 {
    margin-top: 20px;
    margin-bottom: 20px
}

.met_my--24 {
    margin-top: 24px;
    margin-bottom: 24px
}

.met_my--36 {
    margin-top: 36px;
    margin-bottom: 36px
}

.met_m--0 {
    margin: 0
}

.met_ml--1 {
    margin-left: 1px
}

.met_ml--6 {
    margin-left: 6px
}

.met_ml--15 {
    margin-left: 15px
}

.met_ml--20 {
    margin-left: 20px
}

.met_ml--21 {
    margin-left: 21px
}

.met_ml--35 {
    margin-left: 35px
}

.met_mr--1 {
    margin-right: 1px
}

.met_mr--10 {
    margin-right: 10px
}

.met_mr--15 {
    margin-right: 15px
}

.met_mr--20 {
    margin-right: 20px
}

.met_mb--0 {
    margin-bottom: 0
}

.met_mb--0i {
    margin-bottom: 0 !important
}

.met_mb--20 {
    margin-bottom: 20px
}

.met_not_last_mr--20:not(:last-child) {
    margin-right: 20px
}

.met_not_last_mb--20:not(:last-child) {
    margin-bottom: 20px
}

.met_p--0 {
    padding: 0
}

.met_px--8 {
    padding-left: 8px;
    padding-right: 8px
}

.met_py--5 {
    padding-top: 5px;
    padding-bottom: 5px
}

.met_pt--10 {
    padding-top: 10px
}

.met_pl--10 {
    padding-left: 10px
}

.met_pr--10 {
    padding-right: 10px
}

.met_pb--10 {
    padding-bottom: 10px
}

.met_color--white {
    color: #fff
}

.active > .active\:met_bgc--nonei {
    background-color: transparent !important
}

.active .active\:_\:met_bgc--nonei {
    background-color: transparent !important
}

.met_bd--2 {
    border: solid 2px
}

.met_bd--6 {
    border: solid 6px
}

.met_bdt--2 {
    border-top: solid 2px
}

.met_bdt--4 {
    border-top: solid 4px
}

.met_bdt--6 {
    border-top: solid 6px
}

.met_bdl--2 {
    border-left: solid 2px
}

.met_bdl--4 {
    border-left: solid 4px
}

.met_bdl--6 {
    border-left: solid 6px
}

.before\:met_bdt--2::before {
    border-top: solid 2px
}

.before\:met_bdl--2::before {
    border-left: solid 2px
}

.after\:met_bdt--2::after {
    border-top: solid 2px
}

.after\:met_bdl--2::after {
    border-left: solid 2px
}

.active > .active\:met_bd--1 {
    border-style: solid;
    border-width: 1px
}

.active .active\:_\:met_bd--1 {
    border-style: solid;
    border-width: 1px
}

.met_bdc--none {
    border-color: transparent
}

.met_bdt_color--current {
    border-top-color: currentColor
}

.met_bdb_color--current {
    border-bottom-color: currentColor
}

.met_bdl_color--current {
    border-left-color: currentColor
}

.met_bdr_color--current {
    border-right-color: currentColor
}

.met_radius--4 {
    border-radius: 4px
}

.met_radius--circle {
    border-radius: 50%
}

.before\:met_radius--circle::before {
    border-radius: 50%
}

.met_shadow_inset--6 {
    -webkit-box-shadow: inset 0 0 0 6px currentColor;
    box-shadow: inset 0 0 0 6px currentColor
}

.active > .active\:met_shadow_inset--1 {
    -webkit-box-shadow: inset 0 0 0 1px currentColor;
    box-shadow: inset 0 0 0 1px currentColor
}

.active > .active\:met_shadow_inset--8 {
    -webkit-box-shadow: inset 0 0 0 8px currentColor;
    box-shadow: inset 0 0 0 8px currentColor
}

.active .active\:_\:met_shadow_inset--1 {
    -webkit-box-shadow: inset 0 0 0 1px currentColor;
    box-shadow: inset 0 0 0 1px currentColor
}

.met_fs--14 {
    font-size: 14px
}

.met_lh--0 {
    line-height: 0
}

.met_lh--16 {
    line-height: 16px
}

.met_list--none {
    list-style: none
}

.met_text--nowrap {
    white-space: nowrap
}

.whitespace--normal {
    white-space: normal !important
}

.met_opacity--0 {
    opacity: 0
}

.met_opacity--8 {
    opacity: .08
}

.met_opacity--30 {
    opacity: .3
}

.met_opacity--70 {
    opacity: .7
}

.hover\:met_opacity--60:hover {
    opacity: .6
}

.hover\:met_opacity--100:hover {
    opacity: 1
}

a:hover > .a\:hover\:met_opacity--60 {
    opacity: .6
}

a:hover > .a\:hover\:met_opacity--100 {
    opacity: 1
}

.before\:met_opacity--30::before {
    opacity: .3
}

.after\:met_opacity--30::after {
    opacity: .3
}

.active > .active\:met_opacity--0 {
    opacity: 0
}

.active > .active\:met_opacity--100 {
    opacity: 1
}

.active .active\:_\:met_opacity--0 {
    opacity: 0
}

.active .active\:_\:met_opacity--100 {
    opacity: 100
}

.met_transition--300ms {
    -webkit-transition: all .3s;
    transition: all .3s
}

.before\:met_transition--300ms::before {
    -webkit-transition: all .3s;
    transition: all .3s
}

.met_translateTop--m50p {
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%)
}

.met_translateLeft--m50p {
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%)
}

.met_scale--0 {
    -webkit-transform: scale(0);
    transform: scale(0)
}

.hover\:met_scaleX--200:hover {
    -webkit-transform: scaleX(2);
    transform: scaleX(2)
}

.hover\:met_scaleY--200:hover {
    -webkit-transform: scaleY(2);
    transform: scaleY(2)
}

a:hover > .a:hover\:met_scalex--200:hover {
    -webkit-transform: scaleX(2);
    transform: scaleX(2)
}

a:hover > .a:hover\:met_scaley--200:hover {
    -webkit-transform: scaleY(2);
    transform: scaleY(2)
}
devongovett commented 1 year ago

Seems to work on the playground. What version/config/settings are you using?