Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #465 (new defect)

Opened 12 years ago

Last modified 11 years ago

Unittest fails in tango.text.convert.Layout using gdc

Reported by: larsivi Assigned to: larsivi
Priority: major Milestone: External Bugs
Component: Tango Version: 0.97 RC1
Keywords: gdc, linux, unittest Cc:


tango.core.Exception.AssertException?@tango/text/convert/Layout.d(673): 0.00

IIRC correctly this is a GDC bug (the 1.23f thingy), but probably nice to keep around until it is fixed in a GDC release.


Layout.patch (4.6 kB) - added by mariusmuja on 11/22/07 06:57:43.

Change History

06/29/07 05:16:13 changed by kris

  • milestone changed from 0.99 RC3 to 1.0.

08/28/07 06:44:54 changed by kris

  • status changed from new to assigned.

09/30/07 18:49:17 changed by Carlos

I get tango.core.Exception.AssertException@Layout.d(589): false. GDC on Mac OS X.

09/30/07 19:37:10 changed by kris

Which release? Line 589 will not currently give you that msg

09/30/07 21:18:01 changed by Carlos

Rev [2590]

09/30/07 21:21:05 changed by kris

09/30/07 21:26:11 changed by kris

BTW: Layout passes the unittest on Win32, which is why I'm asking which version. Do you have any debugging capability for this, Carlos?

09/30/07 22:33:15 changed by Carlos

I meant I was using Tango rev [2590], which includes rev [2465] for Layout.d.

I can debug it with dbg. The most relevant information from a debugging session seems to be this:

Breakpoint 3, _D5tango4text7convert6Layout13__T6LayoutTaZ6Layout5mungeMFAaAaC8TypeInfoPaZAa (this=@0x407ff0, result={length = 384, ptr = 0xbfffeca4 "???h"}, format={length = 0, ptr = 0x0}, type=@0x2e2d4, p=0xbffff10c "") at Layout.d:417
417                                 return unknown (result, format, type, p);

Which is in Layout.munge. So, apparently that switch is not working too well because if I print[9], I get b. Maybe a GDC codegen bug? Can somebody else confirm?

09/30/07 22:53:16 changed by kris

oh, man :(

09/30/07 22:54:37 changed by kris

hang on ... your original message indicates it emits false ... not the default?

10/01/07 04:10:46 changed by Carlos

Ok, turns out that the debugger was wrong and it wasn't going to line 417. The whole thing seems to be an architecture problem.

11/05/07 12:55:43 changed by larsivi

It is now line 766, and is still a problem in

gdc (GCC) 4.1.3 20070831 (prerelease gdc 0.25, using dmd 1.021) (Ubuntu 0.25-4.1.2-16ubuntu1)

11/05/07 15:36:28 changed by kris

can you communicate this to David Friedman, please?

11/22/07 06:57:04 changed by mariusmuja

The problem seems to be from the fact that variadic arguments of some types can only be accessed using va_arg!(Type)(_argptr) template instead of casting _argptr directly.

The attached patch seems to solve the problem (at least the 1.23f thingy).

11/22/07 06:57:43 changed by mariusmuja

  • attachment Layout.patch added.

01/25/08 10:35:14 changed by larsivi

Marius: Thanks for the patch, however it ignores the fact that the X86_64 block actually is a workaround for

The other codepath not using stdarg works perfectly for DMD, and mostly for GDC on 32 bit targets. It does disclose some interesting artifacts though that we're not yet certain of, and that may make it possible to find a workaround for the issue of the failing unittest.

02/11/08 11:52:00 changed by larsivi

  • milestone changed from 1.0 to External Bugs.

The interesting artifact mentioned above is that the failing unittest actually works for 32 bit x86 if formatting is done through the x86_86 code path. No idea what I should conclude from that. Fixing bugzilla 1805 for GDC would resolve all these issues though.

04/08/08 16:37:01 changed by larsivi

This now works also for x86 - using the same workaround for all platforms when using GDC (see #1015).

05/07/08 18:25:29 changed by larsivi

  • owner changed from kris to larsivi.
  • status changed from assigned to new.