Project

General

Profile

PCI-e Device Driver - munmap related error

Added by Alexander Block over 9 years ago

Posting on behalf of a customer:

I'm having some sporadic problems with the device driver I made for our pci-e device.
It works great in general but it seems like every other run, I get a segfault when trying to
close() the device file and when I try to munmap() the pci-e device space from my user program
space. The segfault occurs exactly when one of those two functions is called.

I've already made absolutely sure that there are no accesses to the mapped area after
munmap. There are also no reads or writes happening when munmap and close are called.

Can you see if anyone has any insight as to what the problem is?


Replies (2)

RE: PCI-e Device Driver - munmap related error - Added by Michael Williamson over 9 years ago

Can you post your code? Are you getting user space faults and not kernel oops, right?

Are you unmapping with the same size as with your mmap() call?

-Mike

RE: PCI-e Device Driver - munmap related error - Added by Alexander Block over 9 years ago

Reporting that the customer solved their problem:

I've solved the problem.
Thread A which was signaling Thread B to terminate was doing a pthread_join after doing so.

I commented out the pthread_join and it worked perfectly fine after.

    (1-2/2)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)