www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - [FreeBSD] 0x000000000061d8cd in rt.aaA.Impl.findSlotLookup(ulong,

reply Mengu <mengukagan gmail.com> writes:
hello everyone

i have a small program that parses an xml file, holding a list 
with 13610 elements. after making the list, it iterates over the 
list (paralele), goes to a web site and grabs the related data 
for that element.

it works perfect for the first 1K element in the list. after that 
i get a very annoying segmentation fault. no exceptions, nothing. 
it just dumps a core file. below is the full stack trace. (also 
available at https://pastebin.com/PT1R5D7S)

i appreciate any help.

my dmd info:
DMD64 D Compiler v2.076.0-dirty
Copyright (c) 1999-2017 by Digital Mars written by Walter Bright

my os info:

r321309: Fri Jul 21 02:08:28 UTC 2017     
root releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64



(gdb) bt full

const(void*), const(TypeInfo)) inout ()
No symbol table info available.

No symbol table info available.

std.regex.internal.ir.getMatcher(std.uni.InversionList!(std.uni.GcPo
icy).InversionList) ()
No symbol table info available.

std.regex.internal.parser.CodeGen.charsetToIr(std.uni.InversionList!(std.uni.GcPo
icy).InversionList) ()
No symbol table info available.

std.regex.internal.parser.Parser!(immutable(char)[], 
std.regex.internal.parser.CodeGen).Parser.parseEscape() ()
No symbol table info available.

std.regex.internal.parser.Parser!(immutable(char)[], 
std.regex.internal.parser.CodeGen).Parser.parseAtom() ()
No symbol table info available.

std.regex.internal.parser.Parser!(immutable(char)[], 
std.regex.internal.parser.CodeGen).Parser.parseRegex() ()
No symbol table info available.

std.regex.internal.parser.Parser!(immutable(char)[], 
std.regex.internal.parser.CodeGen).Parser.this!(const(char)[]).thi
(immutable(char)[], const(char)[]) ()
No symbol table info available.

std.regex.regexImpl!(immutable(char)[]).regexImpl(immutable(char)[],
const(char)[]) ()
No symbol table info available.

std.functional.memoize!(std.regex.regexImpl!(immutable(char)[]).regexImp
(immutable(char)[], const(char)[]), 8).memoize(immutable(char)[],
const(char)[]) ()
No symbol table info available.

std.regex.regex!(immutable(char)[]).regex(immutable(char)[][], 
const(char)[]) ()
No symbol table info available.

std.regex.regex!(immutable(char)[]).regex(immutable(char)[], 
const(char)[]) ()
No symbol table info available.

std.net.curl.HTTP.Impl.onReceiveHeader(void(const(char[]), 
const(char[])) delegate).__lambda2(const(char[])) ()
No symbol table info available.

std.net.curl.Curl.onReceiveHeader(void(const(char[])) 
delegate).__lambda2(const(char[])) ()
No symbol table info available.

std.net.curl.Curl._receiveHeaderCallback(const(char*), ulong, 
ulong, void*) ()
No symbol table info available.

No symbol table info available.

No symbol table info available.

No symbol table info available.

No symbol table info available.
---Type <return> to continue, or q <return> to quit---

/usr/local/lib/libcurl.so
No symbol table info available.

/usr/local/lib/libcurl.so
No symbol table info available.

std.net.curl.Curl.perform(std.typecons.Flag!("throwOnError").Flag) ()
No symbol table info available.

std.net.curl.HTTP.perform(std.typecons.Flag!("throwOnError").Flag) ()
No symbol table info available.

provider.SunHotels.getHotels(destination.Destination) 
(this=0x80097e000, destination=...) at source/provider.d:226
         __closptr = 0x800980800
         filePath = 
"/usr/home/search-master/search-api/ext/data/hotels/6593.xml"
         __dollar = 7
         hotelsPath = "http://some-domain.com"
         data = {ptr = 0x80097f240}
         http = {p = {_refCounted = {_store = 0x805a14000}}}
         postData = "some=postData"
         __flag = 2
         __EAX = 0x8002901170
         __exception_object = 0x0
         __EAX = 0x8002901170
         __EDX = -851895465
         __handler = 0
         __exception_object = 0x801f12540

app.getDestinations().__foreachbody1(ref destination.Destination) 
(this=0x7fffffffe850, __applyArg0=...) at source/app.d:164
         destination = {destinationId = 6593, destinationCode = 
"GRR", destinationCode_1 = 0x0, destinationCode_2 = 0x0, 
destinationCode_3 = 0x0,
           destinationCode_4 = 0x0, destinationName = "Cedar 
(MI)", countryId = 43, countryName = "USA", countryCode = "US", 
timeZone = "-05:00"}

std.parallelism.ParallelForeach!(destination.Destination[]).ParallelF
reach.opApply(scope int(ref destination.Destination) delegate).doIt()
(this=0x7fffffffe7d0) at
/home/search-master/dmd2/freebsd/bin64/../../src/phobos/std/parallelism.d-mixin-3824:3870
         myUnitIndex = 5
         start = 2130
         end = 2556
         __key3499 = 2306
         __limit3500 = 2556
         i = 2306
         __EAX = 0x8002901170
         __EDX = -851895465
         __handler = 0
         __exception_object = 0x802016500

delegate).run(void() delegate) ()
---Type <return> to continue, or q <return> to quit---
No symbol table info available.

