netopeer2 icon indicating copy to clipboard operation
netopeer2 copied to clipboard

Segmentation fault occurred in netopeer2-server when netopeer2-cli connected

Open yanjfiber opened this issue 3 years ago • 1 comments

hi michalvasko, I'm trying to run netopeer2-server on an MIPS64 machine, when connecting to the netopeer2-server,we observed the following segmentation fault with a core dump. Please provide some help,thanks.

env: mips64 GNU/Linux cross compile version: netopeer: Netopeer2-1.1.39 netconf: libnetconf2-1.1.43 libyang: libyang-1.0.184 sysrepo: sysrepo-1.4.122 libssh: libssh-0.7.5

gdb info:

(gdb) bt #0 0x000000ffe95d2e84 in _nss_files_getpwnam_r () from /lib/libnss_files.so.2 #1 0x000000ffe95d2e74 in _nss_files_getpwnam_r () from /lib/libnss_files.so.2

netopee2-cli log:

netopeer2-cli

connect Interactive SSH Authentication Type your password: Password: nc ERROR: Session 1: SSH channel poll error (Socket error: disconnected). nc ERROR: Session 1: invalid session, discarding. cmd_connect: Connecting to the localhost:830 as user "root" failed.

netopee2-server log:

    [INF]: LY: Module "ietf-netconf@2013-09-29" successfully parsed as imported.

