NotionCommotion
Members-
Posts
2,446 -
Joined
-
Last visited
-
Days Won
10
Everything posted by NotionCommotion
-
Still don't have a dump in /tmp, but what is odd is the folder dates sometimes change with no rhyme or reason but they are always empty. Maybe the sub-directories need to be writable. Tried running php as sudo as well as making the directory 0777 but nothing. With gdb, however, now I am getting some visibility even though I expect I am not using it right. Maybe __GI__IO_file_underflow () from /lib64/libc.so.6? Don't know where to go from here... $ gdb php72 GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-119.el7 Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /opt/remi/php72/root/usr/bin/php...Reading symbols from /usr/lib/debug/opt/remi/php72/root/usr/bin/php.debug...done. done. (gdb) run Starting program: /usr/bin/php72 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". ^C Program received signal SIGINT, Interrupt. 0x00007ffff4c249a0 in __read_nocancel () from /lib64/libc.so.6 Missing separate debuginfos, use: debuginfo-install audit-libs-2.8.5-4.el7.x86_64 bzip2-libs-1.0.6-13.el7.x86_64 cyrus-sasl-lib-2.1.26-23.el7.x86_64 expat-2.1.0-11.el7.x86_64 fontconfig-2.13.0-4.3.el7.x86_64 freetype-2.8-14.el7.x86_64 fribidi-1.0.2-1.el7_7.1.x86_64 gd-last-2.3.0-1.el7.remi.x86_64 glib2-2.56.1-5.el7.x86_64 glibc-2.17-307.el7.1.x86_64 graphite2-1.3.10-1.el7_3.x86_64 harfbuzz-1.7.5-2.el7.x86_64 jbigkit-libs-2.0-11.el7.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.15.1-46.el7.x86_64 libX11-1.6.7-2.el7.x86_64 libXau-1.0.8-2.1.el7.x86_64 libXpm-3.5.12-1.el7.x86_64 libc-client-2007f-16.el7.x86_64 libcap-ng-0.7.5-4.el7.x86_64 libcom_err-1.42.9-17.el7.x86_64 libcurl-7.29.0-57.el7.x86_64 libgcrypt-1.5.3-14.el7.x86_64 libgpg-error-1.12-3.el7.x86_64 libidn-1.28-4.el7.x86_64 libjpeg-turbo-1.2.90-8.el7.x86_64 libmcrypt-2.5.8-13.el7.x86_64 libpng-1.5.13-7.el7_2.x86_64 libraqm-0.7.0-4.el7.x86_64 libselinux-2.5-15.el7.x86_64 libssh2-1.8.0-3.el7.x86_64 libtiff-4.0.3-32.el7.x86_64 libuuid-2.23.2-63.el7.x86_64 libwebp7-1.0.3-1.el7.remi.x86_64 libxcb-1.13-1.el7.x86_64 libxml2-2.9.1-6.el7.4.x86_64 libxslt-1.1.28-5.el7.x86_64 libzip5-1.6.1-1.el7.remi.x86_64 nspr-4.21.0-1.el7.x86_64 nss-3.44.0-7.el7_7.x86_64 nss-softokn-freebl-3.44.0-8.el7_7.x86_64 nss-util-3.44.0-4.el7_7.x86_64 oniguruma5-6.9.4-1.el7.remi.x86_64 openldap-2.4.44-21.el7_6.x86_64 pam-1.1.8-23.el7.x86_64 pcre-8.32-17.el7.x86_64 php72-php-pecl-mcrypt-1.0.3-1.el7.remi.x86_64 php72-php-pecl-zip-1.18.2-1.el7.remi.x86_64 sqlite-3.7.17-8.el7_7.1.x86_64 xz-libs-5.2.2-1.el7.x86_64 (gdb) bt #0 0x00007ffff4c249a0 in __read_nocancel () from /lib64/libc.so.6 #1 0x00007ffff4bb0cc4 in __GI__IO_file_underflow () from /lib64/libc.so.6 #2 0x00007ffff4baf778 in __GI__IO_file_xsgetn () from /lib64/libc.so.6 #3 0x00007ffff4ba415f in fread () from /lib64/libc.so.6 #4 0x0000555555851f1d in zend_stream_getc (file_handle=0x7fffffffd120, file_handle=0x7fffffffd120) at /usr/src/debug/php-7.2.30/Zend/zend_stream.c:147 #5 zend_stream_read (file_handle=0x7fffffffd120, buf=0x7ffff3880000 "", len=4096) at /usr/src/debug/php-7.2.30/Zend/zend_stream.c:159 #6 0x00005555558521ef in zend_stream_fixup (file_handle=file_handle@entry=0x7fffffffd120, buf=buf@entry=0x7fffffffa868, len=len@entry=0x7fffffffa870) at /usr/src/debug/php-7.2.30/Zend/zend_stream.c:252 #7 0x00005555557f7146 in open_file_for_scanning (file_handle=file_handle@entry=0x7fffffffd120) at Zend/zend_language_scanner.l:514 #8 0x00005555557f74a7 in compile_file (file_handle=0x7fffffffd120, type=8) at Zend/zend_language_scanner.l:628 #9 0x00007fffe51c5b7d in phar_compile_file (file_handle=<optimized out>, type=<optimized out>) at /usr/src/debug/php-7.2.30/ext/phar/phar.c:3333 #10 0x00007ffff7e64fce in ?? () from /opt/remi/php72/root/usr/lib64/php/modules/dbg-php-7.2.so #11 0x0000555555833e6c in zend_execute_scripts (type=type@entry=8, retval=retval@entry=0x0, file_count=file_count@entry=3) at /usr/src/debug/php-7.2.30/Zend/zend.c:1492 #12 0x00005555557ce578 in php_execute_script (primary_file=primary_file@entry=0x7fffffffd120) at /usr/src/debug/php-7.2.30/main/main.c:2599 #13 0x00005555558e8adf in do_cli (argc=1, argv=0x555555c76c50) at /usr/src/debug/php-7.2.30/sapi/cli/php_cli.c:1011 #14 0x000055555563ddcb in main (argc=1, argv=0x555555c76c50) at /usr/src/debug/php-7.2.30/sapi/cli/php_cli.c:1403 (gdb) quit A debugging session is active. Inferior 1 [process 64503] will be killed. Quit anyway? (y or n) y $
-
Starting from scratch... $ echo '/tmp/coredump-%e.%p' | sudo tee /proc/sys/kernel/core_pattern # Yep, it is there $ cat /proc/sys/kernel/core_pattern /tmp/coredump-%e.%p # /tmp is writable $ ls -lat / total 40 dr-xr-xr-x 13 root root 0 May 9 13:02 sys drwxrwxrwt. 11 root root 4096 May 9 12:58 tmp drwxr-xr-x 33 root root 920 May 8 11:26 run ... And I created a segfault php -r 'posix_kill(posix_getpid(), SIGSEGV);' But nothing new is in /tmp. $ ls -lat /tmp total 12 drwxrwxrwt. 11 root root 4096 May 9 12:58 . srwxrwxrwx 1 postgres postgres 0 May 9 12:30 .s.PGSQL.5432 -rw------- 1 postgres postgres 49 May 9 12:30 .s.PGSQL.5432.lock drwx------ 3 root root 16 May 8 11:27 systemd-private-809bd1f0c8db495c945df5ac824728c0-php72-php-fpm.service-XXgFV3 drwx------ 3 root root 16 May 8 11:26 systemd-private-809bd1f0c8db495c945df5ac824728c0-php-fpm.service-HuwtDT drwx------ 3 root root 16 May 8 11:26 systemd-private-809bd1f0c8db495c945df5ac824728c0-httpd.service-IizJQ2 drwx------ 3 root root 16 Apr 9 18:29 systemd-private-809bd1f0c8db495c945df5ac824728c0-ntpd.service-iTmi5U dr-xr-xr-x. 17 root root 4096 May 26 2018 .. drwxrwxrwt. 2 root root 6 Apr 8 2016 .font-unix drwxrwxrwt. 2 root root 6 Apr 8 2016 .Test-unix drwxrwxrwt. 2 root root 6 Apr 8 2016 .X11-unix drwxrwxrwt. 2 root root 6 Apr 8 2016 .ICE-unix drwxrwxrwt. 2 root root 6 Apr 8 2016 .XIM-unix $ Note that https://bugs.php.net/bugs-generating-backtrace.php states the following, however, requinix early stated it wasn't required. Just making sure... When running $ gdb `where php-fpm`, I get "-bash: where: command not found". Did you mean whereis? Probably for this case shouldn't even be worrying about php-fpm, and just php, right? A clue! Missing debuginfo. $ gdb php -r 'posix_kill(posix_getpid(), SIGSEGV);' ... Reading symbols from /usr/bin/php...Reading symbols from /usr/bin/php...expanding to full symbols...(no debugging symbols found)...done. expanding to full symbols...(no debugging symbols found)...done. /var/www/greenbean_ws/posix_kill(posix_getpid(), SIGSEGV);: No such file or directory. Missing separate debuginfos, use: debuginfo-install php-cli-7.4.5-1.el7.remi.x86_64 (gdb) So I installed it and tried again... debuginfo-install php-cli-7.4.5-1.el7.remi.x86_64 php -r 'posix_kill(posix_getpid(), SIGSEGV);' # Have two new folders $ ls -lt /tmp total 0 drwx------ 3 root root 16 May 9 13:37 systemd-private-809bd1f0c8db495c945df5ac824728c0-httpd.service-Xy4O5a drwx------ 2 root root 6 May 9 13:37 vmware-root_40848-1770131046 drwx------ 3 root root 16 May 9 13:18 systemd-private-809bd1f0c8db495c945df5ac824728c0-php72-php-fpm.service-ANw4wj drwx------ 3 root root 16 May 9 13:18 systemd-private-809bd1f0c8db495c945df5ac824728c0-php-fpm.service-OYXAU4 drwx------ 3 root root 16 Apr 9 18:29 systemd-private-809bd1f0c8db495c945df5ac824728c0-ntpd.service-iTmi5U But they are empty $ sudo ls -l /tmp/systemd-private-809bd1f0c8db495c945df5ac824728c0-httpd.service-Xy4O5a total 0 drwxrwxrwt 2 root root 6 May 9 13:37 tmp $ sudo ls -l /tmp/systemd-private-809bd1f0c8db495c945df5ac824728c0-httpd.service-Xy4O5a/tmp total 0 $ sudo ls -l /tmp/vmware-root_40848-1770131046 total 0 $ Maybe should be using dbg? If so recommendations how? Thanks
-
Ugg.. Got a little further, but another segfault. Had unrelated segfaults a while back and investigated backtraces, but never got them working and gave up. Guess I will be revisiting and figuring out once and for all how to investigate segfaults. kernel: php72[65109]: segfault at 7ff0c9e9ef00 ip 000055d9e88616f4 sp 00007ffee72c70a0 error 4 in php[55d9e8542000+473000] mysqld[61840]: 2020-05-09 12:09:36 19578 [Warning] Aborted connection 19578 to db: 'concrete5_ws' user: 'concrete5' host: 'localhost' (Got an error reading communication packets)
-
Ran the following but got a segfault as it doesn't seem to support php7.4. ./vendor/bin/concrete5 c5:install -i So I changed ./vendor/bin/concrete5 from: #!/usr/bin/env php <?php ... to #!/usr/bin/env php72 <?php ... I am sure I will forget I did this and would rather configure either the directory or the user to use php72. Is this possible? Also, should I be making any other changes? For instance, maybe: "config": {"platform": {"php": "7.2.30"}} Thanks
-
Getting the results I was looking for as shown below. While I was certain there would no issues with Doctrine, I've also tested that as being successful. I do feel it is a clean solution, however, will post future negative implications should they arise. greenbeand=# SELECT * FROM chart_series WHERE chart_id=638; id | chart_id | name | position | type -----+----------+---------+----------+------- 310 | 638 | Series1 | 1 | point 345 | 638 | fasdd | 2 | point (2 rows) # OUTSIDE OF TRANSACTION greenbeand=# UPDATE public.chart_series SET position = 1 WHERE id = 310; ERROR: duplicate key value violates unique constraint "unique_position_serie" DETAIL: Key (chart_id, "position")=(638, 1) already exists. # COMMITTING BEFORE COMPLETE greenbeand=# START TRANSACTION; START TRANSACTION greenbeand=# UPDATE public.chart_series SET position = 2 WHERE id = 310; UPDATE 1 greenbeand=# COMMIT TRANSACTION; ERROR: duplicate key value violates unique constraint "unique_position_serie" DETAIL: Key (chart_id, "position")=(638, 2) already exists. # SUCCESS greenbeand=# START TRANSACTION; START TRANSACTION greenbeand=# UPDATE public.chart_series SET position = 2 WHERE id = 310; UPDATE 1 greenbeand=# UPDATE public.chart_series SET position = 1 WHERE id = 345; UPDATE 1 greenbeand=# COMMIT TRANSACTION; COMMIT greenbeand=# SELECT * FROM chart_series WHERE chart_id=638; id | chart_id | name | position | type -----+----------+---------+----------+------- 310 | 638 | Series1 | 2 | point 345 | 638 | fasdd | 1 | point (2 rows) greenbeand=# While I very much appreciate the help getting me to where I am, was still trying to understand the difference between unique indexes and unique constraints regardless of whether they are deferred. The first output below uses a unique index and the second uses a deferred unique constraint. The relevant two lines are: UNIQUE, btree (chart_id, "position") UNIQUE CONSTRAINT, btree (chart_id, "position") DEFERRABLE INITIALLY DEFERRED Is there an index on the second or just a unique constraint? greenbeand=# \d+ chart_series Table "public.chart_series" Column | Type | Collation | Nullable | Default | Storage | Stats target | Description ----------+-----------------------+-----------+----------+------------------------------------------+----------+--------------+------------- id | integer | | not null | nextval('chart_series_id_seq'::regclass) | plain | | chart_id | integer | | not null | | plain | | name | character varying(45) | | not null | | extended | | position | integer | | not null | | plain | | type | character varying(32) | | not null | | extended | | Indexes: "chart_series_pkey" PRIMARY KEY, btree (id) "unique_name_serie" UNIQUE, btree (chart_id, name) "unique_position_serie" UNIQUE, btree (chart_id, "position") "idx_582b2d4dbef83e0a" btree (chart_id) Foreign-key constraints: "fk_582b2d4dbef83e0a" FOREIGN KEY (chart_id) REFERENCES chart(id) ON DELETE CASCADE Referenced by: TABLE "time_chart_series" CONSTRAINT "fk_81234495bf396750" FOREIGN KEY (id) REFERENCES chart_series(id) ON DELETE CASCADE TABLE "point_chart_series" CONSTRAINT "fk_aea4d429bf396750" FOREIGN KEY (id) REFERENCES chart_series(id) ON DELETE CASCADE Access method: heap greenbeand=# \d+ chart_series; Table "public.chart_series" Column | Type | Collation | Nullable | Default | Storage | Stats target | Description ----------+-----------------------+-----------+----------+------------------------------------------+----------+--------------+------------- id | integer | | not null | nextval('chart_series_id_seq'::regclass) | plain | | chart_id | integer | | not null | | plain | | name | character varying(45) | | not null | | extended | | position | integer | | not null | | plain | | type | character varying(32) | | not null | | extended | | Indexes: "chart_series_pkey" PRIMARY KEY, btree (id) "unique_name_serie" UNIQUE, btree (chart_id, name) "unique_position_serie" UNIQUE CONSTRAINT, btree (chart_id, "position") DEFERRABLE INITIALLY DEFERRED "idx_582b2d4dbef83e0a" btree (chart_id) Foreign-key constraints: "fk_582b2d4dbef83e0a" FOREIGN KEY (chart_id) REFERENCES chart(id) ON DELETE CASCADE Referenced by: TABLE "time_chart_series" CONSTRAINT "fk_81234495bf396750" FOREIGN KEY (id) REFERENCES chart_series(id) ON DELETE CASCADE TABLE "point_chart_series" CONSTRAINT "fk_aea4d429bf396750" FOREIGN KEY (id) REFERENCES chart_series(id) ON DELETE CASCADE Access method: heap
-
Thanks kicken, Like the bug report. Now it is obvious. Maybe I should just ditch the unique constraints but that is a slippery slope. Guess the multiple flush solution is easy enough. Still like the idea of constraints which are only based on the final state of the entity and will investigate and post my findings.
-
Good. At least I wasn't totally off on what they are. And you wouldn't because you shouldn't need to as Doctrine should know? Yes, I am using relationships and think I am doing everything correct, but agree Doctrine should know and I better take a step back before relying on my deferred constraint band-aide. PS. Regardless of whether one "should" do this, would appreciate your thoughts on my original questions.
-
Thank you requinix, I appreciate your advise. I will give thought to your questioning about circular dependency. Maybe I misunderstand the purpose of referring. Let me give more background. I have these objects that reflect real-time environmental data. They are injected in this point object that reflects either real-time or historic time values and/or sums multiple real-time values. For the chart application, these points are injected into data objects, these data objects are injected in series objects, and series objects are injected in chart objects. Now a bar chart might have categories such as country which are common to multiple series such as population over time, however, a pie chart doesn't have this concept of categories and the user interacts with the data differently based on the chart type. To keep it simple, when a request to modify an entity arrives, I pull from the database and create the entity, add/move/delete/modify the entity as necessary, and then save it back to the database. But I am not doing everything manually but am using Doctrine, and Doctrine doesn't know the exact order to execute the inserts, deletes, or updates. I give it an entity which is valid and doesn't violate any constraints, but it is only valid in its final state and executing individual queries to get it there will result in constraint violations. My hopes were make the constraints deferred, wrap it in a transaction, let Doctrine save each table as it wants without working about constraints, commit, and then let PostgreSQL choke if it doesn't like what it was given. Is this not the purpose of deferred constraints or am I off base?
-
They just seem like a simple and reliable solution for some scenarios. Initiate a transaction, do the work, and commit. Examples include: Chicken or the egg scenario. A person can create an account where that account is also available to the individual's associates and each account needs a single administrator which will be the individual who initially set up the account, but then can later be changed. My MySQL solution was temporary disabling foreign keys and PostgreSQL was temporarily disabling triggers so I can utilize FK constraints. Another similar example is any time one needs some user defined default value entity for their account where this default value entity references their account entity and their account entity references this default value entity. When uniqueness is required. I brought up the example of order of lists a while back, and while some had the opinion that it was not critical, it is kind of important and I was having difficulty implementing it for some more complex cases where it wasn't just some one dimensional series. I have since creates multiple entities which each handle their own responsibilities and it is much more robust, however, having the database also enforces uniqueness would be very nice. Are there drawbacks to using deferrable constraints? I expect some decrease in performance which is a small price to pay when they make sense. Do you not like them and if so why? Thanks
-
I am using Doctrine and also wish to utilize PostgreSQL's deferred constraints. It is my understanding that Doctrine is not aware of deferred constraints and while I would like to keep the amount of behind the scenes modification to a minimum, am okay with making manual modifications to the schema. My use cases are being able to perform within a transaction adding entities which contain another entities key and the other entity also contains theirs and updating some unique series which spans multiple entities without violating unique constraints. Originally, I thought I would just have Doctrine create the unique constraint using @UniqueConstraint and manually make it deferred, however, it appears that Doctrine doesn't create a constraint but a unique index. Then I tried adding a constraint with the same name as the index, however, didn't go as there was already a constraint or index on the table. Which then made me realize I really didn't understand the implications of indexes and constraints. Are they somewhat the same thing or totally different. Can they share the same name? If I create a constraint, it is my understanding that PostgreSQL will automatically create an index for it. Can I manually create one first and then it will use it? When dropping indexes, must any constraints that use that index be dropped first? Can a constraint be altered or must it first be dropped and then re-added? Please know that I have tried all of the above, however, have not reached a conclusion on what it means and would like to have better insight on their implications. Thanks
-
Constructor for a function object
NotionCommotion replied to NotionCommotion's topic in Javascript Help
Thanks kicken, That is exactly what I was asking about. And now I even know what to call it (i.e. "mixin"). And also thanks to both of you regarding the other prototype help. -
Constructor for a function object
NotionCommotion replied to NotionCommotion's topic in Javascript Help
Kind of. Or more so how to allow everyone to get a copy of a given function. I can do the following, but it doesn't seem right: var method1=function() {console.log('method1: ' + this.foo);}; var method2=function() {console.log('method2: ' + this.foo);}; var method3=function() {console.log('method3: ' + this.foo);}; Employee.prototype.method1 = method2; SomethingElse.prototype.method1 = method2; This is a little better, but still doesn't seem right: var myLibrary={ method1: function() {console.log('method1: ' + this.foo);}, method2: function() {console.log('method2: ' + this.foo);}, method3: function() {console.log('method3: ' + this.foo);} }; Employee.prototype.method1 = myLibrary.method2; SomethingElse.prototype.method1 = myLibrary.method2; Another approach is as follows but still expect it is not right: var myLibrary=function(){ var methods={ method1: function() {console.log('method1: ' + this.foo);}, method2: function() {console.log('method2: ' + this.foo);}, method3: function() {console.log('method3: ' + this.foo);} }; if(typeof methods[method] === 'undefined') { throw method+" does not exist"; } return method[method]; }(method); Employee.prototype.method1 = myLibrary('method2'); SomethingElse.prototype.method1 = myLibrary('method2'); While there is a million ways to do so, I expect there is a de facto standard way to do so. -
Constructor for a function object
NotionCommotion replied to NotionCommotion's topic in Javascript Help
Thanks kicken, Understood and makes sense. -
Constructor for a function object
NotionCommotion replied to NotionCommotion's topic in Javascript Help
I had been reviewing that source as well as several others with similar information. It becomes confusing due to Javascript's multiple wildly differing approaches to accomplish similar goals which is further complicated with different tutorials, and I will limit myself to just that one for now. Can you comment or point me in the right direction how one allows a single copy of a function to be available for everybody to use?. -
Constructor for a function object
NotionCommotion replied to NotionCommotion's topic in Javascript Help
Not too familiar with anything JavaScript. Do you mean my approach of placing methods in Employee is not modern JavaScript or prototyping isn't? I see. I was using prototyping for some of the SalesPerson's methods but not for Employee's and thus didn't see it. I take it that Employee.call(this, foo) is still applicable, true? And how does one get it? Something like the following? var myLibrary={ method1: function() {console.log('method1: ' + this.foo);}, method2: function() {console.log('method2: ' + this.foo);}, method3: function() {console.log('method3: ' + this.foo);} }; Employee.prototype.method1 = myLibrary.method2; Thanks! -
Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model, I have a SalesPerson which extends Employee as shown below. What is the purpose of these two lines? It doesn't seem to have any effect. SalesPerson.prototype = Object.create(Employee.prototype); SalesPerson.prototype.constructor = SalesPerson; Also, why would one wish to add in the SalesPerson function such as method2() versus adding them afterwards using prototype such as method3()? Thanks function Employee(foo) { this.foo = foo; this.name = ''; this.dept = 'general'; this.method1=function(){ console.log('method1: '+this.foo); } } function SalesPerson(foo, bar) { Employee.call(this, foo); this.bar = bar; this.dept = 'sales'; this.quota = 100; this.method2=function(){ console.log('method2: '+this.bar); } } //What is the purpose of these two lines? SalesPerson.prototype = Object.create(Employee.prototype); SalesPerson.prototype.constructor = SalesPerson; SalesPerson.prototype.method3=function() { console.log('method3: '+this.bar); } function Engineer(foo, bar) { Employee.call(this, foo); this.bar = bar; this.dept = 'sales'; this.quota = 100; } Engineer.prototype = Object.create(Employee.prototype); Engineer.prototype.constructor = Engineer; salesPerson = new SalesPerson('foo', 'bar'); salesPerson.method1(); salesPerson.method2(); salesPerson.method3();
-
Partially replaced "$serie" with "$entity" to indicate it was a doctrine entity, but didn't do my part. Maybe the issue. While I know gdb is relevant and even recently made sure it was installed, I know nothing about it and didn't know it was even required to be used or that I needed to execute it. Will investigate. Thanks
-
CentOS Linux 7 (Core) Linux 3.10.0-1062.18.1.el7.x86_64 and PHP Version 7.4.3 on vmware. Sorry, meant to include the following in my initial post. function test(\Doctrine\ORM\PersistentCollection $collection) { foreach($collection as $entity){ yield new MyWrapper($serie); //$items[]=new MyWrapper($entity); //Doesn't not result in error which solves my problem and am only investigating for curiosity's sake } //return $items; }
-
Displays "Segmentation fault" but no dump. PS, segfault came back when using with php-fpm even after setting rlimit_core = unlimited. Happens whenever I execute "sudo -uOtherUser php bla.php" and "sudo php bla.php", but not when I switch users and then execute "php bla.php". Do you mind trying to execute a php file as sudo and check journalctl for all units? Don't know where to start looking into this one. Where would I be able to view this backtrace? In /tmp or somewhere else? [michael@devserver public]$ cat /proc/sys/kernel/core_pattern /tmp/coredump-%e.%p [michael@devserver public]$ ls -l /tmp total 0 drwx------ 3 root root 16 Apr 9 18:29 systemd-private-809bd1f0c8db495c945df5ac824728c0-httpd.service-dJTl21 drwx------ 3 root root 16 Apr 9 18:29 systemd-private-809bd1f0c8db495c945df5ac824728c0-ntpd.service-iTmi5U drwx------ 3 root root 16 Apr 9 20:30 systemd-private-809bd1f0c8db495c945df5ac824728c0-php72-php-fpm.service-M1mHap drwx------ 3 root root 16 Apr 9 20:30 systemd-private-809bd1f0c8db495c945df5ac824728c0-php-fpm.service-2mtExV drwx------ 2 root root 6 Apr 9 18:29 vmware-root_826-2990547547 drwx------ 2 root root 6 Apr 6 15:49 vmware-root_843-4021784525 [michael@devserver public]$
-
I updated the core_pattern, added rlimit_core = unlimited to the pool, and restarted php-fpm. I no longer get the error. Still would like to know what is causing it as setting limits to unlimited doesn't sound like a good idea. Added the following to index.php, executed sudo -upool1user dump.php (pool1user is needed for postgres) $server_json=json_encode($_SERVER); $script=<<<EOL <?php \$_SERVER=json_decode('$server_json',true); include 'index.php'; EOL; file_put_contents('dump.php', $script); I then still get the segfault error, however, don't seem to generate a dump. Not sure whether related to the segfault or the inability to create a dump, I do view a couple PAM issues (don't know what PAM is). Apr 09 20:39:08 devserver sudo[4385]: PAM unable to dlopen(/usr/lib64/security/pam_fprintd.so): /usr/lib64/security/pam_fprintd.so: cannot open shared object file: No such file or directory Apr 09 20:39:08 devserver sudo[4385]: PAM adding faulty module: /usr/lib64/security/pam_fprintd.so Apr 09 20:39:08 devserver sudo[4385]: michael : TTY=pts/1 ; PWD=/var/www/dataapp/public ; USER=pool1user ; COMMAND=/bin/php dump.php Apr 09 20:39:08 devserver sudo[4385]: pam_unix(sudo:session): session opened for user pool1user by michael(uid=0) Apr 09 20:39:09 devserver kernel: php[4386]: segfault at 7f961124c100 ip 000055f84d42e0cd sp 00007ffd7ca1c608 error 4 in php[55f84d0ff000+472000] Also, https://bugs.php.net/bugs-generating-backtrace.php states the following. Looking at phpinfo, I don't think it is enabled. Currently using remi's repo for my php installations, an maybe need to compile? Any thoughts? Thanks
-
Trying but haven't yet been successful. Looking at https://ma.ttias.be/generate-php-core-dumps-segfaults-php-fpm/, however, echo '/tmp/coredump-%e.%p' > /proc/sys/kernel/core_pattern returns permission denied. I know it is possible to do using tee, but instead just tried to edit /proc/sys/kernel/core_pattern using vi (was previously "core" so I figured I can just set it back). Wasn''t as easy as i though, and couldn't get my non-default pools running until rebooting the machine.. Any recommend approach to get a bactrace using php-fpm?
-
Anyone know why the following results in an error? Not a big deal as memory is not an issue and I can (and have) just changed it to create a new array instead of using a generator, but still curious. Thanks <?php foreach($doctrineCollection as $doctrineEntity){ yield new MyWrapper($doctrineEntity); /* After around 4 iterations, results in the following error: syslog Apr 06 15:25:25 myserver.net kernel: php-fpm[42889]: segfault at 7f8156a14100 ip 000055bb1d79acfd sp 00007ffd0b50a968 error 4 in php-fpm[55bb1d47c000+46e000] /var/log/php-fpm/error.log [Mon Apr 06 20:06:38.781360 2020] [proxy_fcgi:error] [pid 1501:tid 140210423629568] (104)Connection reset by peer: [client 12.345.67.890:45574] AH01075: Error dispatching request to : /var/log/httpd/error_log [06-Apr-2020 20:04:52] WARNING: [pool michael] child 5524 exited on signal 11 (SIGSEGV) after 0.138268 seconds from start [06-Apr-2020 20:04:52] NOTICE: [pool michael] child 5526 started */ } class MyWrapper { private $doctrineEntity; public function __construct($doctrineEntity) { $this->doctrineEntity=$doctrineEntity; } }
-
Help authenticating to PostgreSQL
NotionCommotion replied to NotionCommotion's topic in PHP Coding Help
php-fpm -
Help authenticating to PostgreSQL
NotionCommotion replied to NotionCommotion's topic in PHP Coding Help
Ah, I interpreted "connection refused" as actively having an ident server. https://www.postgresql.org/docs/12/auth-ident.html's claim Virtually every Unix-like operating system ships with an ident server that listens on TCP port 113 by default throw me off. Reading that document more closely makes me feel using ident is not the best choice and it is strange that the default config uses it. Now it makes sense that I couldn't find it. The socket is located at /var/run/postgresql. Thanks. Per https://www.postgresql.org/docs/12/auth-pg-hba-conf.html, peer authentication will be used instead of ident for local connections. This appears to require me to either run httpd as postgres or add apache as a postgres user. Agree? Either of these reasonable choices, or maybe give this crusade up and utilize host authentication as Phi11W suggested? Any suggestions how to run a single virtual host as a different user? 2020-03-19 12:05:35.761 UTC [47784] LOG: provided user name (postgres) and authenticated user name (apache) do not match 2020-03-19 12:05:35.761 UTC [47784] FATAL: Peer authentication failed for user "postgres" 2020-03-19 12:05:35.761 UTC [47784] DETAIL: Connection matched pg_hba.conf line 80: "local all all peer" -
Help authenticating to PostgreSQL
NotionCommotion replied to NotionCommotion's topic in PHP Coding Help
Thanks Phill, Appreciate your great response. Reading it once, twice, and three times. I think all is good.