Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zend_mm_heap corrupted on centos guest #21

Closed
Danack opened this issue Mar 4, 2015 · 2 comments
Closed

zend_mm_heap corrupted on centos guest #21

Danack opened this issue Mar 4, 2015 · 2 comments

Comments

@Danack
Copy link
Contributor

Danack commented Mar 4, 2015

Repo script is below. It's basically example 2 with an extra host name inserted.

The environment is Centos 6.4 with self-built version of PHP 5.6.2. It is sitting inside a vagrant box hosted on Mac OSX .

The hostname is being resolved by a hosts file on the host, not the guest. I'm going to attempt to capture the packets being sent between guest/host.

The output is

# php 002_async.php 
github.com => 192.30.252.131
google.com => 62.24.157.49
FAILED: imagick.test
stackoverflow.com => 198.252.206.140
localhost => 127.0.0.1
192.168.0.1 => 192.168.0.1
::1 => ::1
zend_mm_heap corrupted
<?php

require __DIR__ . '/../vendor/autoload.php';

Amp\run(function() {
    $names = [
        'github.com',
        'google.com',
        'imagick.test', // this is the extra domain
        'stackoverflow.com',
        'localhost',
        '192.168.0.1',
        '::1',
    ];

    $promises = [];
    $resolver = new Amp\Dns\Resolver;
    foreach ($names as $name) {
        $promise = $resolver->resolve($name);
        $promises[$name] = $promise;
    }

    // Combine our multiple promises into a single promise
    $comboPromise = Amp\some($promises);

    // Yield control until the combo promise resolves
    list($errors, $successes) = (yield $comboPromise);

    foreach ($names as $name) {
        echo isset($errors[$name]) ? "FAILED: {$name}\n" : "{$name} => {$successes[$name][0]}\n";
    }

    // Stop the event loop so we don't sit around forever
    Amp\stop();
});

@Danack
Copy link
Contributor Author

Danack commented Mar 4, 2015

Ok, so the fact that the lookup failing is pretty obvious now that it's morning. Amphp/dns doesn't read the /etc/resolve file which in the guest looks like:

; generated by /sbin/dhclient-script
nameserver 10.0.2.3

10.0.2.3 is the host. As the entry is in the hosts file on the host, and Amphp/dns uses 8.8.8.8 to do the dns lookup, it obviously fails.

I'm going to keep trying to track the segfault/mem corruption, as it seems to be a real thing.

@kelunik
Copy link
Member

kelunik commented Sep 18, 2015

Support for /etc/resolv.conf is now merged.

@kelunik kelunik closed this as completed Mar 13, 2016
peter279k pushed a commit to peter279k/dns that referenced this issue Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants