Skip to content

core dump: O_CREAT without mode #1

@vigith

Description

@vigith

I am getting a core dump when I am trying to start stored. This same error came when i tried to do make check. Could you please help me understand why this error is coming?

Also, could you please be kind enough to tell me how to make this program run on a 3 node cluster. I am not sure how to fill in the config file (currently my config file is empty). I get the same error with or without a config file.

LD_LIBRARY_PATH=$(pwd)/BUILD/usr/local/lib/ BUILD/usr/local/sbin/stored -vvvv  -d -c etc/config
[2015-May-04 20:58:18.642884]:[critical]:[init]: initialize_logger.service_start: Starting up
*** invalid open call: O_CREAT without mode ***: BUILD/usr/local/sbin/stored terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x37)[0x7f0b86e23b77]
/lib64/libc.so.6(+0xda30a)[0x7f0b86e0630a]
/home/vigith/rangexx/BUILD/usr/local/lib/librange.so.0(_ZN5range4util10LockFdRAIIC1ERKSsi+0x60)[0x7f0b87dd9270]
/home/vigith/rangexx/BUILD/usr/local/lib/librange.so.0(_ZN5range2db16BerkeleyDBCXXEnv8get_lockERKSsPSt10shared_ptrINS_4util10LockFdRAIIEE+0x26f)[0x7f0b87dd409f]
/home/vigith/rangexx/BUILD/usr/local/lib/librange.so.0(_ZN5range2db16BerkeleyDBCXXEnv15register_threadEv+0x30a)[0x7f0b87dd474a]
/home/vigith/rangexx/BUILD/usr/local/lib/librange.so.0(_ZN5range14config_builderERKSsNS_8ConsumerE+0x15a)[0x7f0b87e261ea]
BUILD/usr/local/sbin/stored[0x4239ce]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f0b86d4d7d5]
BUILD/usr/local/sbin/stored[0x427bbd]

The stacktrace of the same

(gdb) bt
#0  0x00007f9ee50ddbe9 in raise () from /lib64/libc.so.6
#1  0x00007f9ee50defe8 in abort () from /lib64/libc.so.6
#2  0x00007f9ee511ad17 in __libc_message () from /lib64/libc.so.6
#3  0x00007f9ee51a1b77 in __fortify_fail () from /lib64/libc.so.6
#4  0x00007f9ee518430a in __open_2 () from /lib64/libc.so.6
#5  0x00007f9ee6157270 in open (__oflag=66, __path=<optimized out>) at /usr/include/bits/fcntl2.h:57
#6  range::util::LockFdRAII::LockFdRAII (this=0x22d91c8, filename="/var/lib/rangexx/30309.140320447084480.lock", mode=66) at db/../util/fdraii.h:61
#7  0x00007f9ee615209f in construct<range::util::LockFdRAII, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int> (__p=0x22d91c8, this=<optimized out>)
    at /usr/include/c++/4.8.2/ext/new_allocator.h:120
#8  _S_construct<range::util::LockFdRAII, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int> (__p=0x22d91c8, __a=...) at /usr/include/c++/4.8.2/bits/alloc_traits.h:254
#9  construct<range::util::LockFdRAII, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int> (__p=0x22d91c8, __a=...) at /usr/include/c++/4.8.2/bits/alloc_traits.h:393
#10 _Sp_counted_ptr_inplace<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int> (__a=..., this=0x22d91b0) at /usr/include/c++/4.8.2/bits/shared_ptr_base.h:399
#11 construct<std::_Sp_counted_ptr_inplace<range::util::LockFdRAII, std::allocator<range::util::LockFdRAII>, (__gnu_cxx::_Lock_policy)2>, std::allocator<range::util::LockFdRAII> const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int> (__p=<optimized out>, this=<synthetic pointer>) at /usr/include/c++/4.8.2/ext/new_allocator.h:120
#12 _S_construct<std::_Sp_counted_ptr_inplace<range::util::LockFdRAII, std::allocator<range::util::LockFdRAII>, (__gnu_cxx::_Lock_policy)2>, std::allocator<range::util::LockFdRAII> const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int> (__p=<optimized out>, __a=<synthetic pointer>) at /usr/include/c++/4.8.2/bits/alloc_traits.h:254
#13 construct<std::_Sp_counted_ptr_inplace<range::util::LockFdRAII, std::allocator<range::util::LockFdRAII>, (__gnu_cxx::_Lock_policy)2>, std::allocator<range::util::LockFdRAII> const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int> (__p=<optimized out>, __a=<synthetic pointer>) at /usr/include/c++/4.8.2/bits/alloc_traits.h:393
#14 __shared_count<range::util::LockFdRAII, std::allocator<range::util::LockFdRAII>, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int> (__a=..., this=<optimized out>)
    at /usr/include/c++/4.8.2/bits/shared_ptr_base.h:502
