LMMS / lmms

Cross-platform music production software
https://lmms.io
GNU General Public License v2.0
7.98k stars 995 forks source link

Using `integrate` in Xpressive crashes LMMS #7468

Open khoidauminh opened 3 weeks ago

khoidauminh commented 3 weeks ago

System Information

Archlinux

LMMS Version(s)

Master

Most Recent Working Version

Before #7379

Bug Summary

Arithmetic exception triggered by the integrate function in Xpressive.

Expected Behaviour

Should not crash

Steps To Reproduce

  1. In LMMS, load the default preset of Xpressive or any preset that contains integrate,
  2. Click on the O1 button.

Logs

Loading the default preset: gdb.txt

Empty preset and typing integrate(f) into O1: gdb2.txt

Screenshots / Minimum Reproducible Project

Screencast from 2024-08-25 09-43-27.webm

Please search the issue tracker for existing bug reports before submitting your own.

Rossmaxx commented 3 weeks ago

@gnudles you have any idea?

gnudles commented 3 weeks ago

@Rossmaxx I will look into that, thanks. Maybe there is an undefined behaviour error.

gnudles commented 17 hours ago

@Rossmaxx https://github.com/LMMS/lmms/commit/851c884f58155275e6adbde40f2611d076edd345#diff-e474279d8fff8dbea1526e155470b2d712583ef3ceb0903a20d03088825d5802

someone replaced the line
for (i = 0; i < length; i++) { with this for (auto i = std::size_t{0}; i < length; i++) {

I was using the reference of i internally, and this change created a different variable.

opened a pull request: https://github.com/LMMS/lmms/pull/7499