I've noticed that the omshell as shipped in the package is doing bad
things memory access wise...

$ valgrind /usr/bin/omshell 
==735304== Memcheck, a memory error detector
==735304== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==735304== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==735304== Command: /usr/bin/omshell
==735304== 
==735304== Conditional jump or move depends on uninitialised value(s)
==735304==    at 0x48760C0: irs_resconf_load (in 
/usr/lib/x86_64-linux-gnu/libirs-export.so.161.0.1)
==735304==    by 0x155D67: dhcp_dns_client_setservers (isclib.c:51)
==735304==    by 0x15620B: dns_client_init (isclib.c:381)
==735304==    by 0x15620B: dns_client_init (isclib.c:354)
==735304==    by 0x1562BB: dhcp_context_create (isclib.c:246)
==735304==    by 0x114C15: dhcpctl_initialize (dhcpctl.c:45)
==735304==    by 0x11374B: main (omshell.c:118)
==735304== 
> connect
==735304== Invalid read of size 8
==735304==    at 0x14EC6B: omapi_one_dispatch (dispatch.c:676)
==735304==    by 0x14F462: omapi_wait_for_completion (dispatch.c:455)
==735304==    by 0x114D62: dhcpctl_connect (dhcpctl.c:115)
==735304==    by 0x113F23: main (omshell.c:420)
==735304==  Address 0x7010cf0 is 32 bytes inside a block of size 96 free'd
==735304==    at 0x483CA3F: free (in 
/usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==735304==    by 0x14A39F: dfree (alloc.c:203)
==735304==    by 0x14A39F: omapi_object_dereference (alloc.c:709)
==735304==    by 0x14E1DA: omapi_io_dereference (dispatch.c:39)
==735304==    by 0x14E1DA: omapi_unregister_io_object (dispatch.c:410)
==735304==    by 0x14B217: omapi_disconnect.part.0 (connection.c:528)
==735304==    by 0x14B4C4: omapi_disconnect (connection.c:465)
==735304==    by 0x14B4C4: omapi_connection_connect_internal (connection.c:728)
==735304==    by 0x14B61C: omapi_connection_connect (connection.c:615)
==735304==    by 0x14EC4E: omapi_one_dispatch (dispatch.c:693)
==735304==    by 0x14F462: omapi_wait_for_completion (dispatch.c:455)
==735304==    by 0x114D62: dhcpctl_connect (dhcpctl.c:115)
==735304==    by 0x113F23: main (omshell.c:420)
==735304==  Block was alloc'd at
==735304==    at 0x483DD99: calloc (in 
/usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==735304==    by 0x149F11: dmalloc (alloc.c:71)
==735304==    by 0x14A094: omapi_object_allocate (alloc.c:543)
==735304==    by 0x14DDDD: omapi_io_allocate (dispatch.c:39)
==735304==    by 0x14DDDD: omapi_register_io_object (dispatch.c:223)
==735304==    by 0x14BCA7: omapi_connect_list (connection.c:219)
==735304==    by 0x14C012: omapi_connect (connection.c:96)
==735304==    by 0x146BD6: omapi_protocol_connect (protocol.c:55)
==735304==    by 0x114D21: dhcpctl_connect (dhcpctl.c:106)
==735304==    by 0x113F23: main (omshell.c:420)
==735304== 
dhcpctl_connect: no more

When I build ISC's dhcpd from their git repository manually, not using
the source package, it works fine. I haven't got to the bottom of it,
though.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, 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

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to