-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
SIGSEGV in TopicImpl.cpp partitioner_cb_trampoline #162
Comments
Hi, can you provide a backtrace from gdb and 'p keydata'? Thanks |
Some more questions:
|
is this using rdkafka_example_cpp or your own application YES At the same time the questions are irrelevant because it is basic C++ bug. From: Magnus Edenhill [mailto:[email protected]] Some more questions:
— |
I can't reproduce this on gcc 4.9.1. |
SIGSEGV is not always reproducible ( that is why it is very bad). Ask somebody who knows basic C++. From: Magnus Edenhill [mailto:[email protected]] I can't reproduce this on gcc 4.9.1. — |
I think it is okay to create a std::string with length 0, Try this program and see if it crashes too, otherwise I think there is another problem and I would need the stacktrace from GDB.
|
Yes it is okay to create a std::string with length 0. Take a look at C++ standars (2003) You cannot have array of size 0 From: Magnus Edenhill [mailto:[email protected]] I think it is okay to create a std::string with length 0, Try this program and see if it crashes too, otherwise I think there is another problem and I would need the stacktrace from GDB. #include #include int main (void) { std::string s((const char *)"hi", 0); std::cout << "str " << s << " len " << s.length() << std::endl; return 0; } — |
From: Igor Hersht Yes it is okay to create a std::string with length 0. Take a look at C++ standars (2003) You cannot have array of size 0 From: Magnus Edenhill [mailto:[email protected]] I think it is okay to create a std::string with length 0, Try this program and see if it crashes too, otherwise I think there is another problem and I would need the stacktrace from GDB. #include #include int main (void) { std::string s((const char *)"hi", 0); std::cout << "str " << s << " len " << s.length() << std::endl; return 0; } — |
Can you please provide the output from gdb command 'bt' from one of these crashes? |
I cannot now (I didn’t set ulimit). I fixed the bug in my version of the library. From: Magnus Edenhill [mailto:[email protected]] Can you please provide the output from gdb command 'bt' from one of these crashes? — |
Can you share your patch? |
I remove my local fix in the library (sorry but I just don’t have time to work on edenhill library) and rewrite producer::send with key in my application to call partitioner in my application. This is just way around the edenhill bug, but it is OK with me. |
Glad to hear that! :) |
I don’t get it. Why you closed the valid serious bug. |
Because I have nothing to go on:
|
You have C++ standard. You have your code which is wrong according to C++ standard. Take a look at C++ standard 21.3.1 table 40. Yes. SIGSEGV is not always reproducible. That is way this is one of the worse bug possible. From: Magnus Edenhill [mailto:[email protected]] Because I have nothing to go on:
— |
I'm sorry but I dont think that is the problem, I'm quite sure C++ supports empty std::strings. So I ask you again, could you please provide a gdb backtrace? |
Yes. C++ supports empty std::strings. I gave up rapiding myself and sending pointers to C++ standard. I am talking about one thing, you are talking about something else. From: Magnus Edenhill [mailto:[email protected]] I'm sorry but I dont think that is the problem, I'm quite sure C++ supports empty std::strings. So I ask you again, could you please provide a gdb backtrace? — |
is this bug fixed? I can reproduce it every。 below is my backtrace: #0 0x00000000004aff97 in partitioner_cb_trampoline (rkt=0x7fffb8005760, keydata=0x0, keylen=0, partition_cnt=1, rkt_opaque=0x7fffb81ff050, msg_opaque=0x0) at src/TopicImpl.cpp:59 |
In gdb, can you do |
this is gdb print: and I produce msg use the code in rdkafka_example.cpp,i set key "null", for (it = mess->begin(); it != mess->end(); it++) {
|
What if you print |
(gdb) p topicimpl->partitioner_cb_->partitioner_cb maybe I should initialize partitioner in the same thread? |
it works for me, initialize partitioner in the same thread. but is every produce should own a partitioner instance? |
You can use the same partitioner instance for multiple producers, just make sure it doesn't go out of scope / gets deleted / freed prior to all producer instances being destroyed. |
Wrong line (SIGSEGV when keylen == 0 , on random)
I understand that C++ interface is not official but have never seen that bad C++.
The text was updated successfully, but these errors were encountered: