[CDRIVER-4223] Connection immediately hangs in solaris 10 after upgrading mongo-c-driver Created: 08/Nov/21  Updated: 09/Nov/21  Resolved: 09/Nov/21

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Jeroen Ooms Assignee: Kevin Albertson
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Hello, I maintain the mongolite R package.

After upgrading the vendored mongo-c-driver from 1.16.2 to 1.19.2, the client now hangs in Solaris immediately when connecting to a server. Below a backtrace of the hung process after running mongoc_collection_command_simple with: {"ping":1}

The same code works fine with mongo-c-driver 1.16.2.

#0  0xfef0e3d6 in __systemcall6 () from /lib/libc.so.1
#1  0xfeef5fab in __lwp_sigmask () from /lib/libc.so.1
#2  0xfeeff094 in call_user_handler () from /lib/libc.so.1
#3  <signal handler called>
#4  0xfef0b9f5 in _so_recv () from /lib/libc.so.1
#5  0xfc63a41d in recv () from /lib/libsocket.so.1
#6  0xfbed4d4e in mongoc_socket_recv (sock=0x95712c8, buf=0x8b8dcff, buflen=512, flags=0, expire_at=1428317502) at mongoc/mongoc-socket.c:1096
#7  0xfbed6d1c in _mongoc_stream_socket_readv (stream=0xa05fc90, iov=0x803d2e4, iovcnt=1, min_bytes=0, timeout_msec=5000) at mongoc/mongoc-stream-socket.c:157
#8  0xfbed817a in mongoc_stream_readv (stream=0xa05fc90, iov=0x803d2e4, iovcnt=1, min_bytes=0, timeout_msec=5000) at mongoc/mongoc-stream.c:237
#9  0xfbed82a8 in mongoc_stream_read (stream=0xa05fc90, buf=0x8b8dcff, count=512, min_bytes=0, timeout_msec=5000) at mongoc/mongoc-stream.c:281
#10 0xfbf17138 in _mongoc_buffer_try_append_from_stream (buffer=0x803d370, stream=0xa05fc90, size=512, timeout_msec=5000) at mongoc/mongoc-buffer.c:329
#11 0xfbf14c7e in _mongoc_http_send (req=0x803d814, timeout_ms=5000, use_tls=false, ssl_opts=0x92afac0, res=0x803d800, error=0x803d600) at mongoc/mongoc-http.c:161
#12 0xfbef63e9 in _contact_ocsp_responder (id=0xaabf5d8, peer=0x8b43a88, ssl_opts=0x92afac0, ocsp_uri_count=0x803d894) at mongoc/mongoc-openssl.c:721
#13 0xfbef67df in _mongoc_ocsp_tlsext_status (ssl=0x89e97d8, opts=0x92afab8) at mongoc/mongoc-openssl.c:839
#14 0xfbefabdc in _mongoc_stream_tls_openssl_handshake (stream=0xa58c3a8, host=0xa254218 "cluster0-shard-00-02-84vdt.mongodb.net", events=0x803d994, error=0x8d7c4a0) at mongoc/mongoc-stream-tls-openssl.c:572
#15 0xfbed766d in mongoc_stream_tls_handshake (stream=0xa58c3a8, host=0xa254218 "cluster0-shard-00-02-84vdt.mongodb.net", timeout_msec=0, events=0x803d994, error=0x8d7c4a0) at mongoc/mongoc-stream-tls.c:70
#16 0xfbf19310 in mongoc_async_cmd_tls_setup (stream=0xa58c3a8, events=0x8d7c484, ctx=0xa254218, timeout_msec=0, error=0x8d7c4a0) at mongoc/mongoc-async-cmd.c:85
#17 0xfbf19c01 in _mongoc_async_cmd_phase_setup (acmd=0x8d7c478) at mongoc/mongoc-async-cmd.c:266
#18 0xfbf193fe in mongoc_async_cmd_run (acmd=0x8d7c478) at mongoc/mongoc-async-cmd.c:114
#19 0xfbf19012 in mongoc_async_run (async=0xa3a2b30) at mongoc/mongoc-async.c:160
#20 0xfbef3d21 in mongoc_topology_scanner_work (ts=0x96f1108) at mongoc/mongoc-topology-scanner.c:1207
#21 0xfbeef70b in mongoc_topology_scan_once (topology=0x8a7c078, obey_cooldown=true) at mongoc/mongoc-topology.c:820
#22 0xfbeef78b in _mongoc_topology_do_blocking_scan (topology=0x8a7c078, error=0x803dbb0) at mongoc/mongoc-topology.c:848
#23 0xfbeeffa5 in mongoc_topology_select_server_id (topology=0x8a7c078, optype=MONGOC_SS_READ, read_prefs=0x0, error=0x803e680) at mongoc/mongoc-topology.c:1169
#24 0xfbeb4a02 in _mongoc_cluster_select_server_id (cs=0x0, topology=0x8a7c078, optype=MONGOC_SS_READ, read_prefs=0x0, error=0x803e680) at mongoc/mongoc-cluster.c:2778
#25 0xfbeb4acc in _mongoc_cluster_stream_for_optype (cluster=0x9e923ec, optype=MONGOC_SS_READ, read_prefs=0x0, cs=0x0, reply=0x803e880, error=0x803e680) at mongoc/mongoc-cluster.c:2825
#26 0xfbeb4bed in mongoc_cluster_stream_for_reads (cluster=0x9e923ec, read_prefs=0x0, cs=0x0, reply=0x803e880, error=0x803e680) at mongoc/mongoc-cluster.c:2883
#27 0xfbeaca8b in _mongoc_client_command_with_opts (client=0x9e923e8, db_name=0xa4c4fc0 "test", command=0x97e9e58, mode=MONGOC_CMD_RAW, opts=0x0, flags=MONGOC_QUERY_NONE, user_prefs=0x0, default_prefs=0x0, default_rc=0x0, default_wc=0x0, reply=0x803e880, error=0x803e680) at mongoc/mongoc-client.c:2057
#28 0xfbeb74d2 in mongoc_collection_command_simple (collection=0x9cb4cd0, command=0x97e9e58, read_prefs=0x0, reply=0x803e880, error=0x803e680) at mongoc/mongoc-collection.c:657
#29 0xfbea4949 in R_mongo_collection_command_simple (ptr_col=0x8a53010, command=0x8a4f640) at collection.c:240
 



 Comments   
Comment by Jeroen Ooms [ 08/Nov/21 ]

OK that is fine. Solaris is a requirement for R, but I can work around the bug by setting MONGOC_URI_TLSDISABLEOCSPENDPOINTCHECK on Solaris. So you can close this issue.

Comment by Kevin Albertson [ 08/Nov/21 ]

Hi jeroenooms@gmail.com, the C driver no longer supports or tests with Solaris (CDRIVER-2230). Is Solaris a requirement for mongolite? We are happy to review a PR for a fix, but there are no plans to add testing for Solaris.

Comment by Jeroen Ooms [ 08/Nov/21 ]

I had a closer look at the backtrace above and realized the problem is the ocsp client. So I found a workaround by setting MONGOC_URI_TLSDISABLEOCSPENDPOINTCHECK, that solves the problem.

So the actual problem is that the http/ocsp client does not work on Solaris.

Comment by Jeroen Ooms [ 08/Nov/21 ]

I tried some older versions of mongo-c-driver, and the problem already appears for 1.17.0. So it was introduced between the 1.16.2 and 1.17.0 release.

Generated at Wed Feb 07 21:20:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.