[CXX-619] mongo::GridFS::storeFile cause core dump Created: 06/Jul/15  Updated: 11/Sep/19  Resolved: 06/Jul/15

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: legacy-1.0.3
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Yuncong Zhang Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

rhel


Attachments: HTML File Makefile     File core.10935.gz     File gridfs.cpp    

 Description   

I'm trying to use mongo cxx driver to load data into gridfs and find the example here: http://antydba.blogspot.com/2009/10/mongodb-c-tutorial-httpwww.html

Here is my code in attachment and core dump file

My host information:

$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.6 (Santiago)
$ uname -m
x86_64

$ g++ -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure -prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c+,objc,obj-c+,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)

$ rpm -qa | grep boost
boost-iostreams-1.41.0-25.el6.x86_64
boost-1.41.0-25.el6.x86_64
boost-thread-1.41.0-25.el6.x86_64
boost-graph-1.41.0-25.el6.x86_64
boost-system-1.41.0-25.el6.x86_64
boost-regex-1.41.0-25.el6.x86_64
boost-devel-1.41.0-25.el6.x86_64
boost-filesystem-1.41.0-25.el6.x86_64
boost-signals-1.41.0-25.el6.x86_64
boost-math-1.41.0-25.el6.x86_64
boost-date-time-1.41.0-25.el6.x86_64
boost-test-1.41.0-25.el6.x86_64
boost-program-options-1.41.0-25.el6.x86_64
boost-serialization-1.41.0-25.el6.x86_64
boost-wave-1.41.0-25.el6.x86_64
boost-python-1.41.0-25.el6.x86_64

Is it a bug in the driver or do I miss anything?

Thank you in advance!



 Comments   
Comment by Yuncong Zhang [ 06/Jul/15 ]

Hi Andrew,

Thanks for the quick response. I added the line below as the first line in the main function, and compiled the application.
mongo::client::initialize();

It works now.

Thanks you very much!

Comment by Andrew Morrow (Inactive) [ 06/Jul/15 ]

I took a quick look at your example, and I don't see that you are calling mongo::client::Initialize anywhere. You must initialize the driver before using it. Please see this document for additional information.

https://github.com/mongodb/mongo-cxx-driver/wiki/Configuring-the-Legacy-Driver

Could you try initializing the driver and see if that fixes the problem?

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