xadahiya / pam-face-authentication

Automatically exported from code.google.com/p/pam-face-authentication
0 stars 0 forks source link

segmentation fault #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What is the expected output? What do you see instead?
The gtk-facemanager gui, but i get a segmentation fault instead.

What version of the product are you using? On what operating system?
0.2 on ubuntu 8.10

Please provide any additional information below.

I get 
select timeout
select timeout
segementation fault
when I try to launch the gtk-facemanager.

I tried to fix it myself and found out that the program starts when I
change (in gtk-facemanager.c):

    cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH,IMAGE_WIDTH);
    cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT,IMAGE_HEIGHT);
in
    cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH,640);
    cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT,480);
or when I change IMAGE_HEIGHT and IMAGE_WIDTH in pam_face_defines.h.
But I have no idea about programming in c++ or in linux and the rest of the
program doesn't work correctly because the image is too big. I hope you can
somehow fix that bug.

Original issue reported on code.google.com by shirondr...@gmail.com on 29 Mar 2009 at 6:34

GoogleCodeExporter commented 8 years ago
a urgent patch is needed to get the image to 320 X 240
thanks for reporting the bug 

Original comment by rohan.a...@gmail.com on 29 Mar 2009 at 7:22

GoogleCodeExporter commented 8 years ago
I managed to fix it by resizing the pic after capture and deleting the 2 lines I
mentioned above. I don't think this is the best or the most efficient way but it
works, so I share the new files perhaps it is useful for someone. 
I have also replaced cvGrabFrame and cvRetrieveFrame with cvQueryFrame because 
there
was an error while compiling with the newest svn version of opencv about not 
enough
arguments for cvRetrieveFrame, with cvQueryFrame it works in the old opencv 
version
and in the new one.

Original comment by shirondr...@gmail.com on 29 Mar 2009 at 8:41

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the patch, i will add your patch in the morning

You could look at the latest development version from the svn
Recognition algorithm / interface etc has gone through some major revisions

Original comment by rohan.a...@gmail.com on 29 Mar 2009 at 11:50

GoogleCodeExporter commented 8 years ago
I tried the svn version, I had to change the makefile.am to get it compiled:

pam_face_authenticate_so_LDFLAGS = -shared

to

pam_face_authenticate_so_LDFLAGS = -Xcompiler -shared

found that tip somewhere on the internet that -Xcompiler is needed with libtool 
2.2
and it should be compatible with older versions.
Then I had to change the same things I did with the 0.2 version.
But I still cannot get the svn version to work, I get segmentation fault again, 
but
this time while authenticating, I think this happens when my face is 
recognized, I
haven't found why, I will post again when I know more. At least I learn some c++
while trying to fix this ^^
Here is the console output:
94 136 172 135
88 136 171 134
88 134 171 132
86 134 142 188
86 134 169 131
86 134 171 132
88 134 170 132
Segmentation fault

Original comment by shirondr...@gmail.com on 31 Mar 2009 at 2:16

GoogleCodeExporter commented 8 years ago
Found it, in pam_face_authentication.c:

                       if (authenticateThreadReturn==1)
                        {
                            //removeFile(username);
                //printf("Authenticated");
                            AuthenticateButtonClicked=0;
                            *commAuth=EXIT_GUI;
                            cvZero(frame_copy);
                            writeImageToMemory(frame_copy,shared); //segmentation fault
                            cvReleaseImage( &frameNew );
                            cvReleaseImage( &frame_copy );
                cvReleaseImage( &frame );
                            cvReleaseCapture( &capture );
                            return 'y';
                        }

Could you please explain what

cvZero(frame_copy);
writeImageToMemory(frame_copy,shared);

does? I mean the memory of the image is replaced with zeroes and then written in
shared memory place, I don' understand why this is necessary.

Original comment by shirondr...@gmail.com on 31 Mar 2009 at 4:16

GoogleCodeExporter commented 8 years ago
hey thanks for reporting another bug
After you login, its clearing up the memory to black
so that next time you login , it doesnt load the last frame from the memory

cvZero(frame_copy);
writeImageToMemory(frame_copy,shared);

writeImageToMemory should work , but i am not able to figure out why its 
segfaulting

Thanks again, i hope we can resolve this soon, right now removing those two 
lines
wont hurt ,
maybe instead of using framecopy , another function which puts memory elements 
to
zero should work 

