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
> (0x10000000)
> 
> 
> 
> vppcom_cfg_heapsize:1965: VCL<18422>: allocated VCL heap = 0x7fffe25a7000,
> size 268435456 (0x10000000)
> 
> 
> 
> 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
> (0x10000000)
> 
> 
> 
> vppcom_cfg_heapsize:1965: VCL<18422>: allocated VCL heap = 0x7fffe27d1000,
> size 268435456 (0x10000000)
> 
> 
> 
> 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!

Reply via email to