[vpp-dev] Use libvcl_ldpreload with gdb #vpp

2018-06-01 Thread ductm18
Hi,
I'm trying to develop an app using the vcl library.
Unfortunately, I cannot start the app with gdb when preloading the library.
I start it with this command:
> 
> sudo VCL_DEBUG=2 LDP_DEBUG=2
> LD_PRELOAD=/home/hardcore/ductm/vpp/lib64/libvcl_ldpreload.so gdb
> ./epoll-server

Sometimes, gdb crashes at the beginning due to buffer overflow. Here is the bt:

> 
> *** buffer overflow detected ***: gdb terminated
> === Backtrace: =
> /lib64/libc.so.6(__fortify_fail+0x37)[0x7f2473240cb7]
> /lib64/libc.so.6(+0x10be80)[0x7f247323ee80]
> /lib64/libc.so.6(+0x10dc27)[0x7f2473240c27]
> gdb[0x5d6178]
> gdb(add_file_handler+0x36)[0x5d70d6]
> gdb[0x4be307]
> gdb(_initialize_python+0x37b)[0x51de4b]
> gdb(gdb_init+0x2f)[0x6907af]
> gdb[0x5d073f]
> gdb(catch_errors+0x8a)[0x5ce68a]
> gdb(gdb_main+0x24)[0x5d1784]
> gdb(main+0x3e)[0x45734e]
> /lib64/libc.so.6(__libc_start_main+0xf5)[0x7f2473154af5]
> gdb[0x457391]

Sometimes, gdb can start but when I try to run any app, it just hangs up. When 
printing some logs, I realize that the ldp app is created 2 times. At the 
second one, it hangs when trying to connect to vpp:
> 
> 
> 
> 
> (gdb) run -p 12345
> 
> 
> 
> Starting program: /home/hardcore/ductm/./epoll-server -p 12345
> 
> 
> 
> vppcom_app_create:2330: VCL<18422>: configured VCL debug level (2) from
> VCL_DEBUG!
> 
> 
> 
> vppcom_cfg_heapsize:1819: VCL<18422>: using default heapsize 268435456
> (0x1000)
> 
> 
> 
> vppcom_cfg_heapsize:1965: VCL<18422>: allocated VCL heap = 0x7fffe25a7000,
> size 268435456 (0x1000)
> 
> 
> 
> vppcom_cfg_read:1985: VCL<18422>: using default configuration.
> 
> 
> 
> vppcom_connect_to_vpp:707: VCL<18422>: app (ldp-18422-app) connecting to
> VPP api (/vpe-api)...
> 
> 
> 
> vppcom_connect_to_vpp:723: VCL<18422>: app (ldp-18422-app) is connected to
> VPP!
> 
> 
> 
> vppcom_app_create:2461: VCL<18422>: sending session enable
> 
> 
> 
> vppcom_app_create:2472: VCL<18422>: sending app attach
> 
> 
> 
> vppcom_app_create:2485: VCL<18422>: app_name 'ldp-18422-app',
> my_client_index 768 (0x300)
> 
> 
> 
> ldp_init:150: LDP<18422>: configured LDP debug level (2) from the env var
> LDP_DEBUG!
> 
> 
> 
> ldp_init:218: LDP<18422>: LDP initialization: done!
> 
> 
> 
> ldp_constructor:3456: LDP<18422>: LDP constructor: done!
> 
> 
> 
>  
> 
> 
> 
> [Thread debugging using libthread_db enabled]
> 
> 
> 
> Using host libthread_db library "/lib64/libthread_db.so.1".
> 
> 
> 
>  
> 
> 
> 
> vppcom_app_create:2330: VCL<18422>: configured VCL debug level (2) from
> VCL_DEBUG!
> 
> 
> 
> vppcom_cfg_heapsize:1819: VCL<18422>: using default heapsize 268435456
> (0x1000)
> 
> 
> 
> vppcom_cfg_heapsize:1965: VCL<18422>: allocated VCL heap = 0x7fffe27d1000,
> size 268435456 (0x1000)
> 
> 
> 
> vppcom_cfg_read:1985: VCL<18422>: using default configuration.
> 
> 
> 
> vppcom_connect_to_vpp:707: VCL<18422>: app (ldp-18422-app) connecting to
> VPP api (/vpe-api)...
> 
> 

Running the app without gdb works for some apps; some others show unexpected 
behaviors.
I use the VCL lib from master branch (18.07)
Does this lib require some specific ways to work with gdb?
Thank you!


Re: [vpp-dev] Using custom openssl with vpp #vpp

2018-05-15 Thread ductm18
Hi Florin,

Yep, that works. After adding some flags into the .am file, I can link the 
openssl plugin with openssl 1.1.
Thank you!

DucTM


[vpp-dev] Using custom openssl with vpp #vpp

2018-05-14 Thread ductm18
Hi,
I'm trying to customize the openssl plugin that needs to work with openssl 1.1 
(with some modification also).
Applying the new openssl version to the system is not possible since there are 
some other apps rely on openssl, and they do not work with openssl 1.1.
Is there any configuration I can make to use vpp with a relative build openssl? 
Or just some idea about how to achieve that.
Any help will be highly appreciated.

DucTM


[vpp-dev] Active open connection on multithread #vnet #vpp

2018-05-09 Thread ductm18
Hi,

I'm trying to use the proxy app (on vnet/session-apps).
The code works fine if I run vpp with 1 thread (just master). With more than 1 
thread, the code fails because of some assertions such as:

- Function transport_alloc_local_port - vnet/session/transport.c
237 /* Only support active opens from thread 0 */ 238 ASSERT 
(vlib_get_thread_index () == 0); - Function tcp_half_open_connection_new - 
vnet/tcp/tcp.c
144 tcp_connection_t *tc = 0; 145 ASSERT ( vlib_get_thread_index () == 0); 146 
pool_get (tm-> half_open_connections , tc);

- ...
Removing all those assertions make the code works. But I'm not sure this is a 
good way to solve it.

*Is there any particular reason for only supporting active open on master 
thread?*

Another things, on the proxy apps, I think those lines of code should be 
(function delete_proxy_session - vnet/session-apps/proxy.c):

72 if (ps-> vpp_active_open_handle != ~0) 73 active_open_session = 
session_get_from_handle 74 (ps-> vpp_active_open_handle ); 75 else 76 
active_open_session = 0;

instead of

72 if (ps-> vpp_server_handle != ~0) 73 active_open_session = 
session_get_from_handle 74 (ps-> vpp_server_handle ); 75 else 76 
active_open_session = 0;

Thanks,
DucTM


[vpp-dev] VPP VCL Lib error #vpp

2018-04-17 Thread ductm18
Hello,

I am trying to use the VCL lib to connect VPP and my server app.
My code worked perfectly fine with VPP 18.01. But when I upgrade to VPP 18.04 
(and 18.07 also), it hasn't worked anymore.
The code still works if i try with 1 client at a times. But with more than 1 
client at a moment, the server is just hanged up. Trying to debug into the 
code, I find out that the server stuck at the vppcom_session_accept function. A 
bit further, the event thread creates an infinitive loop (with fifo_depth = 2, 
ev->recycle=1 and recycle_count=1).
Is this a bug or does the new version require some specific ways to use the lib 
and I did something wrong?
Any help will be highly appreciated!