[Bug 1916931] Re: omshell returns inconsistent results or segfaults

Stefan Lasiewski 1916931 at bugs.launchpad.net
Mon May 8 21:46:39 UTC 2023


Thanks to Massimiliano's lead. I was able to workaround this bug by
replacing /usr/bin/omshell with a freshly compiled version from source.
Note that I've only been using my custom version for about 20 minutes,
so YMMV.

I really dislike replacing packages with homemade utilities, as it's a
pain to maintain. So I chose to simply replace /usr/bin/omshell instead
of the whole thing. Here are the steps that I did:

```
systemctl stop isc-dhcp-server
curl -OL https://github.com/isc-projects/dhcp/archive/refs/tags/v4_4_3.tar.gz
tar zxf v4_4_3.tar.gz
cd dhcp-4_4_3
./configure
make
# NO make install
# Instead, replace the 1 utility that is causing us problems
mv /usr/bin/omshell /usr/bin/omshell.bad
cp dhcpctl/omshell /usr/bin/omshell
```


I will point out that the default version includes many more libraries then my custom version, and so presumably one of these system libraries is responsible for the bug, as suggested at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=995242#40

```
# ldd /usr/bin/omshell
        linux-vdso.so.1 (0x00007ffc617e4000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f62c6330000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f62c67fc000)
# ldd /usr/bin/omshell.bad 
        linux-vdso.so.1 (0x00007ffe1ebf8000)
        libirs-export.so.161 => /lib/x86_64-linux-gnu/libirs-export.so.161 (0x00007fe6b1d18000)
        libdns-export.so.1109 => /lib/x86_64-linux-gnu/libdns-export.so.1109 (0x00007fe6b1ae3000)
        libisc-export.so.1105 => /lib/x86_64-linux-gnu/libisc-export.so.1105 (0x00007fe6b1a6c000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe6b187a000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe6b1857000)
        libisccfg-export.so.163 => /lib/x86_64-linux-gnu/libisccfg-export.so.163 (0x00007fe6b1828000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe6b1820000)
        libcrypto.so.1.1 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007fe6b1549000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fe6b1daa000)
```


I tried recompiling isc-dhcp-4.4.1 from Ubuntu's source, but it had the same exact error.

** Bug watch added: Debian Bug tracker #995242
   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=995242

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to isc-dhcp in Ubuntu.
https://bugs.launchpad.net/bugs/1916931

Title:
  omshell returns inconsistent results or segfaults

Status in isc-dhcp package in Ubuntu:
  Confirmed

Bug description:
  I have just built a Ubuntu 20.04 server and installed isc-dhcp-server
  4.4.1 on it and I am seeing inconsistent returns from omshell. 
  Initially omshell returns data as expected, but when I exit and re-enter 
  omshell connections fail.

  Here is the initial, working, session:

  # omshell
  > server localhost
  > port 7911
  > key omapi_key <the key>
  > connect
  obj: <null>
  > new failover-state
  obj: failover-state
  > set name = "dhcp-failover"
  obj: failover-state
  name = "dhcp-failover"
  > open
  obj: failover-state
  name = "dhcp-failover"
  partner-address = c0:9d:e9:76:e9:55:00:00
  partner-port = 00:00:02:07
  local-address = 10:9d:e9:76:e9:55:00:00
  local-port = 00:00:02:07
  max-outstanding-updates = 00:00:00:0a
  mclt = 00:00:01:2c
  load-balance-max-secs = 00:00:00:03
  load-balance-hba =
  ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
  partner-state = 00:00:00:02
  local-state = 00:00:00:02
  partner-stos = 60:36:d0:68
  local-stos = 60:36:8b:3b
  hierarchy = 00:00:00:01
  last-packet-sent = 00:00:00:00
  last-timestamp-received = 00:00:00:00
  skew = 00:00:00:00
  max-response-delay = 00:00:00:3c
  cur-unacked-updates = 00:00:00:00

  Here is what I see when the connect fails.  Well, just hangs really.

  # omshell
  > server localhost
  > port 7911
  > key omapi_key <the key>
  > connect

  And then I hit ctrl-c to break out and tried again:

  # omshell
  > server localhost
  > port 7911
  > key omapi_key <the key>
  > connect
  Segmentation fault (core dumped)

  Note, the peer to this server is still running Ubuntu 18.04 with
  isc-dhcp-server 4.3.5.  Running the exact same commands on the peer
  works reliably.  (They are using the same python script to drive
  omshell.)  The DHCP server on the new system appears to be working 
  just fine as reported by omshell on the peer and systemctl.

  I was curious if the problem could be with the mis-matched versions
  of isc-dhcp-server so I shutdown isc-dhcp-server on the 18.04 system
  and get the same results.

  I also tried using a python script with the pypureomapi module to
  try and determine if the problem was in omshell or the server.  I 
  got very similar results when I attempted to get information about
  the failover state of the server.  Interestingly interrogating
  the server about host information seems to work just fine.

  This is a critical bug since I don't see how to fail over a DHCP
  that is running the isc-dhcp-server on 20.04 without being able
  to issue omapi commands.

  I am attaching apport output to this bug report.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/isc-dhcp/+bug/1916931/+subscriptions




More information about the foundations-bugs mailing list