Hi,
I get strange segfault error when working with hierarchy of c programs (3 stages)
I can give a link to the sources, but first i will describe the issue:
i am working with pcie cards on ubuntu 18.04 and trying to access the, (read/write)
main ---> API ---> Driver
in Driver.c i have a function which open the pci bar resource file
in main.c i munmap the bar
I got segmentation error right after return 0 in main.c
basically I can't assign a local variable in main.c
even if i write:
it gives the error
This is what is get in the end of valgrind command:
''
==17660== Jump to the invalid address stated on the next line
==17660== at 0x81A003CD: ???
==17660== Address 0x81a003cd is not stack'd, malloc'd or (recently) free'd
==17660==
==17660==
==17660== Process terminating with default action of signal 11 (SIGSEGV)
==17660== Access not within mapped region at address 0x81A003CD
==17660== at 0x81A003CD: ???
==17660== If you believe this happened as a result of a stack
==17660== overflow in your program's main thread (unlikely but
==17660== possible), you can try to increase the size of the
==17660== main thread stack using the --main-stacksize= flag.
==17660== The main thread stack size used in this run was 8388608.
==17660==
==17660== HEAP SUMMARY:
==17660== in use at exit: 0 bytes in 0 blocks
==17660== total heap usage: 1 allocs, 1 frees, 1,024 bytes allocated
==17660==
==17660== All heap blocks were freed -- no leaks are possible
==17660==
==17660== For counts of detected and suppressed errors, rerun with: -v
==17660== ERROR SUMMARY: 11 errors from 5 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)
''
any suggestions?