delorie.com/archives/browse.cgi | search |
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=20161025; | |
h=from:subject:to:references:message-id:date:user-agent:mime-version | |
:in-reply-to:content-language:content-transfer-encoding; | |
bh=UAwdX5bHHGOOPy2S1lIk5U534Cho6u8OoZTZzF2GDhU=; | |
b=KkNYrTJv1+mvQkwtGdQ3Q3c+Zw/wXjBcHxkJ66U7nWiLBmoRbr7shA+0StNbmGSrv7 | |
i1s6Oq76Pc+52JNSKHGHbwtOeQvJ9VWYQwSTr74ET4LJlTHmmDSZAofeNzCVb+SlfrZS | |
HQF0lKEPGGCaiHMAbnlEG80DRfX7orOabkDVQXH6QtUgiAhM8yBFBGymtxF1+5P6mR/3 | |
1ppi2Mm7vOWIx1gLU5pMrzdb/skJ0w12zVRI6Q91BNWmEiS5H9EJpMl3aH8hMYZqgjrn | |
P8q7rEotBMY3NI0Nl4kDBPviYdHuA3g/MoI6Lr4nZ3Yk/90hLmDPoR2V64tpU09ZWHI2 | |
CP3g== | |
X-Google-DKIM-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; |
d=1e100.net; s=20161025; | |
h=x-gm-message-state:from:subject:to:references:message-id:date | |
:user-agent:mime-version:in-reply-to:content-language | |
:content-transfer-encoding; | |
bh=UAwdX5bHHGOOPy2S1lIk5U534Cho6u8OoZTZzF2GDhU=; | |
b=XyBHZmIRrvRU6kGqipd7P74eXmqqzv78qbuUGjxUbV+HmkX+QvWGHRLMLUYTSbwl1Q | |
tAlvgBaNcAs5i4Bv9wOP7W7KZrrniHU/UH+Tk7TDCHCCcoHI/+3s0h7cNtHFdC8iH6gG | |
4ISWPdq0zIaLwL4P4Xq2UEvE3sAyDFYZ9jPyB8srbn1+NPUARgv6AENzYP/C1H0NXLHY | |
73ynVEt3wzwbkgA7E94WnAItTo90P7UXsBbp9bCGIPBA9NBXSYvy4cE1vi6NwaYTDeyA | |
L88vKIlWu6vJQLbV+4ziXzUHF5GrKYLk1gVz8pOOtkJg/TPPFaCFjLL6E3YjX3XFjAfP | |
WQ1g== | |
X-Gm-Message-State: | APjAAAV8mWbkt2NrYUDVX3FcTrYQVB8ThLjkOAkVLLzMhmrVN2Yl2T22 |
t1UIueex/UgN7kem/xt2vxB4D4R9 | |
X-Google-Smtp-Source: | APXvYqwWNUOUh1B8IGu+yxPZ6/mjGKgxEOC67+YsGbOngR0LCD+UDD6Apoga2MaVQsGRZTUrpem0rQ== |
X-Received: | by 2002:a2e:9dd7:: with SMTP id x23mr9084934ljj.160.1561103074865; |
Fri, 21 Jun 2019 00:44:34 -0700 (PDT) | |
From: | "Gisle Vanem (gisle DOT vanem AT gmail DOT com) [via djgpp AT delorie DOT com]" <djgpp AT delorie DOT com> |
Subject: | Re: malloc() returns pointer to already allocated memory |
To: | djgpp AT delorie DOT com |
References: | <158e5d20-0a90-4beb-de48-da328379d8fb AT gmail DOT com> |
<qe76u1$1kj8$1 AT gioia DOT aioe DOT org> | |
<f0b68226-f6f4-244a-6dd5-a8ecbabb584b AT gmail DOT com> | |
<qe79eb$1urs$1 AT gioia DOT aioe DOT org> <qe7ar9$52r$1 AT gioia DOT aioe DOT org> | |
<qe7avt$52r$2 AT gioia DOT aioe DOT org> <qe7bve$9ti$1 AT gioia DOT aioe DOT org> | |
<qe7f8g$oak$1 AT gioia DOT aioe DOT org> | |
<b035cc97-1261-e26e-2d3c-b3672928c9af AT gmail DOT com> | |
<qec3qv$1hdk$1 AT gioia DOT aioe DOT org> | |
<64786234-be30-3862-b2ee-133d2c49fb1a AT gmail DOT com> | |
<qefq2m$1o7d$1 AT gioia DOT aioe DOT org> | |
<19ff3320-4068-663e-ca70-d3e4dc459ba7 AT gmail DOT com> | |
<qehvr7$1fra$1 AT gioia DOT aioe DOT org> | |
Message-ID: | <5038b8a2-cd29-01f8-f825-dead031f8361@gmail.com> |
Date: | Fri, 21 Jun 2019 09:44:34 +0200 |
User-Agent: | Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 |
Thunderbird/60.7.1 | |
MIME-Version: | 1.0 |
In-Reply-To: | <qehvr7$1fra$1@gioia.aioe.org> |
Reply-To: | djgpp AT delorie DOT com |
Errors-To: | nobody AT delorie DOT com |
X-Mailing-List: | djgpp AT delorie DOT com |
X-Unsubscribes-To: | listserv AT delorie DOT com |
Rod Pemberton wrote: > .. was caused by non-reentrant code being reentered. That could be your > issue as well, e.g., if using hardware or software interrupt routines. ... > Of course, not saving/restoring C/C++ code's in-use registers does much > the same thing. Certain registers must be preserved and can't be > clobbered. These can also be referred to as callee-savee or > caller-saved registers. For DJGPP, my notes say that EBX, EDI, ESI, > EBP, DS, ES, SS registers must preserved. I.e., check your inlined > assembly's clobber list. And the GS, FS registers too. These are *not* preserved in a real-mode callback (RMCB) like '_go32_dpmi_allocate_real_mode_callback_retf()' Not sure about '_dpmi_allocate_real_mode_callback()' Ref: <djgpp_root>/src/LIBC/GO32/gormcb.c I figured this after similar bugs in the network-driver call-back in Watt-32 tcp/ip stack. I'm not sure how/where FS/GS are used; I suspect a modern gcc uses those in e.g. built-in functions etc. -- --gv
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |