BewareMyPower commented on issue #442:
URL: 
https://github.com/apache/pulsar-client-cpp/issues/442#issuecomment-2317218119

   I just double checked the issue and it looks like a bug with protobuf:
   
   ```
   #1  0x0000ffffb1a58d2c in 
pulsar::proto::KeyValue::_InternalSerialize(unsigned char*, 
google::protobuf::io::EpsCopyOutputStream*) const () from 
/usr/local/lib/python3.10/dist-packages/pulsar_client.libs/libpulsar-8dc83e12.so
   #2  0x0000ffffb1cc50e0 in 
google::protobuf::internal::WireFormatLite::InternalWriteMessage(int, 
google::protobuf::MessageLite const&, int, unsigned char*, 
google::protobuf::io::EpsCopyOutputStream*) ()
      from 
/usr/local/lib/python3.10/dist-packages/pulsar_client.libs/libpulsar-8dc83e12.so
   #3  0x0000ffffb1a5b718 in 
pulsar::proto::MessageMetadata::_InternalSerialize(unsigned char*, 
google::protobuf::io::EpsCopyOutputStream*) const () from 
/usr/local/lib/python3.10/dist-packages/pulsar_client.libs/libpulsar-8dc83e12.so
   #4  0x0000ffffb1c96478 in 
google::protobuf::SerializeToArrayImpl(google::protobuf::MessageLite const&, 
unsigned char*, int) () from 
/usr/local/lib/python3.10/dist-packages/pulsar_client.libs/libpulsar-8dc83e12.so
   #5  0x0000ffffb1c94e98 in 
google::protobuf::MessageLite::SerializePartialToArray(void*, int) const () 
from 
/usr/local/lib/python3.10/dist-packages/pulsar_client.libs/libpulsar-8dc83e12.so
   #6  0x0000ffffb1c94d50 in 
google::protobuf::MessageLite::SerializeToArray(void*, int) const () from 
/usr/local/lib/python3.10/dist-packages/pulsar_client.libs/libpulsar-8dc83e12.so
   #7  0x0000ffffb1920704 in pulsar::Commands::newSend(pulsar::SharedBuffer&, 
pulsar::proto::BaseCommand&, pulsar::Commands::ChecksumType, 
pulsar::SendArguments const&) ()
      from 
/usr/local/lib/python3.10/dist-packages/pulsar_client.libs/libpulsar-8dc83e12.so
   ```
   
   I tried the python client on macOS and it does not have this error but 
encountered the same issue for Ubuntu.
   
   However, I tried the C++ client 3.5.1 on Ubuntu and this error does not 
happen:
   
   ```c++
   #include <pulsar/Client.h>
   using namespace pulsar;
   
   int main() {
       const std::string topic = "test-topic";
       Client client("pulsar://host.docker.internal:6650");
       Producer producer;
       client.createProducer(topic, producer);
   
       MessageBuilder::StringMap properties;
       for (int i = 0; i < 3000; i++) {
           properties["key" + std::to_string(i)] = "{\"foo\": \"bar\"}";
       }
       auto msg = 
MessageBuilder().setProperties(properties).setContent("test-message").build();
       producer.send(msg);
   
       client.close();
   }
   ```
   
   Increasing the `i` in loop does not fail with segfault as well. (if the 
properties are too big,  `ResultMessageTooLarge` will be returned)
   
   It might be an issue from the Python client side. So let me move it to 
`pulsar-client-python` first.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to