Bug 177784

Summary: databases/mongodb 2.4.1 failed to start (bus error)
Product: Ports & Packages Reporter: Anton Gerasimov <agerrasimov>
Component: Individual Port(s)Assignee: Alex Dupre <ale>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
pkginfo.txt
none
uname.txt none

Description Anton Gerasimov 2013-04-11 19:30:01 UTC
When trying to launch mongod using rc script located at /usr/local/etc/rc.d/mongod it fails and dumps backtrace 
to console. As might be seen in "mongo-start-sudo.txt".
MongoDB has stock configuration; no specific options in /etc/make.conf were point. Only WITHOUT_X11=Yes.

Fix: There is a some workaround. If mongod rc script starts under su - everythyng goes the right way. So

% sudo -s
% su -l
% /usr/local/etc/rc.d/mongod start

This will get us properly started mongod - "mongo-start-sudo-su.txt" and "sockstat.txt"


[17:30:39][chim@gib-in:~]                                                                                               % sudo -s
[17:30:41][root@gib-in:/usr/home/chim]                                                                                  % su -l
[17:30:48][root@gib-in:~]                                                                                               % /usr/local/etc/rc.d/mongod start
Starting mongod.
about to fork child process, waiting until server is ready for connections.
forked process: 59938
all output going to: /var/db/mongodb/mongod.log
child process started successfully, parent exiting
--- mongo-start-sudo-su.txt ends here ---

% sockstat |grep mongo
mongodb  mongod     59938 7  tcp4   10.0.13.43:27017      *:*
mongodb  mongod     59938 8  stream /tmp/mongodb-27017.sock
mongodb  mongod     59938 9  tcp4   10.0.13.43:28017      *:*
--- sockstat.txt ends here ---



/usr/local/bin/mongod:
	libv8.so => /usr/local/lib/libv8.so (0x801349000)
	libsnappy.so.2 => /usr/local/lib/libsnappy.so.2 (0x801c0e000)
	libpcre.so.3 => /usr/local/lib/libpcre.so.3 (0x801e14000)
	libpcrecpp.so.0 => /usr/local/lib/libpcrecpp.so.0 (0x802072000)
	libkvm.so.5 => /lib/libkvm.so.5 (0x80227b000)
	libssl.so.6 => /usr/lib/libssl.so.6 (0x802484000)
	libcrypto.so.6 => /lib/libcrypto.so.6 (0x8026d7000)
	librt.so.1 => /usr/lib/librt.so.1 (0x802a77000)
	libexecinfo.so.1 => /usr/local/lib/libexecinfo.so.1 (0x802c7c000)
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x802e8a000)
	libm.so.5 => /lib/libm.so.5 (0x80319a000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x8033bb000)
	libthr.so.3 => /lib/libthr.so.3 (0x8035c8000)
	libc.so.7 => /lib/libc.so.7 (0x8037eb000)
--- ldd-mongod.txt ends here -----aen2nqLIIUCjHIpSMUvwfaQtHz4FmF4PRyXoGZ4Ttwrl5K4F
Content-Type: text/plain; name="mongo-start-sudo.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="mongo-start-sudo.txt"

[17:29:46][chim@gib-in:~]                                                                                               % sudo /usr/local/etc/rc.d/mongod start
Starting mongod.
about to fork child process, waiting until server is ready for connections.
forked process: 59874
Thu Apr 11 17:29:52.863 terminate() called, printing stack (if implemented for platform):
Thu Apr 11 17:29:52.864 Invalid access at address: 0x802c82fb5 from thread:

Thu Apr 11 17:29:52.864 Got signal: 10 (Bus error: 10).

Thu Apr 11 17:29:52.864 Backtrace:
0x5959fc 0x5960ad 0x8035d457e
 0x5959fc <_ZN5mongo10abruptQuitEi+988> at /usr/local/bin/mongod
 0x5960ad <_ZN5mongo24abruptQuitWithAddrSignalEiP9__siginfoPv+669> at /usr/local/bin/mongod
 0x8035d457e <_pthread_sigmask+718> at /lib/libthr.so.3

ERROR: child process failed, exited with error number 14
/usr/local/etc/rc.d/mongod: WARNING: failed to start mongod
How-To-Repeat: 1) update ports tree
2) check /usr/ports/databases/mongodb port version (ensure v2.4.1)
3) cd /usr/ports/databases/mongodb
4) make install clean
5) echo 'mongod_enable="YES"' >> /etc/rc.conf
6) sudo /usr/local/etc/rc.d/mongod start
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-04-11 19:47:29 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Alex Dupre freebsd_committer freebsd_triage 2013-05-07 14:01:32 UTC
State Changed
From-To: open->closed

It should be fixed now.