Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consecutive delete and set #7

Closed
jsia opened this issue Oct 22, 2013 · 7 comments
Closed

consecutive delete and set #7

jsia opened this issue Oct 22, 2013 · 7 comments

Comments

@jsia
Copy link

jsia commented Oct 22, 2013

got this error during a consecutive delete and set

After a period of time of executing these commands I get a segfault

key = "test"
for (i = 0; i< 100; i++) {
conn.delete(key)
conn.set(key, "test")
}

Note: multiple threads

terminate called after throwing an instance of 'std::length_error'
what(): basic_string::_S_create

Program received signal SIGABRT, Aborted.
[Switching to Thread 801c07400 (LWP 100406/redis-leveldb)]
0x00000008016e0a7c in thr_kill () from /lib/libc.so.7
(gdb)
(gdb) bt
#0 0x00000008016e0a7c in thr_kill () from /lib/libc.so.7
#1 0x000000080177dd3b in abort () from /lib/libc.so.7
#2 0x0000000800fc4c94 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/libstdc++.so.6
#3 0x0000000800fc9193 in std::set_unexpected () from /usr/lib/libstdc++.so.6
#4 0x0000000800fc91d3 in std::terminate () from /usr/lib/libstdc++.so.6
#5 0x0000000800fc913a in __cxa_throw () from /usr/lib/libstdc++.so.6
#6 0x000000080101a972 in std::__throw_length_error () from /usr/lib/libstdc++.so.6
#7 0x0000000800fca5d9 in std::string::_Rep::_S_create () from /usr/lib/libstdc++.so.6
#8 0x0000000800fcb305 in std::string::_S_copy_chars () from /usr/lib/libstdc++.so.6
#9 0x0000000800fcb4ba in std::basic_string<char, std::char_traits, std::allocator >::basic_string () from /usr/lib/libstdc++.so.6
#10 0x00000000004072fe in RLConnection::do_read ()
#11 0x0000000000407739 in RLConnection::on_readable ()
#12 0x00000008008aac52 in ev_invoke_pending (loop=0x801c6f600) at ev.c:2994
#13 0x00000008008af37c in ev_run (loop=0x801c6f600, flags=Variable "flags" is not available.

) at ev.c:3394
#14 0x00000000004049fb in RLServer::start ()

@jsia
Copy link
Author

jsia commented Oct 23, 2013

I think it has an issue when the sent command is too long I saw ing RLConnection::on_readable that there is a case 0 but there is a TODO is this the fix for this problem?

@KDr2
Copy link
Owner

KDr2 commented Nov 16, 2013

@jsia

Yes, it's a known issue about std::length_error exception when the command is too long(longer than the buffer size READ_BUFFER defined in src/rl.h).

This may be fixed in the future, but I'm not sure about it: receive big command should use big memory block, and I should allocate memory dynamically for it, this may hurt the performance.

@KDr2
Copy link
Owner

KDr2 commented Nov 16, 2013

@jsia

But your code:

key = "test"
for (i = 0; i< 100; i++) {
conn.delete(key)
conn.set(key, "test")
}

will not trigger this issue, am I right?

@KDr2
Copy link
Owner

KDr2 commented Nov 16, 2013

I did some commits in the develop branch, now the server will close the connection to the client who sends a big command(has an argument larger than READ_BUFFER) , could you try this again?

@KDr2 KDr2 mentioned this issue Nov 16, 2013
@jsia
Copy link
Author

jsia commented Nov 21, 2013

Yup my code will not trigger this issue, i'm trying your commit now will keep you posted

@bitthegeek
Copy link

Tried the new development branch but still returns the following under heavy load:

HOSTADDR:()
DB_PATH:(redis.db)
PORT:(8323)
Server running successfully
terminate called after throwing an instance of 'std::length_error'
  what():  basic_string::_S_create

@KDr2
Copy link
Owner

KDr2 commented Jan 9, 2015

I am closing this one, because somebody is working on #13.

@KDr2 KDr2 closed this as completed Jan 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants