Skip to content

Find and replace causes segfault with 8183 char files

Step to reproduce :

  • open a text file with 8183 'a' characters in it
  • press CTRL+R
  • type the following regex : (a)*
  • when the '*' is typed mousepad vanish with this log :
Jun 29 15:30:13 machine-name kernel: mousepad[15527]: segfault at 7ffc53cc9f10 ip 00007fdd85505651 sp 00007ffc53cc9f00 error 6 in libpcre.so.1.2.12[7fdd854f2000+50000]
Jun 29 15:30:13 machine-name kernel: Code: ea e9 28 fd ff ff 31 c0 e9 9d fc ff ff b8 ff ff ff ff c3 66 0f 1f 44 00 00 41 57 41 56 41 55 41 54 55 53 48 81 ec b8 01 00 00 <48> 89 54 24 10 89 4c 24 18 4c 89 4c 24 08 64 48 8b 04 25 28 00 00

What is expected :

  • mousepad not to crash
  • the replace function to just work

Additional context :

  • this 1st occurred during a regular development session with a regular JavaScript file and an intended (and valid) regex
  • with a 8182 'a' char file its not crashing
  • sometimes it is needed to add a few more characters (~8185...)