comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Reference counter in smart pointers are not updated properly when used by multiple tasks
Date: Thu, 01 Feb 2018 08:41:05 +0000
Date: 2018-02-01T08:41:05+00:00	[thread overview]
Message-ID: <lypo5pnlum.fsf@pushface.org> (raw)
In-Reply-To: a89d76e4-a2b2-4ad9-8816-f3bfe9686930@googlegroups.com

onox <denkpadje@gmail.com> writes:

> So the smart pointers are not working properly when there are jobs
> (paired with the same smart pointer) being executed by multiple
> workers. I'm not sure if this is a bug in my own code or whether GNAT
> is doing something funky in the Finalize procedure.

I had a look on macOS. Some messing around required with build system/os
choice.

GCC 8.0.0 failed with ICE, tried 7.1.0.

Doesn't support CPU affinity: commented out.

Number of workers 1: OK.

Number of workers 2:

Worker #2 finished -- refs:  2
Worker #2 dequeueing...
Releasing slot...
Releasing slot...
Worker #1 : ORKA.JOBS.JOB : raised PROGRAM_ERROR : adjust/finalize raised SYSTEM.ASSERTIONS.ASSERT_FAILURE: failed precondition from orka-futures-slots.ads:60 instantiated at orka_test-package_9_jobs.ads:20
Load address: 0x108284000
Call stack traceback locations:
0x108295c11 0x1082a1cd0 0x7fff7da586bf 0x7fff7da5856b

Worker #2 : ORKA.JOBS.JOB : raised PROGRAM_ERROR : adjust/finalize raised SYSTEM.ASSERTIONS.ASSERT_FAILURE: failed precondition from orka-futures-slots.ads:60 instantiated at orka_test-package_9_jobs.ads:20
Load address: 0x108284000
Call stack traceback locations:
0x108293228 0x1082946a5 0x1082a1cd0 0x7fff7da586bf 0x7fff7da5856b

     Jobs not done: RUNNING
Releasing slot...

Execution terminated by unhandled exception
raised PROGRAM_ERROR : adjust/finalize raised PROGRAM_ERROR: orka-smart_pointers.adb:64 explicit raise
Load address: 0x108284000
Call stack traceback locations:
0x1082a0f56 0x1082a3dec 0x1082a4cea 0x1082a4aeb 0x1082c1fea 0x7fff7da88fcf 0x7fff7da88ee0 0x108286ac7 0x1082c206a

The tracebacks were no good, need to build with MODE=debug; when I do
this, I see your problem with the references,

Worker #2 dequeueing...
     Jobs done: DONE  3
     Time:  0.009000000
references B (expects >= 1):  2
shutting down...
Worker #1 dequeued  0
Worker #1 terminated
Worker #2 dequeued  0
Worker #2 terminated
shutting down?
references C (expects 1):  2
Queue high (expects 0):  0
Queue normal (expects 0):  0
Slots acquired (expects 1):  1

  parent reply	other threads:[~2018-02-01  8:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01  5:52 Reference counter in smart pointers are not updated properly when used by multiple tasks onox
2018-02-01  8:39 ` Dmitry A. Kazakov
2018-02-01 10:01   ` onox
2018-02-01 10:28     ` onox
2018-02-01 10:51       ` Dmitry A. Kazakov
2018-02-01 10:57     ` Dmitry A. Kazakov
2018-02-01  8:41 ` Simon Wright [this message]
2018-02-01 14:48 ` Jeffrey R. Carter
2018-02-01 19:37   ` onox
2018-02-01 20:12     ` Jeffrey R. Carter
2018-02-02  0:09   ` Randy Brukardt
2018-02-01 19:04 ` Robert A Duff
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox