Thread overview | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
February 18, 2015 GC deadlocks on linux | ||||
---|---|---|---|---|
| ||||
I have a medium size daemon application that uses several threads, libasync, and daemonize. On windows it runs correctly with GC enabled, but on linux the GC causes a deadlock while allocating memory. Adding core.memory.GC.disable; to main causes the application to work correctly (and quickly till it runs out of memory :D ) I am running in a vagrant VM for test, but this should not be the issue. I am developing this for a future product so I wont have control over the environment that it runs in. I am not sure how to debug or work around this issue. My boss is a little concerned that I am using D but does think its cool. I really want to make this stable and get D in to one of our products, if not I will have to switch to C++ or even worse JAVA! Any help would be appreciated. -Byron System: DMD 2.066.1 Linux vagrant-ubuntu-precise-64 3.2.0-76-virtual #111-Ubuntu SMP Tue Jan 13 22:3 3:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux DISTRIB_ID=Ubuntu DISTRIB_RELEASE=12.04 DISTRIB_CODENAME=precise DISTRIB_DESCRIPTION="Ubuntu 12.04.5 LTS" NAME="Ubuntu" VERSION="12.04.5 LTS, Precise Pangolin" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu precise (12.04.5 LTS)" VERSION_ID="12.04" |
February 18, 2015 Re: GC deadlocks on linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Byron Heads Attachments: | On Wed, 18 Feb 2015 20:27:07 +0000, Byron Heads wrote: are you forking? ;-) |
February 18, 2015 Re: GC deadlocks on linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to ketmar | On Wednesday, 18 February 2015 at 20:33:40 UTC, ketmar wrote: > On Wed, 18 Feb 2015 20:27:07 +0000, Byron Heads wrote: > > are you forking? ;-) I am in the daemonize library https://github.com/NCrashed/daemonize |
February 18, 2015 Re: GC deadlocks on linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Byron Heads | Any chance you are using gdm-3.12.x? I was so mad when I have encountered this: https://issues.dlang.org/show_bug.cgi?id=4890 |
February 18, 2015 Re: GC deadlocks on linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On Wednesday, 18 February 2015 at 20:41:12 UTC, Dicebot wrote:
> Any chance you are using gdm-3.12.x?
>
> I was so mad when I have encountered this:
> https://issues.dlang.org/show_bug.cgi?id=4890
Dont think so
$dpkg --get-selections | grep gdm doesn't return anything
also running via ssh
|
February 18, 2015 Re: GC deadlocks on linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Byron Heads Attachments: | On Wed, 18 Feb 2015 20:35:44 +0000, Byron Heads wrote:
> On Wednesday, 18 February 2015 at 20:33:40 UTC, ketmar wrote:
>> On Wed, 18 Feb 2015 20:27:07 +0000, Byron Heads wrote:
>>
>> are you forking? ;-)
>
>
> I am in the daemonize library
>
> https://github.com/NCrashed/daemonize
can you drop that and just let the program run on foreground? i suspect that it may solve your problem. you can detach your program with "setsid" and "&" to avoid forking.
`fork()` is a very fragile thing, and it may be the source of heisenbugs. stop `fork()`ing may be the easiest solution (if it solves something, of course ;-).
|
February 18, 2015 Re: GC deadlocks on linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Byron Heads Attachments: | On Wed, 18 Feb 2015 20:35:44 +0000, Byron Heads wrote:
> On Wednesday, 18 February 2015 at 20:33:40 UTC, ketmar wrote:
>> On Wed, 18 Feb 2015 20:27:07 +0000, Byron Heads wrote:
>>
>> are you forking? ;-)
>
>
> I am in the daemonize library
>
> https://github.com/NCrashed/daemonize
p.s. and check if you don't disable signals. druntime uses SIGUSR1 to communicate with threads (even if you aren't using more that one thread in your code). it doesn't on windows though (there are no signals there ;- ), but your posix code can accidentally block/intercept the signals druntime uses for internal bookkeeping.
|
February 18, 2015 Re: GC deadlocks on linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to ketmar | On Wednesday, 18 February 2015 at 20:55:56 UTC, ketmar wrote:
> On Wed, 18 Feb 2015 20:35:44 +0000, Byron Heads wrote:
>
>> On Wednesday, 18 February 2015 at 20:33:40 UTC, ketmar wrote:
>>> On Wed, 18 Feb 2015 20:27:07 +0000, Byron Heads wrote:
>>>
>>> are you forking? ;-)
>>
>>
>> I am in the daemonize library
>>
>> https://github.com/NCrashed/daemonize
>
> can you drop that and just let the program run on foreground? i suspect
> that it may solve your problem. you can detach your program with "setsid"
> and "&" to avoid forking.
>
> `fork()` is a very fragile thing, and it may be the source of heisenbugs.
> stop `fork()`ing may be the easiest solution (if it solves something, of
> course ;-).
By passing daemonize with the GC enabled is working.. going to dig into the signals and see if thats it.
|
February 18, 2015 Re: GC deadlocks on linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Byron Heads | On Wednesday, 18 February 2015 at 21:05:10 UTC, Byron Heads wrote:
> On Wednesday, 18 February 2015 at 20:55:56 UTC, ketmar wrote:
>> On Wed, 18 Feb 2015 20:35:44 +0000, Byron Heads wrote:
>>
>>> On Wednesday, 18 February 2015 at 20:33:40 UTC, ketmar wrote:
>>>> On Wed, 18 Feb 2015 20:27:07 +0000, Byron Heads wrote:
>>>>
>>>> are you forking? ;-)
>>>
>>>
>>> I am in the daemonize library
>>>
>>> https://github.com/NCrashed/daemonize
>>
>> can you drop that and just let the program run on foreground? i suspect
>> that it may solve your problem. you can detach your program with "setsid"
>> and "&" to avoid forking.
>>
>> `fork()` is a very fragile thing, and it may be the source of heisenbugs.
>> stop `fork()`ing may be the easiest solution (if it solves something, of
>> course ;-).
>
> By passing daemonize with the GC enabled is working.. going to dig into the signals and see if thats it.
My guess is this is going to be related to forking, going to see if I can make a test case.
|
February 18, 2015 Re: GC deadlocks on linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Byron Heads | On Wednesday, 18 February 2015 at 21:21:11 UTC, Byron Heads wrote: > On Wednesday, 18 February 2015 at 21:05:10 UTC, Byron Heads wrote: >> On Wednesday, 18 February 2015 at 20:55:56 UTC, ketmar wrote: >>> On Wed, 18 Feb 2015 20:35:44 +0000, Byron Heads wrote: >>> >>>> On Wednesday, 18 February 2015 at 20:33:40 UTC, ketmar wrote: >>>>> On Wed, 18 Feb 2015 20:27:07 +0000, Byron Heads wrote: >>>>> >>>>> are you forking? ;-) >>>> >>>> >>>> I am in the daemonize library >>>> >>>> https://github.com/NCrashed/daemonize >>> >>> can you drop that and just let the program run on foreground? i suspect >>> that it may solve your problem. you can detach your program with "setsid" >>> and "&" to avoid forking. >>> >>> `fork()` is a very fragile thing, and it may be the source of heisenbugs. >>> stop `fork()`ing may be the easiest solution (if it solves something, of >>> course ;-). >> >> By passing daemonize with the GC enabled is working.. going to dig into the signals and see if thats it. > > > > My guess is this is going to be related to forking, going to see if I can make a test case. Might be related: https://issues.dlang.org/show_bug.cgi?id=6846 |
Copyright © 1999-2021 by the D Language Foundation