cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
434 Views
Registered: ‎04-21-2020

Debbuging SEGMENTATION FAULT (Cannot read target memory. Input/output error)

Hi!

I started debbuging my video apliccation with SDx 2017.4 Application Debbuger using the TCF Agent to use the profiler but in some part of my code a Segmentation Fault is caused.

I detected the fault but I don't know how to solve it. It happens when passing parameters into a function. Before passing them I can see in the memory tab their values as attached: memoria_antes.JPG

 

Both of them have values. But then when I step into the function, the next segmentation fault jumps into the screen:

seg_fault.JPG

Then If I leave the mouse on top of the variables passed to the function  the next EXCEPTION is caused:

Captura de pantalla (37).png

 Can anybody help me with this?? This Segmentation fault does not happen on the realease mode on the board (ZyboZ720), it works without stopping till it reach the end of the video app.

Thanks!!

0 Kudos
16 Replies
Highlighted
Moderator
Moderator
427 Views
Registered: ‎09-12-2007

You will get a seg fault if the debugger tried to access an invalid reg/mem.

 

Where is this IP you are trying to access? is this in the PL? Have you the PL configured.

Is the IP in reset, or clocked incorrectly?

 

Can you access this directly in xsct? using a mrd command

0 Kudos
Highlighted
Observer
Observer
416 Views
Registered: ‎04-21-2020

Hi @stephenm for now everything is running on th PS because what I want to do is to see which of the functions consume more time at the CPU with the TCF profiler

I tried executing the mrd command but the SDx terminal gives back: -sh mrd command not found,

If it helps this is what disassembly tab looks like:

dissasembly.JPG

 

Thanks for the quick reply!

0 Kudos
Highlighted
Observer
Observer
326 Views
Registered: ‎04-21-2020

Hi @stephenm again,

At first I didn't understood what you meant with XSCT. But now I found it and i tried the mrd command, and this is what I get:

xcst console.JPG

 One of the addresses that causes the segmentation fault is the one displayed on the memory tab and is the one I'm trying to access with mrd command.

Please, help me. I hope this screenshot helps finding out what the problem is.

Thanks!

0 Kudos
Highlighted
Moderator
Moderator
291 Views
Registered: ‎09-12-2007

in XSCT you would target the arm procs (2 or 3 in your case). Then stop the proc (using the stop command), then mrd -force <addr>

 

What is at 0xbe41e6a4? is that at a 32 bit boundary?

0 Kudos
Highlighted
Moderator
Moderator
288 Views
Registered: ‎08-20-2018

Hi @laumont 

Is it 32 bit application?

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Highlighted
Observer
Observer
278 Views
Registered: ‎04-21-2020

Hi @nutang yes I think it's a 32-bit application. When releasing work perfetly the problem is debugging with the TCF Linux Agent

0 Kudos
Highlighted
Observer
Observer
276 Views
Registered: ‎04-21-2020

Hi @stephenm when stopping proc and doing mrd -force <addr> the same error occurs:
14:55:55 ERROR : (XSDB Server)Memory read error at 0xBE41E6A4. MMU section translation fault

At 0xbe41e6a4 is stored the values of a variable, it's a vector with 1 column and 256*256 rows.

0 Kudos
Highlighted
Observer
Observer
270 Views
Registered: ‎04-21-2020

I also tried "Running as" instead of "Debugging as" and through the user command promnt I started receiving the next message:

root@Zybo-Z7-20:~# mount /dev/mmcblk0p1 /mnt/
root@Zybo-Z7-20:~# ifconfig eth0 192.168.1.115
root@Zybo-Z7-20:~# cd /mnt
root@Zybo-Z7-20:/mnt# cdns-i2c e0004000.i2c: timeout waiting on completion
cdns-i2c e0004000.i2c: timeout waiting on completion
cdns-i2c e0004000.i2c: timeout waiting on completion
cdns-i2c e0004000.i2c: timeout waiting on completion
cdns-i2c e0004000.i2c: timeout waiting on completion
cdns-i2c e0004000.i2c: timeout waiting on completion
cdns-i2c e0004000.i2c: timeout waiting on completion
cdns-i2c e0004000.i2c: timeout waiting on completion
cdns-i2c e0004000.i2c: timeout waiting on completion
cdns-i2c e0004000.i2c: timeout waiting on completion
mmc0: Timeout waiting for hardware interrupt.
mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
mmc0: sdhci: Sys addr: 0x07f81200 | Version: 0x00008901
mmc0: sdhci: Blk size: 0x00007200 | Blk cnt: 0x00000001
mmc0: sdhci: Argument: 0x00000ff0 | Trn mode: 0x00000003
mmc0: sdhci: Present: 0x01ff0000 | Host ctl: 0x00000017
mmc0: sdhci: Power: 0x0000000f | Blk gap: 0x00000000
mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007
mmc0: sdhci: Timeout: 0x0000000e | Int stat: 0x00000003
mmc0: sdhci: Int enab: 0x02ff008b | Sig enab: 0x02ff008b
mmc0: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000001
mmc0: sdhci: Caps: 0x69ec0080 | Caps_1: 0x00000000
mmc0: sdhci: Cmd: 0x0000183a | Max curr: 0x00000001
mmc0: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x00000000
mmc0: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000
mmc0: sdhci: Host ctl2: 0x00000000
mmc0: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x30044210
mmc0: sdhci: ============================================
cdns-i2c e0004000.i2c: timeout waiting on completion
cdns-i2c e0004000.i2c: timeout waiting on completion
cdns-i2c e0004000.i2c: timeout waiting on completion
cdns-i2c e0004000.i2c: timeout waiting on completion
cdns-i2c e0004000.i2c: timeout waiting on completion
mmc0: Timeout waiting for hardware cmd interrupt.
mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
mmc0: sdhci: Sys addr: 0x07f81200 | Version: 0x00008901
mmc0: sdhci: Blk size: 0x00007200 | Blk cnt: 0x00000001
mmc0: sdhci: Argument: 0x00070000 | Trn mode: 0x00000003
mmc0: sdhci: Present: 0x01ff0000 | Host ctl: 0x00000017
mmc0: sdhci: Power: 0x0000000f | Blk gap: 0x00000000
mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007
mmc0: sdhci: Timeout: 0x0000000e | Int stat: 0x00000001
mmc0: sdhci: Int enab: 0x02ff008b | Sig enab: 0x02ff008b
mmc0: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000001
mmc0: sdhci: Caps: 0x69ec0080 | Caps_1: 0x00000000
mmc0: sdhci: Cmd: 0x00000d1a | Max curr: 0x00000001
mmc0: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x00000000
mmc0: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000
mmc0: sdhci: Host ctl2: 0x00000000
mmc0: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x30044210
mmc0: sdhci: ============================================
mmcblk0: error -110 sending status command, retrying
cdns-i2c e0004000.i2c: timeout waiting on completion
cdns-i2c e0004000.i2c: timeout waiting on completion
cdns-i2c e0004000.i2c: timeout waiting on completion
cdns-i2c e0004000.i2c: timeout waiting on completion
cdns-i2c e0004000.i2c: timeout waiting on completion
mmc0: Timeout waiting for hardware cmd interrupt.
mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
mmc0: sdhci: Sys addr: 0x07f81200 | Version: 0x00008901
mmc0: sdhci: Blk size: 0x00007200 | Blk cnt: 0x00000001
mmc0: sdhci: Argument: 0x00070000 | Trn mode: 0x00000003
mmc0: sdhci: Present: 0x01ff0000 | Host ctl: 0x00000017
mmc0: sdhci: Power: 0x0000000f | Blk gap: 0x00000000
mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007
mmc0: sdhci: Timeout: 0x0000000e | Int stat: 0x00000001
mmc0: sdhci: Int enab: 0x02ff008b | Sig enab: 0x02ff008b
mmc0: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000001
mmc0: sdhci: Caps: 0x69ec0080 | Caps_1: 0x00000000
mmc0: sdhci: Cmd: 0x00000d1a | Max curr: 0x00000001
mmc0: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x00000000
mmc0: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000
mmc0: sdhci: Host ctl2: 0x00000000
mmc0: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x30044210
mmc0: sdhci: ============================================
mmcblk0: error -110 sending status command, retrying
mmc0: Timeout waiting for hardware cmd interrupt.
mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
mmc0: sdhci: Sys addr: 0x07f81200 | Version: 0x00008901
mmc0: sdhci: Blk size: 0x00007200 | Blk cnt: 0x00000001
mmc0: sdhci: Argument: 0x00070000 | Trn mode: 0x00000003
mmc0: sdhci: Present: 0x01ff0000 | Host ctl: 0x00000017
mmc0: sdhci: Power: 0x0000000f | Blk gap: 0x00000000
mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000007
mmc0: sdhci: Timeout: 0x0000000e | Int stat: 0x00000001
mmc0: sdhci: Int enab: 0x02ff008b | Sig enab: 0x02ff008b
mmc0: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000001
mmc0: sdhci: Caps: 0x69ec0080 | Caps_1: 0x00000000
mmc0: sdhci: Cmd: 0x00000d1a | Max curr: 0x00000001
mmc0: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x00000000
mmc0: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000
mmc0: sdhci: Host ctl2: 0x00000000
mmc0: sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x30044210
mmc0: sdhci: ============================================
mmcblk0: error -110 sending status command, aborting
cdns-i2c e0004000.i2c: timeout waiting on completion
0 Kudos
Highlighted
Observer
Observer
225 Views
Registered: ‎04-21-2020

I'm using the xfOpenCV libs included in the reVISION platform and the aarch32/openCV libs and include.
0 Kudos
Highlighted
Moderator
Moderator
182 Views
Registered: ‎08-20-2018

Hi @laumont 

If yours is 32 bit application, then the issue is because of using 64-bit tcf-agent to debug 32-bit elf file. It is needed to launch 32-bit tcf-agent on the board to avoid this error.

Download the attached tcf-agent (32bit)and copy it into the target filesystem.
Then launch this tcf-agent as mentioned below.
              tcf-agent -s tcp::1535
 
On the SDK/Vitis side, in the debug configuration, use the debug port from the previous step.
Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
Highlighted
Observer
Observer
171 Views
Registered: ‎04-21-2020

Hi @nutang 

I tried following your steps. I downloaded and extracted the tcf-agent from the zip and copied it into the filesystem on the ext4 particioned of the sd. More precisely into the "/usr/sbin/" folder. This were the steps followd from the SDx terminal, and also the TCF Agent in the SDx IDE can't find a Linux Agent running on the specified IP (as shown in the image attached). What did I do wrong?

root@Zybo-Z7-20:~# mount /dev/mmcblk0p1 /mnt/
root@Zybo-Z7-20:~# tcf-agent -s tcp::1535
-sh: /usr/sbin/tcf-agent: Permission denied
root@Zybo-Z7-20:~# sudo tcf-agent -s tcp::1535
-sh: sudo: command not found
root@Zybo-Z7-20:~# ifconfig eth0 192.168.1.115
root@Zybo-Z7-20:~# ping 192.168.1.114 -c 1
PING 192.168.1.114 (192.168.1.114): 56 data bytes
64 bytes from 192.168.1.114: seq=0 ttl=128 time=1.621 ms

--- 192.168.1.114 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 1.621/1.621/1.621 ms
root@Zybo-Z7-20:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:18:3E:03:41:72
inet addr:192.168.1.115 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::218:3eff:fe03:4172%lo/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:196 errors:0 dropped:0 overruns:0 frame:0
TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:15571 (15.2 KiB) TX bytes:5768 (5.6 KiB)
Interrupt:29 Base address:0xb000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1%1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

root@Zybo-Z7-20:~# tcf-agent -s tcp::1535
-sh: /usr/sbin/tcf-agent: Permission denied
root@Zybo-Z7-20:~#

Captura de pantalla (38).png

 

Thanks so much for your help!

Tags (1)
0 Kudos
Highlighted
Moderator
Moderator
164 Views
Registered: ‎08-20-2018

Hi @laumont

So, you have copied the tcf-agent in SD card and you have mounted it.

Please change the directory to /mnt and try to launch with 

$ ./tcf_agent -s tcp::1535

 

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Highlighted
Observer
Observer
157 Views
Registered: ‎04-21-2020

Hi @nutang I did that and it does nothing, it stays on standby and does not return anything, and it doesn't let me introduce any other command on the sdx terminal:

root@Zybo-Z7-20:~# mount /dev/mmcblk0p1 /mnt/
root@Zybo-Z7-20:~# cd /mnt
root@Zybo-Z7-20:/mnt# ls
BOOT.BIN README.txt _sds pca_1.elf
IMG_4653.MOV System Volume Information image.ub tcf-agent
root@Zybo-Z7-20:/mnt# ./tcf-agent -s tcp::1535

0 Kudos
Highlighted
Observer
Observer
147 Views
Registered: ‎04-21-2020

And if I try setting the port of the TCF-Agent on the IDE the next error happens (cannot create listening port);
root@Zybo-Z7-20:~# cd /mnt
root@Zybo-Z7-20:/mnt# ls
BOOT.BIN README.txt _sds pca_1.elf
IMG_4653.MOV System Volume Information image.ub tcf-agent
root@Zybo-Z7-20:/mnt# ./tcf-agent -s tcp::1534
Cannot create listening port: Socket bind error. Address already in use
root@Zybo-Z7-20:/mnt# ./tcf-agent -s tcp::1535
0 Kudos
Highlighted
Moderator
Moderator
142 Views
Registered: ‎08-20-2018

Hi @laumont 

Yes, 1534 will have 64 bit tcf agent

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Highlighted
Observer
Observer
138 Views
Registered: ‎04-21-2020

Hi @nutang 

But why it stays in standby? It doesn't return nothing through the command promnt when I run: ./tcf-agent -s tcp::1535
What should I do next?

How can I really start debugging if I can't run the .elf through the command promnt? If i try debbuging with the IDE it would use the 64bit?

Because I tried this second step and the segmentation fault still happens.

Thanks!

0 Kudos