<html><body><div><br></div><div><br>On 15 Feb, 2012,at 11:25 AM, Martin Nowak <dawg@dawgfoto.de> wrote:<br><br><div><blockquote type="cite"><div class="msg-quote"><div class="_stretch">On Wed, 15 Feb 2012 08:52:52 +0100, Jacob Carlborg <<a href="mailto:doob@me.com" _mce_href="mailto:doob@me.com">doob@me.com</a>> wrote:<br>
<br>
> On 15 Feb, 2012,at 01:35 AM, Martin Nowak <<a href="mailto:dawg@dawgfoto.de" _mce_href="mailto:dawg@dawgfoto.de">dawg@dawgfoto.de</a>> wrote:<br>
><br>
>> > I'm seeing some general problem with array appending. Removing the<br>
>> > append in the above method and the segfault moves to an other part of<br>
>> > the code, which uses array appending.<br>
>> ><br>
>><br>
>> Any futher insights on this?<br>
>> Even a bigger test case would be helpful if it reproduces the error.<br>
> Unfortunately no. I have a big test case:<br>
><br>
> This example: <a href="http://pastebin.com/k1QQnhEp" _mce_href="http://pastebin.com/k1QQnhEp">http://pastebin.com/k1QQnhEp</a><br>
> together with Orange: <a href="https://github.com/jacob-carlborg/orange" _mce_href="https://github.com/jacob-carlborg/orange">https://github.com/jacob-carlborg/orange</a><br>
><br>
> Just place the example in the same folder as Orange and run it with  <br>
> RDMD.<br>
<br>
I get an infinite recursion.<br>
<br>
Starting from<br>
Serializer.d(1107): return deserializeObject!(T)(keyOrId); // with keyOrId  <br>
being "refme" the recursive field name in Foo<br>
<br>
#29 0x000000000040a947 in  <br>
orange.serialization.Serializer.Serializer.__T19deserializeInternalTC4main3FooTAyaZ.deserializeInternal()  <br>
(this=0x8006c4a00, keyOrId=0x0000000000459eb00000000000000005) at  <br>
orange/serialization/Serializer.d:1104<br>
#30 0x000000000040ad53 in  <br>
orange.serialization.Serializer.Serializer.__T29objectStructDeserializeHelperTC4main3FooZ.objectStructDeserializeHelper()  <br>
(this=0x8006c4a00, value=<error reading variable>) at  <br>
orange/serialization/Serializer.d:1482<br>
#31 0x000000000040ac7e in  <br>
orange.serialization.Serializer.Serializer.__T17deserializeObjectTC4main3FooTAyaZ.deserializeObject()  <br>
(this=0x80128b1c0) at orange/serialization/Serializer.d:1181<br>
#32 0x000000000040a89f in  <br>
orange.serialization.Serializer.Serializer.__T13triggerEventsTC4main3FooZ.triggerEvents()  <br>
(this=0x8006c4a00, dg=0x000000000040aa94000000080128b1c0,  <br>
value=0x80128c860) at orange/serialization/Serializer.d:1749<br>
#33 0x000000000040aa8b in  <br>
orange.serialization.Serializer.Serializer.__T17deserializeObjectTC4main3FooTAyaZ.deserializeObject()  <br>
(this=0x80128b1c0) at orange/serialization/Serializer.d:1153<br>
#34 0x00000000004061cb in  <br>
orange.serialization.archives.XmlArchive.__T10XmlArchiveTaZ.XmlArchive.unarchiveObject()  <br>
(this=0x80128b140) at orange/serialization/archives/XmlArchive.d:1366<br>
#35 0x0000000000417cdb in  <br>
orange.util.Use.__T7restoreTvTS6orange3xml11XmlDocument19__T11XmlDocumentTaZ11XmlDocument4NodeZ.restore()  <br>
(this=0x0, value=0x8006c6f50, dg=0x000000000040603c000000080128b140) at  <br>
orange/util/Use.d:162<br>
#36 0x0000000000417b94 in  <br>
orange.util.Use.__T13RestoreStructTvTS6orange3xml11XmlDocument19__T11XmlDocumentTaZ11XmlDocument4NodeZ.RestoreStruct.opIn()  <br>
(this=0x7fffffbffc20, deleg=0x000000000040603c000000080128b140) at  <br>
orange/util/Use.d:127<br>
#37 0x0000000000406035 in  <br>
orange.serialization.archives.XmlArchive.__T10XmlArchiveTaZ.XmlArchive.unarchiveObject()  <br>
(this=0x8006c6f00, dg=..., result=0x80128b1c8, id=0x7fffffbffc98,  <br>
key=0x0000000000459eb00000000000000005) at  <br>
orange/serialization/archives/XmlArchive.d:1342<br>
#38 0x000000000040aa2d in  <br>
orange.serialization.Serializer.Serializer.__T17deserializeObjectTC4main3FooTAyaZ.deserializeObject()  <br>
(this=0x8006c4a00, keyOrId=0x0000000000459eb00000000000000005) at  <br>
orange/serialization/Serializer.d:1152<br>
#39 0x000000000040a947 in  <br>
orange.serialization.Serializer.Serializer.__T19deserializeInternalTC4main3FooTAyaZ.deserializeInternal()  <br>
(this=0x8006c4a00, keyOrId=0x0000000000459eb00000000000000005) at  <br>
orange/serialization/Serializer.d:1104<br>
<br>
<br>
By the way, there are about 3 or 4 delegate context allocations within  <br>
this cycles.</div></div></blockquote><span> </span><br></div><div>Yeah, but the top of the backtrace looks like this:<br></div><div><br></div><div>(gdb) bt<br>#0  0x0000000100043f5c in D2gc3gcx3Gcx7getInfoMFPvZS2gc3gcx7BlkInfo ()<br>#1  0x0000000100042ecd in D2gc3gcx2GC11queryNoSyncMFPvZS2gc3gcx7BlkInfo ()<br>#2  0x0000000100042e1d in D2gc3gcx2GC5queryMFPvZS2gc3gcx7BlkInfo ()<br>#3  0x0000000100041400 in gc_query ()<br>#4  0x000000010004ae25 in _d_arrayappendcTX ()<br>#5  0x000000010000b7fa in D6orange3xml9PhobosXml7Element10attributesMFZAC6orange3xml9PhobosXml9Attribute17__foreachbody1521MFKAyaKAyaZi ()<br>#6  0x0000000100046ec6 in _aaApply2 ()<br>#7  0x000000010000b770 in D6orange3xml9PhobosXml7Element10attributesMFZAC6orange3xml9PhobosXml9Attribute ()<br>#8  0x0000000100001c83 in D6orange3xml11XmlDocument19__T11XmlDocumentTaZ11XmlDocument4Node10attributesMFZS6orange3xml11XmlDocument19__T11XmlDocumentTaZ11XmlDocument12VisitorProxy ()<br>#9  0x000000010000205e in D6orange3xml11XmlDocument19__T11XmlDocumentTaZ11XmlDocument10QueryProxy9attributeMFDFS6orange3xml11XmlDocument19__T11XmlDocumentTaZ11XmlDocument4NodeZbZS6orange3xml11XmlDocument19__T11XmlDocumentTaZ11XmlDocument10QueryProxy <br></div><div><br></div><div>At number 4 there's a call to _d_arrayappendcTX, which would be the array appending in this method: https://github.com/jacob-carlborg/orange/blob/master/orange/xml/PhobosXml.d#L764<br></div><div><br></div><div>If I remove that array append then I get the same error somewhere else in the code.<br></div><div><br></div><div>--<br></div><div>/Jacob Carlborg<br></div><div><br></div><div><br></div></div></body></html>