UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor tuxnoel
Visitor
296 Views
Registered: ‎05-31-2018

Segmentation fault with simple network application having SIGALRM handler on Microblaze

I am working on KC705 evaluation board with Microblaze Linux built using BSP (from XIlinx) downloaded for Petalinux-2018.1.

I am facing a peculiar problem with a simple network C application sending out data read from a file as UDP packets using sendto() C system call. This application also has a timer running set using setitimer() call incrementing a global variable every 16 millisec. The application works fine without the periodic timer calling SIGALRM handler. However when the timer is active and SIGALRM delivered, the application crashes giving Segmentation fault. The last print seen before SIGSEGV comes is inside the SIGALRM handler.

The same code runs fine in other processors like Intel 32/64 and ARM 32/64 bit archs.

Tried using GDB via gdbserver but gives no hint for crash.

Same issue is seen in BSP project built for Petalinux-2018.3 and HDF based project built for Petalinux-2018.1.

Attaching the faulty C code and kernel configuration files.

Kindly help as this seems to be a Microblaze/Petalinux specific issue.

Note: To run the C app and dummy file named 'es.h264' (approx size 25MB) needs to kept with the Microblazeel executable.

Regards,

Noel AV

 

0 Kudos
1 Reply
Highlighted
Visitor tuxnoel
Visitor
215 Views
Registered: ‎05-31-2018

Re: Segmentation fault with simple network application having SIGALRM handler on Microblaze

It seems any application with main() body having either of printf(), memset(), fread() or recvfrom() and SIGALRM called periodically (even 1second) is getting crashed. sendto() is not the reason. Looks like some stack corruption happens on return from signal handler when it's called periodically. It is surprising this issue has been pointed out 7 years back here:

https://forums.xilinx.com/t5/Embedded-Linux/Linux-timer-crash-on-Petalinux-SDK/td-p/205405

and still not been fixed.

0 Kudos