sky10p / regexh-contributions

Ayuda a traducer la app de regex a más idiomas
7 stars 3 forks source link

[Bug] Crash upon insering a regex loaded with back-references #20

Closed Palloxin closed 2 months ago

Palloxin commented 2 months ago

How to reproduce

1.Click to "Explain" section and paste this in Regex π√(<(h[1-4]|p)>(<(?:span|strong)>)?)(( ?Chapter )?(\d{1,4}\b)([^\w]+(?=\w))?([^()]+?))(<\/\2>)((.*?<p>)((?:\5|\6|\7|\8)\6?\7?\8?\.?)<\/p>)?

  1. type a character and then delete it.
  2. Wait 60 seconds or less

Actual behaviour

The app crashes after less than minute and even other apps close themself (even the phone launcher)

Details

I suppose there is a bug with the processing of back-references that sucks memory very quickly making other apps crash too. Unfortunately I can't screen video the process because.. the screen recorder crashes too (i domt have another device to record with). The regex isn't even loaded in Explain for me

https://github.com/sky10p/regexh-contributions/assets/75091899/9c309001-fe75-4360-9ab8-2e7e320365c1

sky10p commented 2 months ago

I have been unable to replicate the crash on either my mobile device or the emulator. Could you please provide me with the details of your mobile device (e.g. Android version, etc.)? In any case, this expression appears not functioning as intended. I will investigate the issue further and get back to you. Thank you in advance for your assistance.

Palloxin commented 2 months ago

3gb ram Android 8 miui 8 , huawei p8 lite 2017

sky10p commented 2 months ago

I have identified the cause of the crash and will implement a workaround in version 5.6.1. However, it appears that the explanations are not functioning correctly with back-references for the time being. I will open a new issue to address this, as it seems to be a complex issue due to the current processing.

Please refer to the new issue, which will be managed here: Issue of back-references