#15 __shared_ptr<std::allocator<range::util::LockFdRAII>, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int> (__a=..., __tag=..., this=<optimized out>)
    at /usr/include/c++/4.8.2/bits/shared_ptr_base.h:957
#16 shared_ptr<std::allocator<range::util::LockFdRAII>, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int> (__a=..., __tag=..., this=<optimized out>)
    at /usr/include/c++/4.8.2/bits/shared_ptr.h:316
#17 allocate_shared<range::util::LockFdRAII, std::allocator<range::util::LockFdRAII>, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int> (__a=...)
    at /usr/include/c++/4.8.2/bits/shared_ptr.h:598
#18 make_shared<range::util::LockFdRAII, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int> () at /usr/include/c++/4.8.2/bits/shared_ptr.h:614
#19 range::db::BerkeleyDBCXXEnv::get_lock (lockfile="/var/lib/rangexx/30309.140320447084480.lock", registration_fd=0x7f9ee6673720) at db/berkeley_dbcxx_env.cpp:236
#20 0x00007f9ee615274a in range::db::BerkeleyDBCXXEnv::register_thread (this=0x22d31f0) at db/berkeley_dbcxx_env.cpp:218
#21 0x00007f9ee61a41ea in range::config_builder (filename="etc/config", type=type@entry=range::STORED) at core/config_builder.cpp:71
#22 0x00000000004239ce in main (argc=5, argv=<optimized out>, envp=<optimized out>) at stored.cpp:166

strace snippet

mmap(NULL, 83894272, PROT_READ|PROT_WRITE, MAP_SHARED, 11, 0) = 0x7f1b23145000
sendmsg(7, {msg_name(16)={sa_family=AF_INET, sin_port=htons(8125), sin_addr=inet_addr("127.0.0.1")}, msg_iov(1)=[{"rangexx.db.BerkeleyDBCXXEnv.regi"..., 54}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL)
 = 54
futex(0x7f1b2b9df834, FUTEX_WAKE_PRIVATE, 2147483647) = 0
sendmsg(7, {msg_name(16)={sa_family=AF_INET, sin_port=htons(8125), sin_addr=inet_addr("127.0.0.1")}, msg_iov(1)=[{"rangexx.db.BerkeleyDBCXXEnv.get_"..., 47}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL)
 = 47
open("/dev/tty", O_RDWR|O_NOCTTY|O_NONBLOCK) = 12
writev(12, [{"*** ", 4}, {"invalid open call: O_CREAT witho"..., 39}, {" ***: ", 6}, {"/home/vigith/rangexx/BUILD/usr/l"..., 48}, {" terminated\n", 12}], 5*** invalid open call: O_CREAT without mode ***: /home/vigith/rangexx/BUILD/usr/local/sbin/stored terminated
) = 109
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1b2c412000
futex(0x7f1b2b1db720, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f1b2b3f23f0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
write(12, "======= Backtrace: =========\n", 29======= Backtrace: =========
) = 29

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions