-
1. Re: Blacktie Data buffer - 2D char array
zhfeng Nov 6, 2018 9:40 AM (in response to dnlsaravanan)Hi Saravanan,
The buffer definition looks good to me and I need to add an unit test for the "char[][]" type since we missed. I just took a quick look at the codec/src/main/cpp/DefaultCodecImpl.cxx and it uses the memcpy directly when type is "char[]" or "char[][]". So in theory I think it should work.
Regards,
Amos
-
2. Re: Blacktie Data buffer - 2D char array
dnlsaravanan Nov 6, 2018 10:59 AM (in response to dnlsaravanan)Ok. Thank you.
My C structure having this type of fields and overall one structure size is around 200K bytes and i'm using X_C_TYPE in tpalloc.
1) Is there any maximum allocation size limit for tpalloc when using X_C_TYPE?
2) how do i know how many bytes it has been allocated after the tpalloc call?
Thanks,
Saravanan
-
3. Re: Blacktie Data buffer - 2D char array
zhfeng Nov 6, 2018 9:12 PM (in response to dnlsaravanan)1 of 1 people found this helpful1) Is there any maximum allocation size limit for tpalloc when using X_C_TYPE?
No, I think there is no limit for tpalloc but you might get out of memory if the buffer size is too large.
2) how do i know how many bytes it has been allocated after the tpalloc call?
It could use the tptypes to get the size of memory allocated. just like
char* buf = tpalloc("X_C_TYPE", "mydata", 0, 0); long size = tptypes(buf, NULL, NULL);
-
4. Re: Blacktie Data buffer - 2D char array
dnlsaravanan Nov 7, 2018 1:21 AM (in response to zhfeng)Thanks much for the replies.
-
5. Re: Blacktie Data buffer - 2D char array
dnlsaravanan Nov 7, 2018 7:26 PM (in response to zhfeng)Hi,
I’m evaluating blacktie ATMI calls for my project(migrate tuxedo app to blacktie Use Narayana JBoss with PostGreSQL).
Currently I am facing segmentation issue with tpacall() and tpfree(). The buffer is pointing to valid memory location and having data during tpacall.
Using tptypes verified tpalloc size after the call, its same as my structure size (buffer having multiple 2D char array as mentioned above).
Any idea how to debug failing tpacall scenario?
#0 0x00007ffff607d9f6 in _int_malloc () from /usr/lib64/libc.so.6
#1 0x00007ffff608010c in malloc () from /usr/lib64/libc.so.6
#2 0x00007ffff5bc3263 in allocator_alloc (in_size=<optimized out>,
allocator=<optimized out>) at memory/unix/apr_pools.c:349
#3 apr_pool_create_ex (newpool=0x7fffffff9cf0, parent=0x640b18, abort_fn=0x0,
allocator=0x63ca00) at memory/unix/apr_pools.c:891
#4 0x00007ffff7ae9c6d in log4cxx::helpers::Pool::Pool (this=0x7fffffff9cf0)
at /home/hudson/blacktie/utils/apache-log4cxx/src/main/cpp/pool.cpp:34
#5 0x00007ffff7b35eb0 in log4cxx::Logger::forcedLog (this=0x652bc0,
level1=..., message="HttpTxManager:57:ENTER HttpTxManager constructor",
location=...)
at /home/hudson/blacktie/utils/apache-log4cxx/src/main/cpp/logger.cpp:121
#6 0x00007ffff74b655c in atmibroker::tx::HttpTxManager::HttpTxManager (
this=0x6853a0,
txmUrl=0x714a60 "http://127.0.0.1:8080/rest-at-coordinator/tx/transaction-manager", resUrl=0x6ef560 "127.0.0.1:8888", __in_chrg=<optimized out>,
__vtt_parm=<optimized out>)
at /home/jenkins/workspace/release-narayana/blacktie/tx/src/main/cpp/HttpTxManager.cxx:57
#7 0x00007ffff74b71ea in atmibroker::tx::HttpTxManager::create (txmUrl=0x714a60 "http://127.0.0.1:8080/rest-at-coordinator/tx/transaction-ma nager", resUrl=0x6ef560 "127.0.0.1:8888")
at /home/jenkins/workspace/release-narayana/blacktie/tx/src/main/cpp/HttpTxM---Type <return> to continue, or q <return> to quit---
anager.cxx:87
#8 0x00007ffff74a2c3e in atmibroker::tx::TxManager::get_instance () at /home/jenkins/workspace/release-narayana/blacktie/tx/src/main/cpp/TxManager.cxx:49
#9 0x00007ffff74b5255 in txx_get_control () at /home/jenkins/workspace/release-narayana/blacktie/tx/src/main/cpp/TxManagerc.cxx:56
#10 0x00007ffff72424c0 in tpacall (svc=0x42eb8c "some service", idata=0x69ab20 "N", ilen=0, flags=34)
Blacktie version: blacktie-5.9.0.Final
Wildfly: 13
Thanks,
-
6. Re: Blacktie Data buffer - 2D char array
zhfeng Nov 7, 2018 10:38 PM (in response to dnlsaravanan)Did you on the Linux host ? you may get it by "uname -a" ? what is the version of the gcc, you could get by "gcc --version"
From the trace log of the call stack, I assume the the issue is related to the log4xx when logging the message.
-
7. Re: Blacktie Data buffer - 2D char array
dnlsaravanan Nov 7, 2018 11:05 PM (in response to zhfeng)>Did you on the Linux host ?
Yes. Red Hat.
>you may get it by "uname -a" ?
Linux localhost.localdomain 3.10.0-693.el7.x86_64 #1 SMP Thu Jul 6 19:56:57 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux
>what is the version of the gcc, you could get by "gcc --version"
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
-
8. Re: Blacktie Data buffer - 2D char array
zhfeng Nov 8, 2018 1:58 AM (in response to dnlsaravanan)Thanks for providing these information, I will try to reproduce this issue with blacktie 5.9.0.Final.
Did you download the binary release from http://www.jboss.org/jbosstm/downloads/5.9.0.Final/binary/blacktie-5.9.0.Final-centos54x64-bin.tar.gz ?
What is the version of the apr on your machine ? you can find by "yum list apr"
-
9. Re: Blacktie Data buffer - 2D char array
dnlsaravanan Nov 8, 2018 2:52 AM (in response to zhfeng)>Did you download the binary release from http://www.jboss.org/jbosstm/downloads/5.9.0.Final/binary/blacktie-5.9.0.Final-centos54x64-bin.tar.gz ?
Yes.
>What is the version of the apr on your machine ? you can find by "yum list apr"
yum is not working. RPM query works.
rpm -qa | grep -i apr
apr-1.4.8-3.el7.x86_64
apr-util-1.5.2-6.el7.x86_64
/usr/lib64/apr-util-1
/usr/lib64/libapr-1.so.0
/usr/lib64/libapr-1.so.0.4.8
/usr/lib64/libaprutil-1.so.0
/usr/lib64/libaprutil-1.so.0.5.2
/usr/lib64/libgstdataprotocol-0.10.so.0
/usr/lib64/libgstdataprotocol-0.10.so.0.30.0
-
10. Re: Blacktie Data buffer - 2D char array
zhfeng Nov 12, 2018 1:47 AM (in response to dnlsaravanan)I create [JBTM-3075] Segment fault failure with tpacall when running the blacktie with centos7 - JBoss Issue Tracker and need more investigation.
-
11. Re: Blacktie Data buffer - 2D char array
dnlsaravanan Nov 12, 2018 2:23 AM (in response to zhfeng)Thanks for the response. Have you reproduced the issue?
-
12. Re: Blacktie Data buffer - 2D char array
dnlsaravanan Nov 14, 2018 8:47 AM (in response to dnlsaravanan)Attached failing tpacall blacktie logs which generated during service invocation.
-
blacktie.log.txt.zip 28.2 KB
-
-
13. Re: Blacktie Data buffer - 2D char array
tomjenkinson Nov 14, 2018 9:03 AM (in response to dnlsaravanan)Are you able to replicate the problem with a small reproducer please - ideally it might be possible to do so with raising a pull request with a unit test on:
narayana/TestTPACall.cxx at master · jbosstm/narayana · GitHub
narayana/TestTPTypes.cxx at master · jbosstm/narayana · GitHub
-
14. Re: Blacktie Data buffer - 2D char array
dnlsaravanan Nov 15, 2018 9:24 AM (in response to tomjenkinson)Sorry! there is problem with our code which leads to tpacall failure.
The code does memset() after tpalloc() which is incorrect.
Does tpalloc() initializes to zero (all the fields) for X_C_TYPE data buffer when it succeeds? or do i need to initialize data buffer using memset() before use?
Again apologize for the inconvenience!
Thanks much.