std.parallelism.Task!(std.parallelism.run, void() 
delegate).Task.impl(void*) ()
No symbol table info available.

No symbol table info available.

std.parallelism.TaskPool.doJob(std.parallelism.AbstractTask*) ()
No symbol table info available.

std.parallelism.TaskPool.executeWorkLoop() ()
No symbol table info available.

std.parallelism.TaskPool.startWorkLoop() ()
No symbol table info available.

No symbol table info available.

No symbol table info available.

No symbol table info available.

No symbol table info available.
Backtrace stopped: Cannot access memory at address 0x7fffdfffe000
Sep 23 2017
parent reply Nicholas Wilson <iamthewilsonator hotmail.com> writes:
On Saturday, 23 September 2017 at 08:45:00 UTC, Mengu wrote:
 hello everyone

 i have a small program that parses an xml file, holding a list 
 with 13610 elements. after making the list, it iterates over 
 the list (paralele), goes to a web site and grabs the related 
 data for that element.

 it works perfect for the first 1K element in the list. after 
 that i get a very annoying segmentation fault. no exceptions, 
 nothing. it just dumps a core file. below is the full stack 
 trace. (also available at https://pastebin.com/PT1R5D7S)

 i appreciate any help.

 my dmd info:
 DMD64 D Compiler v2.076.0-dirty
 Copyright (c) 1999-2017 by Digital Mars written by Walter Bright

 my os info:

 r321309: Fri Jul 21 02:08:28 UTC 2017     
 root releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64



 (gdb) bt full
 [...]
So it fails: trying to find if an element exists in an AA in a regex invoked as a callback from curl inside a parallel foreach. Interesting that it just straight up core dumps, usually you'll get an exception. see https://forum.dlang.org/thread/rrpmgzqqtkqgeicjdgps forum.dlang.org for a recent discussion. What it the stack limit? 35 frames is a fair bit, could be a stack overflow. What is the return code? this will probably give you some info as to what happened. Only other thing I can suggest is try linking against a debug phobos to see if you can get some more diagnostics.
Sep 23 2017
next sibling parent Nicholas Wilson <iamthewilsonator hotmail.com> writes:
On Saturday, 23 September 2017 at 11:23:26 UTC, Nicholas Wilson 
wrote:
 Only other thing I can suggest is try linking against a debug 
 phobos to see if you can get some more diagnostics.
You might also try LDC's -fsanitize=address option for catching memory bugs.
Sep 23 2017
prev sibling parent Mengu <mengukagan gmail.com> writes:
On Saturday, 23 September 2017 at 11:23:26 UTC, Nicholas Wilson 
wrote:
 On Saturday, 23 September 2017 at 08:45:00 UTC, Mengu wrote:
 [...]
So it fails: trying to find if an element exists in an AA in a regex invoked as a callback from curl inside a parallel foreach. Interesting that it just straight up core dumps, usually you'll get an exception. see https://forum.dlang.org/thread/rrpmgzqqtkqgeicjdgps forum.dlang.org for a recent discussion. What it the stack limit? 35 frames is a fair bit, could be a stack overflow. What is the return code? this will probably give you some info as to what happened. Only other thing I can suggest is try linking against a debug phobos to see if you can get some more diagnostics.
hi nicholas the latter is what i did. i re-compiled phobos master and used it. this time everything worked as expected. btw, regex match happens in HTTP.Impl.onReceiveHeader. i think it no longer had access to that header to parse.
Sep 23 2017