You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GDB: Python Exception <class 'TypeError'>: exceptions must derive from BaseException #15923
(gdb) set print pretty on
(gdb) break /usr/src/php/ext/standard/var.c:105
Breakpoint 1 at 0x4b6130: file /usr/src/php/ext/standard/var.c, line 105.
(gdb) run /var/www/html/test.php
Starting program: /usr/local/bin/php /var/www/html/test.php
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 1, php_var_dump (struc=0x7ffff54140f0, level=1) at /usr/src/php/ext/standard/var.c:113
113 if (level > 1) {
(gdb) p *struc
While I don't understand why PHP would throw a TypeError here, the error message is certainly not related to nice elephpants, but rather to nasty reptiles. ;)
While I don't understand why PHP would throw a TypeError here, the error message is certainly not related to nice elephpants, but rather to nasty reptiles. ;)
Its not a PHP type error, its a Python one - I boiled it down to a minimal reproduction case, but I was getting a lot of these (I just started using GDB for PHP)
I see this is tagged as needing feedback - what more can I provide?
raise"Could not find zend_types.h: symbol zend_gc_refcount not found"
You can't raise a string. @DanielEScherzer Are you using a release build? That could explain why it can't find the symbol required.
I didn't think I was, but running ./configure --enable-debug and then re-make-ing and trying again fixed the issue. I guess then the attempted error makes sense, but the actual error (from raising a string) is problematic and should still be fixed
Activity
cmb69 commentedon Sep 16, 2024
While I don't understand why PHP would throw a
TypeErrorhere, the error message is certainly not related to nice elephpants, but rather to nasty reptiles. ;)DanielEScherzer commentedon Sep 16, 2024
Its not a PHP type error, its a Python one - I boiled it down to a minimal reproduction case, but I was getting a lot of these (I just started using GDB for PHP)
I see this is tagged as needing feedback - what more can I provide?
cmb69 commentedon Sep 16, 2024
The question is: why do you get a Python error when running/debugging PHP code? I think there is something wrong with your setup.
DanielEScherzer commentedon Sep 16, 2024
I believe it is because the GDB stuff is written in python, see https://github.com/php/php-src/blob/1ce07b0957c9323e93c45d0a83c0133aa177a911/scripts/gdb/php_gdb.py
ndossche commentedon Sep 16, 2024
The error likely comes from this line:
php-src/scripts/gdb/php_gdb.py
Line 304 in 1ce07b0
You can't raise a string.
@DanielEScherzer Are you using a release build? That could explain why it can't find the symbol required.
DanielEScherzer commentedon Sep 16, 2024
I didn't think I was, but running
./configure --enable-debugand then re-make-ing and trying again fixed the issue. I guess then the attempted error makes sense, but the actual error (from raising a string) is problematic and should still be fixedndossche commentedon Sep 16, 2024
Yeah, I'll fix it. Looks like it's just on the master branch.
cmb69 commentedon Sep 16, 2024
Ah, I hadn't noticed this yet.
Fix phpGH-15923: GDB: Python Exception <class 'TypeError'>: exception…
Fix phpGH-15923: GDB: Python Exception <class 'TypeError'>: exception…