eclipse / paho.mqtt.c

An Eclipse Paho C client library for MQTT for Windows, Linux and MacOS. API documentation: https://eclipse.github.io/paho.mqtt.c/
https://eclipse.org/paho
Other
1.94k stars 1.09k forks source link

[PowerPC, tests] "Good rc from connect" asserts fail: `rc was -1` #1524

Open barracuda156 opened 2 days ago

barracuda156 commented 2 days ago

Describe the bug A lot of tests fail on PowerPC (Big-endian) due to the same issue: "good rc from connect" assert fails.

To Reproduce Run tests on BE powerpc. (I cannot test on Linux/BSD, but the issue might be relevant there as well.)

Expected behavior All tests should pass.

Log files Example:

5/277 Testing: test1-5-disconnect-with-quiesce-static
5/277 Test: test1-5-disconnect-with-quiesce-static
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_paho.mqtt.c/paho.mqtt.c/work/build/test/test1-static" "--test_no" "5" "--connection" "tcp://localhost:1883"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_paho.mqtt.c/paho.mqtt.c/work/build/test
"test1-5-disconnect-with-quiesce-static" start time: Sep 17 15:27 CST
Output:
----------------------------------------------------------

Setting connection to tcp://localhost:1883
20240917 152725.073 Starting test 5 - disconnect with quiesce timeout should allow exchanges to complete
=========================================================
                   Trace Output
Product name: Eclipse Paho Synchronous MQTT C Client Library
Version: 1.3.13
Build level: 2024-09-17T07:25:38Z
=========================================================
20240917 152725.077 Assertion failed, file /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_paho.mqtt.c/paho.mqtt.c/work/paho.mqtt.c-1.3.13/test/test1.c, line 887, description: Good rc from connect

rc was -120240917 152725.077 failed: test test 5. 1 tests run, 1 failures.
20240917 152725.077 verdict fail
<end of output>
Test time =   0.01 sec
----------------------------------------------------------
Test Failed.
"test1-5-disconnect-with-quiesce-static" end time: Sep 17 15:27 CST
"test1-5-disconnect-with-quiesce-static" time elapsed: 00:00:00
----------------------------------------------------------

6/277 Testing: test1-6-connlost-will-message-static
6/277 Test: test1-6-connlost-will-message-static
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_paho.mqtt.c/paho.mqtt.c/work/build/test/test1-static" "--test_no" "6" "--connection" "tcp://localhost:1883" "--proxy_connection" "tcp://localhost:1884"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_paho.mqtt.c/paho.mqtt.c/work/build/test
"test1-6-connlost-will-message-static" start time: Sep 17 15:27 CST
Output:
----------------------------------------------------------

Setting connection to tcp://localhost:1883
20240917 152725.088 Starting test 6 - connectionLost and will messages
=========================================================
                   Trace Output
Product name: Eclipse Paho Synchronous MQTT C Client Library
Version: 1.3.13
Build level: 2024-09-17T07:25:38Z
=========================================================
20240917 152725.193 Assertion failed, file /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_paho.mqtt.c/paho.mqtt.c/work/paho.mqtt.c-1.3.13/test/test1.c, line 998, description: good rc from connect

rc was -1
20240917 152725.193 failed: test test6. 3 tests run, 1 failures.

20240917 152725.193 verdict fail
<end of output>
Test time =   0.11 sec
----------------------------------------------------------
Test Failed.

All failures are like this. Looks like everything else passes (but since this assertion sits inside a lot of tests, many tests fail due to that).

Environment (please complete the following information):

Additional context Failure do not appear to be conditional on using libdispatch or not. While normally macOS powerpc does not support libdispatch, I have its version locally and can use it with the build (which works fine). Yet, I get identical failures with and without libdispatch. Build without libdispatch is fixed in https://github.com/eclipse/paho.mqtt.c/pull/1523

icraggs commented 1 day ago

Have you tried using the REVERSED library compile option? It changes the order of the network data integers which is sometimes needed for Big-endian machines. All tests should fail if this is the issue.

barracuda156 commented 1 day ago

