X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=YmA5Tpdx9MUZQJzWX8SEfm+wxCAmxoynvLEUZHFZEmM=; b=TyOzPAnJ+EkL+6vZZEYJxV7aruCrG14EOoY5Am/f51CkVA6qv2IF+FApQQ1ZygcZS6 FkLQXViCnB0fDonamXH6R2p9Qi1IwDIhvryB9hBj6VYCtBHsLuf5Yze9040CE4a5Rpmi QYwi6RhYMqBW2WL9L2Hi7u0N4quhb30X2zKHHkemu+4TP6zZnGpsH9cM2EYCedGd7t0/ Tnyzuurv420y4OxzBwBWXPEkYIgPRL2gtHpDBgwmukBHmhYcYdXbOU0fwv4XULZpfzkt Lq4hoi+zFy4eFaiF6E2uy4SkIwG5BDgESAfEn6ki1KbByk3VXcHUOhY3dPfFKUL2qhZG D5nw== MIME-Version: 1.0 X-Received: by 10.107.27.195 with SMTP id b186mr8907032iob.140.1440169507939; Fri, 21 Aug 2015 08:05:07 -0700 (PDT) Date: Fri, 21 Aug 2015 18:05:07 +0300 Message-ID: Subject: dlopen() failure with ELOOP with legitimate dxe From: "Ozkan Sezer (sezeroz AT gmail DOT com) [via djgpp AT delorie DOT com]" To: djgpp Content-Type: text/plain; charset=UTF-8 Reply-To: djgpp AT delorie DOT com There is a bug in dlopen() preventing dlopen()ing a dxe. Here is the scenario, what we experienced with q2dos: ref_soft.dxe -> has no dependency dxes ref_gl.dxe -> depends on gl.dxe (present) gl.dxe -> depends on glide3x.dxe (not present) Start the exe, dlopen()s ref_soft.dxe -> OK, runs just fine. Do a dlclose() ref_soft.dxe, and attempt to dlopen() ref_gl.dxe: fails, no surprise, (dlerror() misleadingly says ENOENT, but ok) The failure triggers dlopen()ing of ref_soft.dxe again: it fails with ELOOP which is NOT expected because the dxe is there and it is legitimate and it loaded and ran successfully the first time. As far as I can see, the "Load the dependencies" loop around line 237 of dlopen.c does not reset stk_top upon failure which should be the reason for failure of further dlopen() attempts? -- O.S.