Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-1378

CFLAGS and LDFLAGS can cause truncated platform info in client metadata handshake

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.4
    • Affects Version/s: None
    • Component/s: None
    • None

      scott.lhommedieu shared an example of client metadata logs, which make it impossible to determine the PHP version:

      cfg=0x156b8e9 posix=200809 stdc=201112 CC=GCC 5.4.0 20160609 CFLAGS='-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -ped...
      

      Ideally, the output would include the PHP version at the end:

      cfg=0x30c9 posix=200809 CC=GCC 4.8.5 20150623 (Red Hat 4.8.5-11) CFLAGS='-g -O2' LDFLAGS='' / PHP 7.1.6
      

      The PHP version string appended during MINIT (via mongoc_handshake_data_append) is cut off during construction of the handshake document (_mongoc_handshake_build_doc_with_application and _append_platform_field). This is likely caused by libmongoc first appending user-set CFLAGS and LDFLAGS in set_platform_string. Those arguably have less value than the PHP version, so we should consider leaving those constants unset in config.m4 or propose that libmongoc swap the order of appended platform fields so that data from the wrapping driver (e.g. ext-mongodb) is included before CFLAGS/LDFLAGS.

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: