Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
8 years ago

OpenCL_Library : Exemple 1 :Segmentation fault (core dumped)

Hi,

I'm trying to excute the example OpenCL Library (Exemple 1) (Link Below). I generated my excutable file for My FPGA Arria 10. Then I get this message when I execute : Segmentation fault (core dumped).!

What does it mean ? How I can find the error knowing that I follwed all steps and it works well.

https://www.altera.com/support/support-resources/design-examples/design-software/opencl/library-design-example.html

Thank You.

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Segmentation faults usually occur when the executable tries to access a memory it does not have access to and may be difficult to debug (such as accessing data past a pointer's allocated space). The example should work out of the box if the binary is generated and in the expected location for the host to find. Otherwise using a debugger would be helpful to find out where the segfault is happening.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thank you ,

    The example 1 doesn't' work and the binary file is generated successfully. Note that I'm using a Nallatech Board with Arria 10 FPGA and SDK for Opencl under Linux OS. Which debugger you use ?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I normally use gdb which i found to be pretty helpful. If you run it on your host application, you'll need to ignore interrupts otherwise it will treat them as breakpoints for SIG44 and SIG64 (https://www.altera.com/en_us/pdfs/literature/hb/opencl-sdk/aocl_programming_guide.pdf#_opentopic_toc_processing_d116e18533) or just continue whenever you hit a break from the interrupt signal. Then you can use a backtrace (bt) when the debugger hits the seg fault and it can tell you what line it is occurring on.

    Also you'll need to add the -g flag to gcc to enable debug info to get more meaningful information from gdb.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi fand,

    Seems like this folder is not been update yet for some bug. I have modified the host file alittle, can you try to use this version of main.cpp ?

    Regards,

    CloseCL

    (This message was posted on behalf of Intel Corporation)