X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Bart Oldeman Newsgroups: comp.os.msdos.djgpp Subject: Re: _CRT0_FLAG_NULLOK vs. DOSEMU Date: Wed, 04 Aug 2004 12:00:46 +1200 Organization: Ihug Limited Lines: 42 Message-ID: References: <20040803165406 DOT GA10126 AT webhome DOT cz> NNTP-Posting-Host: 222-152-121-213.adsl.ihug.co.nz Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: lust.ihug.co.nz 1091577813 9007 222.152.121.213 (4 Aug 2004 00:03:33 GMT) X-Complaints-To: abuse AT ihug DOT co DOT nz NNTP-Posting-Date: Wed, 4 Aug 2004 00:03:33 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en In-Reply-To: <20040803165406.GA10126@webhome.cz> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp 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 Precedence: bulk Egon Eckert wrote: > > is null pointer dereference protection expected to work under DOSEMU/Linux? > I have no success with that: reading/writing from/to *NULL does not trap. :( It works in DOSEMU 1.3.1 (development version), not in the stable version 1.2.2 -- NULL pointer protection relies on uncommitted memory support in the DPMI server; and supporting this in DOSEMU required some moderately intrusive reorganization of its memory mapping mechanism, and this happened too late for 1.2.x. This is what I see with DOSEMU 1.3.1 now: C:\>type crash.c int main(void) { *(char*)0=0; } C:\>gcc crash.c C:\>a Exiting due to signal SIGSEGV Page fault at eip=000015c3, error=0006 eax=00000000 ebx=0000b5cb ecx=00000000 edx=0000033f esi=00000054 edi=0000cf4c ebp=0008cf28 esp=0008cf28 program=C:\A.EXE cs: sel=00c7 base=b5cb1000 limit=0009ffff ds: sel=00cf base=b5cb1000 limit=0009ffff es: sel=00cf base=b5cb1000 limit=0009ffff fs: sel=00af base=000028f0 limit=0000ffff gs: sel=00df base=00000000 limit=0010ffff ss: sel=00cf base=b5cb1000 limit=0009ffff App stack: [0008cf4c..0000cf4c] Exceptn stack: [0000ceac..0000af6c] Call frame traceback EIPs: 0x000015c3 0x00002948 whereas dosemu-1.2.2 simply executes a.exe without any message. Bart