when you were authenticating , you were able to see the video on the 
gtk-facetracker
which pop's up right ?

Also, it would be awesome , if you could create a demo , video , of how you 
trained
it etc, from a user perspective :)

Original comment by rohan.a...@gmail.com on 31 Mar 2009 at 9:24

GoogleCodeExporter commented 8 years ago

could you also mention which distribution you are using ?

it doesnt seem to work on all distributions , so need to test for all major ones

Original comment by rohan.a...@gmail.com on 31 Mar 2009 at 10:44

GoogleCodeExporter commented 8 years ago
sorry didnt read that , above description
ok so it pretty much works on Ubuntu except for the last segfault ?

Original comment by rohan.a...@gmail.com on 1 Apr 2009 at 12:37

GoogleCodeExporter commented 8 years ago
I updated to the newest svn, and now erything seems to work, with the exception 
of
logging in with gdm, it seems the x server restarts everytime my face is 
recognized,
the window pops up I press authenticate and I get a black screen with some text 
I
cannot read because it's gone to fast, and I am again at the login-screen.
And yes the video on the gtk-facetracker works.

It's not a bug but you can delete cvGrabFrame when using cvQueryFrame in
gtk-facemanagerU.c:

    if ( !cvGrabFrame( capture )) //not necessary
        return FALSE; //not necessary
    orginalFrame = cvQueryFrame( capture );

Original comment by shirondr...@gmail.com on 1 Apr 2009 at 12:05

GoogleCodeExporter commented 8 years ago
what is written in /etc/pam.d/gdm ?
does it work with su ? , you can edit it at /etc/pam.d/su

this is how the it should look like (gdm) ( the first line )
auth     sufficient     pam_face_authenticate.so
auth     include        common-auth
...

Original comment by rohan.a...@gmail.com on 1 Apr 2009 at 2:00

GoogleCodeExporter commented 8 years ago
to test with gdm
you can type in gdmflexiserver -n on the terminal

Original comment by rohan.a...@gmail.com on 1 Apr 2009 at 2:02

GoogleCodeExporter commented 8 years ago
It works with sudo and su. And I have not changed the /etc/pam.d/gdm instead I 
have
change the common-auth so that I did not have to edit every file in etc/pam.d/.

common-auth:
auth sufficient pam_face_authenticate.so
auth    [success=1 default=ignore]  pam_unix.so nullok_secure
auth    requisite           pam_deny.so
auth    required            pam_permit.so
gdm:
auth    requisite       pam_nologin.so
auth    required        pam_env.so readenv=1
auth    required        pam_env.so readenv=1 envfile=/etc/default/locale
@include common-auth
auth    optional        pam_gnome_keyring.so
@include common-account
session required        pam_limits.so
@include common-session
session optional        pam_gnome_keyring.so auto_start
@include common-password

Original comment by shirondr...@gmail.com on 1 Apr 2009 at 2:36

GoogleCodeExporter commented 8 years ago
i think its better to keep write it separately in different files
since face authentication wont work with all that uses common-auth

could you separately try it for gdm ? , use "gdmflexiserver -n" to test
i hope we can resolve this soon

Original comment by rohan.a...@gmail.com on 1 Apr 2009 at 5:56

GoogleCodeExporter commented 8 years ago
with gdmflexiserver -n, the windows with gdm closes after I press Authenticate 
and
the software recognizes my face.

Original comment by shirondr...@gmail.com on 6 Apr 2009 at 3:35

GoogleCodeExporter commented 8 years ago
could you update to the latest .3 version
train 
and use gdb to print the backtrace ?

Original comment by rohan.a...@gmail.com on 6 Apr 2009 at 6:19

GoogleCodeExporter commented 8 years ago
Could you explain how I do that? I have never used gdb and didn't find 
something on
the internet that fits for this situation.

Original comment by shirondr...@gmail.com on 13 Apr 2009 at 10:33

GoogleCodeExporter commented 8 years ago
just tried the latest 0.3 file

I to get a seg fault but it is while it is authenticating.

Original comment by stevenj...@gmail.com on 16 Jul 2009 at 8:40

GoogleCodeExporter commented 8 years ago
OpenCV should be built without OpenMP

Original comment by rohan.a...@gmail.com on 8 Jul 2010 at 10:52