amishmm / php-pam

This extension provides PAM (Pluggable Authentication Modules) integration for PHP
Other
10 stars 5 forks source link

Segmentation Fault #2

Closed HumorlessJester closed 5 years ago

HumorlessJester commented 5 years ago

First, let me start with thank you for picking up this dead project.

I was able to download the package and install it, but when I include the created pam.so file in my INI I then get a Segmentation Fault when running PHP. Per gdb the fault is in the zen_collect_module_handlers:

0x00000000008074e1 in zend_collect_module_handlers () at /usr/local/src/php-7.2.1/Zend/zend_API.c:1973 1973 ZEND_HASH_FOREACH_PTR(CG(class_table), ce) {

I am only running 2 extensions currently, pam.so and pthreads.so. Pthreads was working previously, and when I remove pam.so the Segmentation Fault disappears.

I'm willing to assist in troubleshooting, but I don't know where to go from here.

php --version PHP 7.2.1 (cli) (built: Nov 7 2018 19:27:12) ( ZTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies

amishmm commented 5 years ago

I have no idea about ZEND internals but lets try it out.

What happens if you dont use pthreads.so? Does pam.so still crash php? Have you tried with php 7.3?

Can you also try with previous release 2.1.0 instead of 2.1.1? https://github.com/amishmm/php-pam/releases/tag/v2.1.0

Sample code which you can try to run: (change username and password, change login to pam service name if necessary)

<?php
if (extension_loaded('pam')) {
    if (!pam_auth("username", 'password', $error, true, 'login')) {
        echo "fail: $error\n";
    }
    else {
        echo "pass: $error\n";
    }
}
else {
    echo "pam.so not loaded\n";
}
amishmm commented 5 years ago

Any update? Else I will close the issue after waiting 2 more weeks.

amishmm commented 5 years ago

Closing due to no response.