-
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
the program of the Consumer crashed when create topic #2579
Comments
Run your program in gdb (or with asan or valgrind) to find out where and why it crashes |
this is my infomation by gdb |
inspect the mpKafkaConsumer object, or run with valgrind / asan |
I have the same error today ,do not know why... |
find answer,when updating rdkafka from lower version to 1.2.1, forgot to replace rdkafka headers in my project... rookie mistake... |
*Bump v1.4.0
code is
|
@Lovett1991 Interesting, can you print *base and the HandleImpl-casted base in gdb? |
|
Misread your request...
|
Can you print |
|
Okay, that looks fine. |
|
Can't really make out where the null pointer dereference is happening seeing that neither base or rk_ seem to be NULL. |
I got some wierd errors when trying to use
CmakeLists.txt
and re ran with valgrind...
I'm not entirely sure this has had the desired effect. |
Still weird. Can you provide a minimal reproducible program? |
yeah give us a min :) Wierdly just tried the shared library it seems to work |
Are you linking rdkafka++ statically? |
It does not build. Is librdkafka supposed to be cloned to libs/librdkafka?
|
yeah it's a submodule on the tag V1.4.0 Ok I've just pushed again and fixed the issue (hadn't linked publicly) |
Thank you. Works flawlessly on Ubuntu 19.04 x64 with gcc 8.3.0 maglun@eden:~/src/librdkafka-basic-sample (init)$ valgrind ./LibrdKafkaSample
==19555== Memcheck, a memory error detector
==19555== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==19555== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
==19555== Command: ./LibrdKafkaSample
==19555==
creating consumer
eccreating topic
topic created
ho ==19555==
==19555== HEAP SUMMARY:
==19555== in use at exit: 37,101 bytes in 145 blocks
==19555== total heap usage: 712 allocs, 567 frees, 248,285 bytes allocated
==19555==
==19555== LEAK SUMMARY:
==19555== definitely lost: 272 bytes in 3 blocks
==19555== indirectly lost: 2,364 bytes in 17 blocks
==19555== possibly lost: 0 bytes in 0 blocks
==19555== still reachable: 34,465 bytes in 125 blocks
==19555== suppressed: 0 bytes in 0 blocks
==19555== Rerun with --leak-check=full to see details of leaked memory
==19555==
==19555== For counts of detected and suppressed errors, rerun with: -v
==19555== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
maglun@eden:~/src/librdkafka-basic-sample (init)$ echo $?
0 |
super weird Ubuntu 19.10 x64 with gcc 9.2.1 I'll try in a vm/docker and see if it makes any difference
|
... someone did a derp. problem was similar to @Patrick-Hua with headers... In the sample project I had
as opposed to
not sure what version I have in the shared lib but evidently theres a difference. Thanks for the help. |
So all is good now, problem resolved? The C++ API is not ABI safe, unfortunately. |
yup works fine now ;) |
Glad to hear it! |
Recently, I used the librdkafka latest version library. v1.2.1, I create th new topic for consumer,but excute "RdKafka::Topic::create",the program crashed, received signal SIGSEGV mesage, the code fragments is :
what's wrong with my code?
The text was updated successfully, but these errors were encountered: