Hi Dmitry!

----- Original Message -----
From: "Dmitry Stogov"
Sent: Tuesday, December 22, 2015

Hi Matt,

On Tue, Dec 22, 2015 at 8:36 PM, Matt Wilmas <php_li...@realplain.com>
wrote:

Hi all,

Lior, which compiler are you using?  You can still reproduce the problem?
Can you run it through Valgrind?

I'm getting random crashes I can't figure out on 64-bit Linux after just
making a very trivial change. :-/  The backtrace is the same up to
compile_file() (although maybe that doesn't mean much? hmm).

Dmitry, to reproduce, just add another GLOBAL REGISTER variable to
zend_vm_execute, and then set it in execute_ex(). An empty file will crash
it.  It does NOT crash with --enable-debug, nor with certain combinations
of optimization level and global register.


Using another global register is not a trivial change.

Well, I meant relatively since a couple are already used. ;-) And thought GCC managed it all... (wrong).

%r12 with -O2 seems to consistently fail, but with -O3 it might be %r13,
etc.


In general both should work fine, but it seems like this feature is not
well debugged in GCC and may lead to miscompilation.

Right, I remember you requiring min. 4.8 back in the spring after issues with earlier versions. And now I wondered if something was still unstable and only working by chance.

Now, the question: Is that little change triggering a bug in GCC 4.8?  Or
is it somehow revealing a PHP problem?!


It may be a GCC bug, as well as a bug in your code...
may be you need to save/restore it manually in execute_ex()?

Argh!! Do I feel dumb. :-( And that's even what's happening right there with the others. (I was thinking of those as executor-specific save/restore, rather than the registers themselves.) And seems I had it reversed thinking the caller would save its own first, which of course is wrong for CALLEE-saved regs.

Looks like any combo is working fine now. I had the changes as a whole all working quickly (will reply to your previous subject soon) by luck. I tried everything else after crashes started... Who knows how long it would've taken if not for your reminder! :-)

Thanks. Dmitry.

Thanks again, and sorry for the noise.

- Matt

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to