[INF]: LY: Resolving "ietf-netconf-with-defaults" unresolved schema nodes and their constraints... [INF]: LY: All "ietf-netconf-with-defaults" schema nodes and constraints resolved. [INF]: LY: Module "ietf-netconf-with-defaults@2011-06-01" successfully parsed as implemented. [INF]: LY: Searching for "ietf-netconf-notifications" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Resolving "ietf-netconf-notifications" unresolved schema nodes and their constraints... [INF]: LY: All "ietf-netconf-notifications" schema nodes and constraints resolved. [INF]: LY: Module "ietf-netconf-notifications@2012-02-06" successfully parsed as implemented. [INF]: LY: Searching for "ietf-origin" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Searching for "ietf-yang-metadata" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Resolving "ietf-origin" unresolved schema nodes and their constraints... [INF]: LY: All "ietf-origin" schema nodes and constraints resolved. [INF]: LY: Module "ietf-origin@2018-02-14" successfully parsed as implemented. [INF]: LY: Module "ietf-netconf-acm@2018-02-14" now implemented. [INF]: LY: Searching for "ietf-netconf-monitoring" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Module "ietf-netconf-monitoring@2010-10-04" successfully parsed as implemented. [INF]: LY: Searching for "ietf-netconf-nmda" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Searching for "ietf-origin" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Searching for "ietf-netconf-with-defaults" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Resolving "ietf-netconf-nmda" unresolved schema nodes and their constraints... [INF]: LY: All "ietf-netconf-nmda" schema nodes and constraints resolved. [INF]: LY: Module "ietf-netconf-nmda@2019-01-07" successfully parsed as implemented. [INF]: LY: Searching for "nc-notifications" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Searching for "notifications" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Module "notifications@2008-07-14" successfully parsed as imported. [INF]: LY: Module "nc-notifications@2008-07-14" successfully parsed as implemented. [INF]: LY: Module "notifications@2008-07-14" now implemented. [INF]: LY: Searching for "ietf-x509-cert-to-name" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Module "ietf-x509-cert-to-name@2014-12-10" successfully parsed as implemented. [INF]: LY: Searching for "ietf-crypto-types" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Module "ietf-crypto-types@2019-07-02" successfully parsed as implemented. [INF]: LY: Searching for "ietf-keystore" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Searching for "ietf-crypto-types" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Resolving "ietf-keystore" unresolved schema nodes and their constraints... [INF]: LY: All "ietf-keystore" schema nodes and constraints resolved. [INF]: LY: Module "ietf-keystore@2019-07-02" successfully parsed as implemented. [INF]: LY: Searching for "ietf-truststore" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Module "ietf-truststore@2019-07-02" successfully parsed as implemented. [INF]: LY: Searching for "ietf-tcp-common" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Module "ietf-tcp-common@2019-07-02" successfully parsed as implemented. [INF]: LY: Searching for "ietf-ssh-server" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Searching for "ietf-ssh-common" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Module "ietf-ssh-common@2019-07-02" successfully parsed as imported. [INF]: LY: Searching for "ietf-keystore" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Searching for "iana-crypt-hash" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Module "iana-crypt-hash@2014-08-06" successfully parsed as imported. [INF]: LY: Module "ietf-ssh-server@2019-07-02" successfully parsed as implemented. [INF]: LY: Searching for "ietf-tls-server" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Searching for "ietf-tls-common" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Module "ietf-tls-common@2019-07-02" successfully parsed as imported. [INF]: LY: Searching for "ietf-truststore" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Module "ietf-tls-server@2019-07-02" successfully parsed as implemented. [INF]: LY: Searching for "ietf-netconf-server" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Searching for "ietf-x509-cert-to-name" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Searching for "ietf-tcp-client" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Searching for "ietf-tcp-common" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Module "ietf-tcp-client@2019-07-02" successfully parsed as imported. [INF]: LY: Searching for "ietf-tcp-server" in /mnt/sysrepo-1.4.122/build/repository/yang. [INF]: LY: Loading schema from "/mnt/sysrepo-1.4.122/build/repository/yang/[email protected]" file. [INF]: LY: Module "ietf-tcp-server@2019-07-02" successfully parsed as imported. [INF]: LY: Resolving "ietf-netconf-server" unresolved schema nodes and their constraints... [INF]: LY: All "ietf-netconf-server" schema nodes and constraints resolved. [INF]: LY: Module "ietf-netconf-server@2019-07-02" successfully parsed as implemented. [INF]: SR: No scheduled changes. [INF]: SR: Connection 73 created. [INF]: SR: Session 543 (user "root", CID 73) created. [WRN]: SR: Recovering RPC/action "/ietf-netconf:get-config" subscription of CID 72. [WRN]: SR: Recovering RPC/action "/ietf-netconf:edit-config" subscription of CID 72. [WRN]: SR: Recovering RPC/action "/ietf-netconf:copy-config" subscription of CID 72. [WRN]: SR: Recovering RPC/action "/ietf-netconf:delete-config" subscription of CID 72. [WRN]: SR: Recovering RPC/action "/ietf-netconf:lock" subscription of CID 72. [WRN]: SR: Recovering RPC/action "/ietf-netconf:unlock" subscription of CID 72. [WRN]: SR: Recovered a read-lock of CID 72 (sr_shmext_rpc_subscription_add). [WRN]: SR: Recovering RPC/action "/ietf-netconf:get" subscription of CID 72. [WRN]: SR: Recovering RPC/action "/ietf-netconf:kill-session" subscription of CID 72. [WRN]: SR: Recovering RPC/action "/ietf-netconf:commit" subscription of CID 72. [WRN]: SR: Recovering RPC/action "/ietf-netconf:discard-changes" subscription of CID 72. [WRN]: SR: Recovering RPC/action "/ietf-netconf:validate" subscription of CID 72. [WRN]: SR: Recovering RPC/action "/notifications:create-subscription" subscription of CID 72. [WRN]: SR: Recovering RPC/action "/ietf-netconf-nmda:get-data" subscription of CID 72. [WRN]: SR: Recovering RPC/action "/ietf-netconf-nmda:edit-data" subscription of CID 72. [WRN]: SR: Recovering module "ietf-netconf-monitoring" operational subscription of CID 72. [WRN]: SR: Recovering module "nc-notifications" operational subscription of CID 72. [INF]: LY: Resolving unresolved data nodes and their constraints... [INF]: LY: There is no leafref "/ietf-keystore:keystore/ietf-keystore:asymmetric-keys/ietf-keystore:asymmetric-key/ietf-keystore:name" with the value "genkey", but it is not required. [INF]: LY: All data nodes and constraints resolved. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: LN: Listening on 0.0.0.0:830 for SSH connections. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [WRN]: SR: Recovering module "ietf-netconf-server" operational subscription of CID 72. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data. [INF]: SR: Triggering "ietf-keystore" "done" event on enabled data. [INF]: SR: Triggering "ietf-truststore" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-acm" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-acm" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-acm" "done" event on enabled data. [INF]: SR: Triggering "ietf-netconf-acm" "done" event on enabled data. [WRN]: SR: Recovering module "ietf-netconf-acm" operational subscription of CID 72. [WRN]: SR: Recovering module "ietf-netconf-acm" operational subscription of CID 72. [WRN]: SR: Recovering module "ietf-netconf-acm" operational subscription of CID 72.

