object.error: Privileged Instruction

Don Clugston dac at nospam.com
Wed Sep 26 10:24:34 PDT 2012


On 22/09/12 21:49, Jonathan M Davis wrote:
> On Saturday, September 22, 2012 21:19:27 Maxim Fomin wrote:
>> Privilege instruction is an assembly instruction which can be
>> executed only at a certain executive process context, typically
>> os kernel. AFAIK assert(false) was claimed to be implemented by
>> dmd as a halt instruction, which is privileged one.
>>
>> However, compiled code shows that dmd generates int 3 instruction
>> for assert(false) statement and 61_6F_65_75 which is binary
>> representation of "aoeu" for assert(false, "aoeu") statement and
>> the latter is interpreted as privileged i/o instruction.
>
> It's a normal assertion without -release. With -release, it's a halt
> instruction on Linux but IIRC it's something slightly different (albeit
> similar) on Windows, though it might be halt there too.
>
> - Jonathan M Davis
>

I implemented the code runtime code that does it, at least on Windows. 
You get much better diagnostics on Windows.
IMHO it is a Linux misfeature, they conflate a couple of unrelated 
hardware exceptions together into one signal, making it hard to identify 
which it was.



More information about the Digitalmars-d-learn mailing list