lisdude / toaststunt

A network accessible, multi-user, programmable, interactive system for the creation of LambdaMOO style MOOs / MUDs.
63 stars 27 forks source link

Panic with sqlite_query #79

Closed tspivey closed 1 year ago

tspivey commented 1 year ago

Setup:

  1. Open two SQLite databases, 1 and 2.
  2. Call the test verb multiple times.

Test verb:

set_thread_mode(1);
handle = random(1, 2);
while (true)
  pattern = chr(random(65, 90)) + chr(random(65, 90)) + chr(random(65, 90)) + chr(random(65, 90));
  m = chr(random(65, 90)) + chr(random(65, 90)) + chr(random(65, 90)) + chr(random(65, 90));
  query = tostr("select regexp('", pattern, "', '", m, "');");
  sqlite_query(handle, query);
  yin();
endwhile

The MOO should panic pretty quickly.

I'm guessing this is caused by multiple threads trying to access the PCRE cache at the same time.

tvdijen commented 1 year ago

If you would run the server with valgrind, you should be able to pinpoint the exact location of the crash in the code.