Have you tried using the REVERSED library compile option? It changes the order of the network data integers which is sometimes needed for Big-endian machines. All tests should fail if this is the issue.

I did not, but I can try tomorrow.

I did not wait until 270 tests complete, since mostly everything was failing (but some passed), however from the log it looks like there is just one failure which breaks tests, while other test cases inside a given test pass. (But I did not dig into the source code, so my impression may be wrong.)

barracuda156 commented 3 hours ago

@icraggs How it should be used? I do not see REVERSED option in CMakeLists. Pass it as a cppflag, -DREVERSED?

barracuda156 commented 2 hours ago

To get a picture of what fails and what passes (I had to interrupt two tests, they seem to freeze indefinitely):

--->  Testing paho.mqtt.c
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_paho.mqtt.c/paho.mqtt.c/work/build" && /usr/bin/make test 
Running tests...
/opt/local/bin/ctest --force-new-ctest-process 
Test project /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_paho.mqtt.c/paho.mqtt.c/work/build
        Start   1: test1-1-single-thread-client-static
  1/277 Test   #1: test1-1-single-thread-client-static .........................................***Failed    0.05 sec
        Start   2: test1-2-multithread-callbacks-static
  2/277 Test   #2: test1-2-multithread-callbacks-static ........................................***Failed    0.23 sec
        Start   3: test1-3-connack-return-codes-static
  3/277 Test   #3: test1-3-connack-return-codes-static .........................................   Passed    0.02 sec
        Start   4: test1-4-client-persistence-static
  4/277 Test   #4: test1-4-client-persistence-static ...........................................***Failed    0.03 sec
        Start   5: test1-5-disconnect-with-quiesce-static
  5/277 Test   #5: test1-5-disconnect-with-quiesce-static ......................................***Failed    0.02 sec
        Start   6: test1-6-connlost-will-message-static
  6/277 Test   #6: test1-6-connlost-will-message-static ........................................***Failed    0.16 sec
        Start   7: test1-7-connlost-binary-will-message-static
  7/277 Test   #7: test1-7-connlost-binary-will-message-static .................................***Failed    0.13 sec
        Start   8: test1-1-single-thread-client
  8/277 Test   #8: test1-1-single-thread-client ................................................***Failed    0.03 sec
        Start   9: test1-2-multithread-callbacks
  9/277 Test   #9: test1-2-multithread-callbacks ...............................................***Failed    0.22 sec
        Start  10: test1-3-connack-return-codes
 10/277 Test  #10: test1-3-connack-return-codes ................................................   Passed    0.01 sec
        Start  11: test1-4-client-persistence
 11/277 Test  #11: test1-4-client-persistence ..................................................***Failed    0.02 sec
        Start  12: test1-5-disconnect-with-quiesce
 12/277 Test  #12: test1-5-disconnect-with-quiesce .............................................***Failed    0.02 sec
        Start  13: test1-6-connlost-will-message
 13/277 Test  #13: test1-6-connlost-will-message ...............................................***Failed    0.12 sec
        Start  14: test1-7-connlost-binary-will-message
 14/277 Test  #14: test1-7-connlost-binary-will-message ........................................***Failed    0.11 sec
        Start  15: test1-1-ws-single-thread-client
 15/277 Test  #15: test1-1-ws-single-thread-client .............................................***Failed    0.01 sec
        Start  16: test1-2-ws-multithread-callbacks
 16/277 Test  #16: test1-2-ws-multithread-callbacks ............................................***Failed    0.22 sec
        Start  17: test1-3-ws-connack-return-codes
 17/277 Test  #17: test1-3-ws-connack-return-codes .............................................   Passed    0.02 sec
        Start  18: test1-4-ws-client-persistence
 18/277 Test  #18: test1-4-ws-client-persistence ...............................................***Failed    0.02 sec
        Start  19: test1-5-ws-disconnect-with-quiesce
 19/277 Test  #19: test1-5-ws-disconnect-with-quiesce ..........................................***Failed    0.02 sec
        Start  20: test1-6-ws-connlost-will-message
 20/277 Test  #20: test1-6-ws-connlost-will-message ............................................***Failed    0.12 sec
        Start  21: test1-7-ws-connlost-binary-will-message
 21/277 Test  #21: test1-7-ws-connlost-binary-will-message .....................................***Failed    0.11 sec
        Start  22: test15-1-single-thread-client-static
 22/277 Test  #22: test15-1-single-thread-client-static ........................................***Failed    0.01 sec
        Start  23: test15-2-multithread-callbacks-static
 23/277 Test  #23: test15-2-multithread-callbacks-static .......................................***Exception: SegFault 84.58 sec
        Start  24: test15-3-connack-return-codes-static
 24/277 Test  #24: test15-3-connack-return-codes-static ........................................   Passed    0.10 sec
        Start  25: test15-4-client-persistence-static
 25/277 Test  #25: test15-4-client-persistence-static ..........................................***Failed    0.13 sec
        Start  26: test15-5-disconnect-with-quiesce-static
 26/277 Test  #26: test15-5-disconnect-with-quiesce-static .....................................***Failed    0.10 sec
        Start  27: test15-6-connlost-will-message-static
 27/277 Test  #27: test15-6-connlost-will-message-static .......................................***Failed   39.30 sec
        Start  28: test15-7-connlost-binary-will-message-static
 28/277 Test  #28: test15-7-connlost-binary-will-message-static ................................***Failed    0.12 sec
        Start  29: test15-1-single-thread-client
 29/277 Test  #29: test15-1-single-thread-client ...............................................***Failed    0.01 sec
        Start  30: test15-2-multithread-callbacks
 30/277 Test  #30: test15-2-multithread-callbacks ..............................................Bus error***Exception:  90.84 sec
        Start  31: test15-3-connack-return-codes
 31/277 Test  #31: test15-3-connack-return-codes ...............................................   Passed    0.03 sec
        Start  32: test15-4-client-persistence
 32/277 Test  #32: test15-4-client-persistence .................................................***Failed    0.05 sec
        Start  33: test15-5-disconnect-with-quiesce
 33/277 Test  #33: test15-5-disconnect-with-quiesce ............................................***Failed    0.02 sec
        Start  34: test15-6-connlost-will-message
 34/277 Test  #34: test15-6-connlost-will-message ..............................................***Failed   39.23 sec
        Start  35: test15-7-connlost-binary-will-message
 35/277 Test  #35: test15-7-connlost-binary-will-message .......................................***Failed    0.14 sec
        Start  36: test15-1-ws-single-thread-client
 36/277 Test  #36: test15-1-ws-single-thread-client ............................................***Failed    0.01 sec
        Start  37: test15-2-ws-multithread-callbacks
 37/277 Test  #37: test15-2-ws-multithread-callbacks ...........................................Bus error***Exception:  91.28 sec
        Start  38: test15-3-ws-connack-return-codes
 38/277 Test  #38: test15-3-ws-connack-return-codes ............................................   Passed    0.02 sec
        Start  39: test15-4-ws-client-persistence
 39/277 Test  #39: test15-4-ws-client-persistence ..............................................***Failed    0.03 sec
        Start  40: test15-5-ws-disconnect-with-quiesce
 40/277 Test  #40: test15-5-ws-disconnect-with-quiesce .........................................***Failed    0.02 sec
        Start  41: test15-6-ws-connlost-will-message
 41/277 Test  #41: test15-6-ws-connlost-will-message ...........................................***Failed   39.24 sec
        Start  42: test15-7-ws-connlost-binary-will-message
 42/277 Test  #42: test15-7-ws-connlost-binary-will-message ....................................***Failed    0.12 sec
        Start  43: test2-1-multiple-threads-single-client-static
 43/277 Test  #43: test2-1-multiple-threads-single-client-static ...............................***Failed    0.22 sec
        Start  44: test2-1-multiple-threads-single-client
 44/277 Test  #44: test2-1-multiple-threads-single-client ......................................***Failed    0.22 sec
        Start  45: test2-1-ws-multiple-threads-single-client
 45/277 Test  #45: test2-1-ws-multiple-threads-single-client ...................................***Failed    0.33 sec
        Start  46: test3-1-ssl-conn-to-non-SSL-broker-static
 46/277 Test  #46: test3-1-ssl-conn-to-non-SSL-broker-static ...................................   Passed    0.06 sec
        Start  47: test3-2as-mutual-ssl-auth-single-thread-static
 47/277 Test  #47: test3-2as-mutual-ssl-auth-single-thread-static ..............................***Failed    0.04 sec
        Start  48: test3-2am-mutual-ssl-auth-multi-thread-static
 48/277 Test  #48: test3-2am-mutual-ssl-auth-multi-thread-static ...............................***Failed    0.29 sec
        Start  49: test3-2b-mutual-ssl-broker-missing-client-cert-static
 49/277 Test  #49: test3-2b-mutual-ssl-broker-missing-client-cert-static .......................   Passed    0.04 sec
        Start  50: test3-2c-mutual-ssl-client-missing-broker-cert-static
 50/277 Test  #50: test3-2c-mutual-ssl-client-missing-broker-cert-static .......................   Passed    0.06 sec
        Start  51: test3-2e-ssl-with-ha-static
 51/277 Test  #51: test3-2e-ssl-with-ha-static .................................................***Failed    0.08 sec
        Start  52: test3-2e-ws-ssl-with-ha-static
 52/277 Test  #52: test3-2e-ws-ssl-with-ha-static ..............................................***Failed    0.03 sec
        Start  53: test3-3as-broker-auth-server-cert-in-client-store-single-thread-static
 53/277 Test  #53: test3-3as-broker-auth-server-cert-in-client-store-single-thread-static ......***Failed    0.03 sec
        Start  54: test3-3am-broker-auth-server-cert-in-client-store-multi-thread-static
 54/277 Test  #54: test3-3am-broker-auth-server-cert-in-client-store-multi-thread-static .......***Failed    0.25 sec
        Start  55: test3-3b-broker-auth-client-missing-broker-cert-static
 55/277 Test  #55: test3-3b-broker-auth-client-missing-broker-cert-static ......................   Passed    0.03 sec
        Start  56: test3-4s-broker-auth-accept-invalid-certificate-single-thread-static
 56/277 Test  #56: test3-4s-broker-auth-accept-invalid-certificate-single-thread-static ........***Failed    0.03 sec
        Start  57: test3-4m-broker-auth-accept-invalid-certificate-multi-thread-static
 57/277 Test  #57: test3-4m-broker-auth-accept-invalid-certificate-multi-thread-static .........***Failed    0.37 sec
        Start  58: test3-1-ssl-conn-to-non-SSL-broker
 58/277 Test  #58: test3-1-ssl-conn-to-non-SSL-broker ..........................................   Passed    0.03 sec
        Start  59: test3-2as-mutual-ssl-auth-single-thread
 59/277 Test  #59: test3-2as-mutual-ssl-auth-single-thread .....................................***Failed    0.03 sec
        Start  60: test3-2am-mutual-ssl-auth-multi-thread
 60/277 Test  #60: test3-2am-mutual-ssl-auth-multi-thread ......................................***Failed    0.25 sec
        Start  61: test3-2b-mutual-ssl-broker-missing-client-cert
 61/277 Test  #61: test3-2b-mutual-ssl-broker-missing-client-cert ..............................   Passed    0.03 sec
        Start  62: test3-2c-mutual-ssl-client-missing-broker-cert
 62/277 Test  #62: test3-2c-mutual-ssl-client-missing-broker-cert ..............................   Passed    0.04 sec
        Start  63: test3-2e-ssl-with-ha
 63/277 Test  #63: test3-2e-ssl-with-ha ........................................................***Failed    0.03 sec
        Start  64: test3-3as-broker-auth-server-cert-in-client-store-single-thread
 64/277 Test  #64: test3-3as-broker-auth-server-cert-in-client-store-single-thread .............***Failed    0.03 sec
        Start  65: test3-3am-broker-auth-server-cert-in-client-store-multi-thread
 65/277 Test  #65: test3-3am-broker-auth-server-cert-in-client-store-multi-thread ..............***Failed    0.26 sec
        Start  66: test3-3b-broker-auth-client-missing-broker-cert
 66/277 Test  #66: test3-3b-broker-auth-client-missing-broker-cert .............................   Passed    0.04 sec
        Start  67: test3-4s-broker-auth-accept-invalid-certificate-single-thread
 67/277 Test  #67: test3-4s-broker-auth-accept-invalid-certificate-single-thread ...............***Failed    0.03 sec
        Start  68: test3-4m-broker-auth-accept-invalid-certificate-multi-thread
 68/277 Test  #68: test3-4m-broker-auth-accept-invalid-certificate-multi-thread ................***Failed    0.37 sec
        Start  69: test3-1-ws-ssl-conn-to-non-SSL-broker
 69/277 Test  #69: test3-1-ws-ssl-conn-to-non-SSL-broker .......................................   Passed    0.03 sec
        Start  70: test3-2as-ws-mutual-ssl-auth-single-thread
 70/277 Test  #70: test3-2as-ws-mutual-ssl-auth-single-thread ..................................***Failed    0.03 sec
        Start  71: test3-2am-ws-mutual-ssl-auth-multi-thread
 71/277 Test  #71: test3-2am-ws-mutual-ssl-auth-multi-thread ...................................***Failed    0.25 sec
        Start  72: test3-2b-ws-mutual-ssl-broker-missing-client-cert
 72/277 Test  #72: test3-2b-ws-mutual-ssl-broker-missing-client-cert ...........................   Passed    0.02 sec
        Start  73: test3-2c-ws-mutual-ssl-client-missing-broker-cert
 73/277 Test  #73: test3-2c-ws-mutual-ssl-client-missing-broker-cert ...........................   Passed    0.03 sec
        Start  74: test3-2e-ws-ssl-with-ha
 74/277 Test  #74: test3-2e-ws-ssl-with-ha .....................................................***Failed    0.02 sec
        Start  75: test3-3as-ws-broker-auth-server-cert-in-client-store-single-thread
 75/277 Test  #75: test3-3as-ws-broker-auth-server-cert-in-client-store-single-thread ..........***Failed    0.03 sec
        Start  76: test3-3am-ws-broker-auth-server-cert-in-client-store-multi-thread
 76/277 Test  #76: test3-3am-ws-broker-auth-server-cert-in-client-store-multi-thread ...........***Failed    0.25 sec
        Start  77: test3-3b-ws-broker-auth-client-missing-broker-cert
 77/277 Test  #77: test3-3b-ws-broker-auth-client-missing-broker-cert ..........................   Passed    0.03 sec
        Start  78: test3-4s-ws-broker-auth-accept-invalid-certificate-single-thread
 78/277 Test  #78: test3-4s-ws-broker-auth-accept-invalid-certificate-single-thread ............***Failed    0.03 sec
        Start  79: test3-4m-ws-broker-auth-accept-invalid-certificate-multi-thread
 79/277 Test  #79: test3-4m-ws-broker-auth-accept-invalid-certificate-multi-thread .............***Failed    0.36 sec
        Start  80: test4-1-basic-connect-subscribe-receive-static
^C 80/277 Test  #80: test4-1-basic-connect-subscribe-receive-static ..............................***Exception: Interrupt3679.03 sec
        Start  81: test4-2-connect-timeout-static
 81/277 Test  #81: test4-2-connect-timeout-static ..............................................   Passed    7.64 sec
        Start  82: test4-3-multiple-client-objs-simultaneous-working-static
 82/277 Test  #82: test4-3-multiple-client-objs-simultaneous-working-static ....................***Failed    0.22 sec
        Start  83: test4-4-send-receive-big-messages-static
^C 83/277 Test  #83: test4-4-send-receive-big-messages-static ....................................***Exception: Interrupt100.32 sec
        Start  84: test4-5-connack-return-codes-static
 84/277 Test  #84: test4-5-connack-return-codes-static .........................................   Passed    0.14 sec
. . .

I think -DREVERSED made no change when passed as a cppflag. Same tests fail and pass.