Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. Segfault after migration from 3.9 to 4.0 or 4.1

Segfault after migration from 3.9 to 4.0 or 4.1

Scheduled Pinned Locked Moved Support
13 Posts 3 Posters 56.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V
    V
    Victor Kirhenshtein
    wrote on last edited by
    #4

    Hi,

    looks like you have server configuration parameter ICMP.PingSize set to 1 (or other small value). It has to be set to at least 46. There is a bug in a server that it does not check this value for validity, and incorrect value causes crash later on.

    Best regards,
    Victor

    1 Reply Last reply
    0
    • F
      F
      fldiet
      wrote on last edited by
      #5

      Hi,

      setting ICMP.PingSize to 46 from its lowered value fixed the segmentation faults after upgrading.
      Interestingly it did not seem to cause any issues at runtime prior to upgrading from NetXMS 3.9.176 though.

      Thank you very much!

      Best regards,

        Florian

      1 Reply Last reply
      0
      • H
        H
        hoeth
        wrote on last edited by
        #6

        Yes, we have set the ping size to 1 in order to reduce traffic, because most of our nodes are connected through mobile internet, so we pay for the traffic. What's the reason for having a 46 byte minimum? And how did NetXMS-3.9 handle this? Did it simply fall back to larger packets?

        1 Reply Last reply
        0
        • V
          V
          Victor Kirhenshtein
          wrote on last edited by
          #7

          Actually as I start thinking about it, minimum size is 28, not 46. Because this value includes both IP header (20 bytes) and ICMP header (8 bytes), it cannot be less than that. 46 is minimum payload size for Ethernet frame. If you are using only Ethernet for communications, setting ping size to any value less than 46 will not reduce traffic, as payload will be padded to minimum length anyway. However, if you are using communication channels capable of sending shorter frames than reducing ping size further can make sense.

          1 Reply Last reply
          0
          • H
            H
            hoeth
            wrote on last edited by
            #8

            Ah, I thought ICMP.PingSize referred to the payload, not to the whole packet.

            I'm now looking at https://wiki.netxms.org/wiki/Server_Configuration_Variables which says "Size of ICMP packets (in bytes, excluding IP header size) used for status polls.", so I guess minimum would be 8, correct? Or is that documentation wrong and the IP header is included in ICMP.PingSize?

            1 Reply Last reply
            0
            • V
              V
              Victor Kirhenshtein
              wrote on last edited by
              #9

              Documentation is wrong, I checked source code 🙂 Will fix that.

              1 Reply Last reply
              0
              • H
                H
                hoeth
                wrote on last edited by
                #10

                Great, thanks a lot!

                1 Reply Last reply
                0
                • F
                  F
                  fldiet
                  wrote on last edited by
                  #11

                  I have done some more testing of our servers' behaviour with changing ICMP.PingSize.
                  This time, the value was changed in a working NetXMS 4.1.283 instance ( not measuring through an upgrade from 3.9 ).
                  Each time the delay of deciding whether the error occurred after restarting NetXMS to apply changes was 5mins. Error -if occurring- always was well under 2mins.

                  Here is the outcome:
                  28 - no problems, as expected
                  20 - no problems, unexpected
                  19 - segmentation fault as discussed

                  Could it be possible the documentation is partly correct, but it's not excluding IP(20B), but ICMP(8B) header?

                  Edit: Suppressing an emoji  🙂

                  1 Reply Last reply
                  0
                  • V
                    V
                    Victor Kirhenshtein
                    wrote on last edited by
                    #12

                    Actual code that caused crash looked like this:

                       int bytes = request->packetSize - sizeof(IPHDR);
                       packet.m_icmpHdr.m_wChecksum = 0;
                       packet.m_icmpHdr.m_wChecksum = CalculateIPChecksum(&packet, bytes);
                    

                    If total packet size < 20, bytes will be negative, which will cause crash within CalculateIPChecksum. With packet size between 20 and 27, result will be positive and CalculateIPChecksum will actually calculate checksum for requested number of bytes, but invalid ICMP packet will be sent (with only part of the header).

                    Best regards,
                    Victor

                    1 Reply Last reply
                    0
                    • F
                      F
                      fldiet
                      wrote on last edited by
                      #13

                      Ah, that clarifies the situation.
                      Thank you very much for your insight!

                      Best regards,

                        Florian

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      Powered by NodeBB Contributors
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups