[CDRIVER-1702] Segfault in test suite Created: 14/Oct/16  Updated: 19/Oct/16  Resolved: 14/Oct/16

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

Type: Bug Priority: Major - P3
Reporter: Remi Collet Assignee: Hannes Magnusson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Fedora 23



 Description   

Using 1.5.0-rc2 or git master.

Without options test suite pass.

When build with:--enable-debug-symbols --enable-shm-counters --disable-automatic-init-and-cleanup --enable-crypto-system-profile --enable-tests --enable-sasl --enable-ssl --with-libbson=bundled --disable-html-docs --enable-man-pages

$ make check
...

{ "status": "PASS", "test_file": "/MongoDB/handshake/appname_frozen_pooled", "seed": "989029086", "start": 8948.452855240, "end": 8948.452866507, "elapsed": 0.000011267 }

,
lt-test-libmongoc: tests/test-mongoc-handshake.c:260: test_mongoc_handshake_data_append_success: Assertion `strstr (val, platform) != ((void *)0)' failed.
/bin/sh : ligne 1 : 24969 Abandon (core dumped)./$TEST_PROG "--no-fork" -F test-results.json
Makefile:6070: recipe for target 'test' failed

(gdb) bt
#0 0x00007f3dc463fa28 in raise () from /lib64/libc.so.6
#1 0x00007f3dc464162a in abort () from /lib64/libc.so.6
#2 0x00007f3dc4638227 in __assert_fail_base () from /lib64/libc.so.6
#3 0x00007f3dc46382d2 in __assert_fail () from /lib64/libc.so.6
#4 0x000055941454ee2a in test_mongoc_handshake_data_append_success () at tests/test-mongoc-handshake.c:260
#5 0x0000559414567aa6 in TestSuite_RunTest (suite=suite@entry=0x7ffff3a88450, test=test@entry=0x559416794570, count=count@entry=0x7ffff3a8837c) at tests/TestSuite.c:602
#6 0x00005594145689ee in TestSuite_RunSerial (suite=<optimized out>) at tests/TestSuite.c:868
#7 TestSuite_Run (suite=0x7ffff3a88450) at tests/TestSuite.c:949
#8 0x000055941450bf6f in main (argc=4, argv=0x7ffff3a88598) at tests/test-libmongoc.c:1844



 Comments   
Comment by Hannes Magnusson [ 14/Oct/16 ]

Thanks

Comment by Githook User [ 14/Oct/16 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@mongodb.com'}

Message: Merge pull request #401 from remicollet/issue-1702

CDRIVER-1702 don't fail when returned platform is truncated
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/ccbbf24464df4dbfe2bac9ced9ecd9bfc19d8342

Comment by Githook User [ 14/Oct/16 ]

Author:

{u'username': u'remicollet', u'name': u'Remi Collet', u'email': u'fedora@famillecollet.com'}

Message: CDRIVER-1702 don't fail when returned platform is truncated
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/a021ada41374b9be9b478252d53a2a199bfdbf7b

Comment by Remi Collet [ 14/Oct/16 ]

Trivial fix proposal
https://github.com/mongodb/mongo-c-driver/pull/401

Comment by Remi Collet [ 14/Oct/16 ]

More debug, it fails with

val = cfg=0x38f9 posix=200809 stdc=201112 CC=GCC 5.3.1 20160406 (Red Hat 5.3.1-6) CFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtun

platform = ./configure -nottoomanyflags

val seems truncated.

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