Integral crashes on unregistered UCI options

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

IanKennedy
Posts: 60
Joined: Sun Feb 04, 2018 12:38 pm
Location: UK

Integral crashes on unregistered UCI options

Post by IanKennedy »

in Arena for Linux engines can be sent unregistered options (I did report this to the author but not supported anymore it seems). The Integral engine doesn't handle this and crashes eg

2026-03-08 18:42:58.554-->2:setoption name Hash value 64
2026-03-08 18:42:58.554-->2:setoption name Threads value 2
2026-03-08 18:42:58.554-->2:setoption name MoveOverhead value 10
2026-03-08 18:42:58.554-->2:setoption name SyzygyPath value /home/secret/Public/tb/Syzygy345:/home/secret/Public/tb/Syz6
2026-03-08 18:42:58.554-->2:setoption name Ponder value true
2026-03-08 18:42:58.554-->2:isready
2026-03-08 18:42:58.689<--2:terminate called after throwing an instance of 'std::bad_function_call'
2026-03-08 18:42:58.690<--2: what(): bad_function_call
2026-03-08 18:42:58.710<--2:BytesRead > 0
2026-03-08 18:42:58.731<--2:-- LiesThread.Execute terminated --
2026-03-08 18:42:58.872*2*-- EngineProcess not Running:134--
2026-03-08 18:42:58.872*2*enginedebug:--2 Engine not loaded

I put a quick try catch in uci.cc to stop it which seems to do the job:

Code: Select all

listener.RegisterCommand("setoption", CommandType::kUnordered, {
    CreateArgument("name", ArgumentType::kRequired, LimitedInputProcessor<1>()),
    CreateArgument("value", ArgumentType::kRequired, LimitedInputProcessor<1>()),
    CreateArgument("wtime", ArgumentType::kOptional, LimitedInputProcessor<1>()),
  }, [](Command *cmd) {
    const auto option_name = *cmd->ParseArgument<std::string>("name");
    const auto option_value = *cmd->ParseArgument<std::string>("value");
    try {
    listener.GetOption(option_name).SetValue(option_value);
  } catch (const std::exception& e) {
    // silently ignore
  }
    //listener.GetOption(option_name).SetValue(option_value);
  });
I don't have a github account otherwise I'd mention it there and the author's linked website doesn't appear to be running?
Author of the actively developed PSYCHO chess engine