[INF]: LN: Accepted a connection on 0.0.0.0:830. [INF]: SR: Session 572 (user "root", CID 73) created. [1970/01/03 14:06:26.094201, 1] ssh_server_connection_callback: SSH client banner: SSH-2.0-libssh_0.7.5 [1970/01/03 14:06:26.094360, 1] ssh_analyze_banner: Analyzing banner: SSH-2.0-libssh_0.7.5 [INF]: LN: Received an SSH message "request-service" of subtype "ssh-userauth". [INF]: LN: Received an SSH message "request-auth" of subtype "none". [INF]: LN: Received an SSH message "request-auth" of subtype "interactive". [INF]: LN: Received an SSH message "request-auth" of subtype "interactive". [WRN]: LN: User authentication successful with an empty password! [INF]: LN: User "root" authenticated. [INF]: LN: Received an SSH message "request-channel-open" of subtype "session". [INF]: LN: Received an SSH message "request-channel" of subtype "subsystem". [INF]: SR: Session 573 (user "root", CID 73) created. [INF]: SR: There are no subscribers for "ietf-netconf-notifications" notifications. [INF]: NP: Generated new event (netconf-session-start). [INF]: LY: Resolving unresolved data nodes and their constraints... [INF]: LY: All data nodes and constraints resolved. [INF]: LN: Schema "ietf-yang-library" was requested. [INF]: LY: Resolving unresolved data nodes and their constraints... [INF]: LY: All data nodes and constraints resolved. [INF]: NP: Session 1: thread 1 event new RPC. [INF]: LY: Resolving unresolved data nodes and their constraints... [INF]: LY: All data nodes and constraints resolved. [INF]: LN: Schema "ietf-datastores" was requested. [INF]: LY: Resolving unresolved data nodes and their constraints... [INF]: LY: All data nodes and constraints resolved. [INF]: NP: Session 1: thread 1 event new RPC. [INF]: LY: Resolving unresolved data nodes and their constraints... [INF]: LY: All data nodes and constraints resolved. [INF]: LN: Schema "ietf-datastores" was requested. [INF]: LY: Resolving unresolved data nodes and their constraints... [INF]: LY: All data nodes and constraints resolved. [INF]: NP: Session 1: thread 2 event new RPC. [INF]: LY: Resolving unresolved data nodes and their constraints... [INF]: LY: All data nodes and constraints resolved. [INF]: LY: Resolving unresolved data nodes and their constraints... [INF]: LY: All data nodes and constraints resolved. [INF]: SR: Published event "rpc" "/ietf-netconf:get" with ID 1 priority 0 for 1 subscribers. [INF]: SR: Processing "/ietf-netconf:get" "rpc" event with ID 1 priority 0 (remaining 1 subscribers). [INF]: LY: Resolving unresolved data nodes and their constraints... [INF]: LY: All data nodes and constraints resolved. Segmentation fault (core dumped)

yanjfiber avatar Oct 14 '22 07:10 yanjfiber

It seems the crash is in a library function getpwnam_r(3) so I am not sure there is anything we can do about that, in all likelihood it is because of the platform you are on. If there is valgrind available, you can try to use that, but without more information I am certainly not able to help.

michalvasko avatar Oct 17 '22 07:10 michalvasko