Scripts/remote-gdb fails with gdb error XML_UseForeignDTD failed

I''m not understanding the below error. This reports as a GDB internal error. In the package, I'm compiling with expat/host and +libexpat, and have gone as far as to actually install expat on the build host (which is cheating). Any suggestions? I don't believe I managed to break gdb

grommish@DESKTOP-AW:~/openwrt$ ./scripts/remote-gdb openwrt:9000 build_dir/target-mips64_octeonplus_64_musl/suricata-6.0.4/ipkg-mips64_octeonplus/suricata6/usr/bin/suricata
Using target mips64_octeonplus_64 (musl, )
GNU gdb (GDB) 11.2
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-pc-linux-gnu --target=mips64-openwrt-linux-musl".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from build_dir/target-mips64_octeonplus_64_musl/suricata-6.0.4/ipkg-mips64_octeonplus/suricata6/usr/bin/suricata...
warning: Unsupported auto-load script at offset 0 in section .debug_gdb_scripts
of file /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/suricata-6.0.4/ipkg-mips64_octeonplus/suricata6/usr/bin/suricata.
Use `info auto-load python-scripts [REGEXP]' to list them.
xml-support.c:567: internal-error: XML_UseForeignDTD failed: requested feature requires XML_DTD support in Expat
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]

This is a bug, please report it.  For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.

xml-support.c:567: internal-error: XML_UseForeignDTD failed: requested feature requires XML_DTD support in Expat
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]
grommish@DESKTOP-AW:~/openwrt$
root@OpenWrt:/# gdbserver --once --remote-debug :9000 /usr/bin/suricata -c /etc/
suricata/suricata.yaml -i eth0
Process /usr/bin/suricata created; pid = 3382
Listening on port 9000
Remote debugging from host fd5b:cfa:61fb:0:7494:4f9a:961e:4276, port 6922
[getpkt: discarding char '+']
getpkt ("qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+;memory-tagging+");  [sending ack]
[sent ack]
putpkt ("$PacketSize=47ff;QPassSignals+;QProgramSignals+;QStartupWithShell+;QEnvironmentHexEncoded+;QEnvironmentReset+;QEnvironmentUnset+;QSetWorkingDir+;qXfer:libraries-svr4:read+;augmented-libraries-svr4-read+;qXfer:auxv:read+;qXfer:siginfo:read+;qXfer:siginfo:write+;qXfer:features:read+;QStartNoAckMode+;qXfer:osdata:read+;multiprocess+;fork-events+;vfork-events+;exec-events+;QNonStop+;QDisableRandomization+;qXfer:threads:read+;ConditionalBreakpoints+;BreakpointCommands+;QAgent+;Qbtrace:bts+;Qbtrace-conf:bts:size+;Qbtrace:pt+;Qbtrace-conf:pt:size+;Qbtrace:off+;qXfer:btrace:read+;qXfer:btrace-conf:read+;swbreak+;hwbreak+;qXfer:exec-file:read+;vContSupported+;QThreadEvents+;no-resumed+#37"); [looking for ack]
[received '+' (0x2b)]
getpkt ("vMustReplyEmpty");  [sending ack]
[sent ack]
putpkt ("$#00"); [looking for ack]
[received '+' (0x2b)]
getpkt ("QStartNoAckMode");  [sending ack]
[sent ack]
[noack mode enabled]
putpkt ("$OK#9a"); [noack mode]
[getpkt: discarding char '+']
getpkt ("!");  [no ack sent]
putpkt ("$OK#9a"); [noack mode]
getpkt ("QProgramSignals:0;1;3;4;6;7;8;9;a;b;c;d;e;f;10;11;12;13;14;15;16;17;18;19;1a;1b;1c;1d;1e;1f;20;21;22;23;24;25;26;27;28;29;2a;2b;2c;2d;2e;2f;30;31;32;33;34;35;36;37;38;39;3a;3b;3c;3d;3e;3f;40;41;42;43;44;45;46;47;48;49;4a;4b;4c;4d;4e;4f;50;51;52;53;54;55;56;57;58;59;5a;5b;5c;5d;5e;5f;60;61;62;63;64;65;66;67;68;69;6a;6b;6c;6d;6e;6f;70;71;72;73;74;75;76;77;78;79;7a;7b;7c;7d;7e;7f;80;81;82;83;84;85;86;87;88;89;8a;8b;8c;8d;8e;8f;90;91;92;93;94;95;96;97;");  [no ack sent]
putpkt ("$OK#9a"); [noack mode]
getpkt ("Hgp0.0");  [no ack sent]
putpkt ("$OK#9a"); [noack mode]
getpkt ("qXfer:features:read:target.xml:0,1000");  [no ack sent]
putpkt ("$l<?xml version="1.0"?>
<!-- Copyright (C) 2007-2022 Free Software Foundation, Inc.

 *!Copying and distribution of this file, with or without modification,
 *!are permitted in any medium without royalty provided the copyright
 *!notice and this notice are preserved.  -->

<!DOCTYPE target SYSTEM "gdb-target.dtd">
<target>
  <architecture>mips</architecture>
  <xi:include href="mips64-cpu.xml"/>
  <xi:include href="mips64-cp0.xml"/>
  <xi:include href="mips64-fpu.xml"/>

  <feature name="org.gnu.gdb.mips.linux">
 * <reg name="restart" bitsize="64" group="system"/>
  </feature>
</target>
#6d"); [noack mode]
readchar: Got EOF
[getpkt: discarding char 'ÿ']
Killing process(es): 3382
root@OpenWrt:/#
[3:45:51 pm] <mangix> stintel: tools/expat pretty much disables everything. Just requires changing a setting or 2.
[3:46:59 pm] <mangix> Yeah, EXPAT_DTD is off.

From tools/expat
-DEXPAT_DTD=OFF \ to -DEXPAT_DTD=ON \

[6:03:20 pm] <mangix> Grommish: I *think* https://github.com/openwrt/openwrt/pull/9435 fixes your issues. The other expat is in the packages feed

Confirmed this fixes the issue:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.