View mode: basic / threaded / horizontal-split · Log in · Help
May 20, 2012
druntime investigation troubles
Looks like `_STI_monitor_staticctor` is called by C runtime on Windows. 
And C runtime isn't open-source.

It creates troubles for investigation druntime (for me at least). Why is 
it so? Why not to call everything in C `main`, what's the reason?

If there is no list of stuff done before C `main` druntime isn't 
open-source for me because I can't understand what is taking place just 
with druntime sources.

-- 
Денис В. Шеломовский
Denis V. Shelomovskij
May 20, 2012
Re: druntime investigation troubles
On 20-05-2012 10:41, Denis Shelomovskij wrote:
> Looks like `_STI_monitor_staticctor` is called by C runtime on Windows.
> And C runtime isn't open-source.
>
> It creates troubles for investigation druntime (for me at least). Why is
> it so? Why not to call everything in C `main`, what's the reason?
>
> If there is no list of stuff done before C `main` druntime isn't
> open-source for me because I can't understand what is taking place just
> with druntime sources.
>

Huh? It's perfectly open source. Read src/rt/monitor.c.

-- 
Alex Rønne Petersen
alex@lycus.org
http://lycus.org
May 20, 2012
Re: druntime investigation troubles
On 20-05-2012 18:20, Alex Rønne Petersen wrote:
> On 20-05-2012 10:41, Denis Shelomovskij wrote:
>> Looks like `_STI_monitor_staticctor` is called by C runtime on Windows.
>> And C runtime isn't open-source.
>>
>> It creates troubles for investigation druntime (for me at least). Why is
>> it so? Why not to call everything in C `main`, what's the reason?
>>
>> If there is no list of stuff done before C `main` druntime isn't
>> open-source for me because I can't understand what is taking place just
>> with druntime sources.
>>
>
> Huh? It's perfectly open source. Read src/rt/monitor.c.
>

Seems like I misunderstood what you were saying. Right, the C runtime on 
*Windows* is closed source. But, I don't know why you think that 
function is called by the C runtime; see src/rt/dmain2.d.

-- 
Alex Rønne Petersen
alex@lycus.org
http://lycus.org
May 20, 2012
Re: druntime investigation troubles
On 2012-05-20 18:25, Alex Rønne Petersen wrote:

> Seems like I misunderstood what you were saying. Right, the C runtime on
> *Windows* is closed source. But, I don't know why you think that
> function is called by the C runtime; see src/rt/dmain2.d.

Have a look again. It's only called on Posix:

https://github.com/D-Programming-Language/druntime/blob/7d663821d39cfe8874cb95b0df46b5065a770cef/src/rt/dmain2.d#L364

-- 
/Jacob Carlborg
May 20, 2012
Re: druntime investigation troubles
On 20-05-2012 22:13, Jacob Carlborg wrote:
> On 2012-05-20 18:25, Alex Rønne Petersen wrote:
>
>> Seems like I misunderstood what you were saying. Right, the C runtime on
>> *Windows* is closed source. But, I don't know why you think that
>> function is called by the C runtime; see src/rt/dmain2.d.
>
> Have a look again. It's only called on Posix:
>
> https://github.com/D-Programming-Language/druntime/blob/7d663821d39cfe8874cb95b0df46b5065a770cef/src/rt/dmain2.d#L364
>
>

I stand corrected. I had no idea about the magic involved here!

The proprietary Windows tool chain is seriously problematic...

-- 
Alex Rønne Petersen
alex@lycus.org
http://lycus.org
May 22, 2012
Re: druntime investigation troubles
21.05.2012 2:13, Alex Rønne Petersen написал:
> On 20-05-2012 22:13, Jacob Carlborg wrote:
>> On 2012-05-20 18:25, Alex Rønne Petersen wrote:
>>
>>> Seems like I misunderstood what you were saying. Right, the C runtime on
>>> *Windows* is closed source. But, I don't know why you think that
>>> function is called by the C runtime; see src/rt/dmain2.d.
>>
>> Have a look again. It's only called on Posix:
>>
>> https://github.com/D-Programming-Language/druntime/blob/7d663821d39cfe8874cb95b0df46b5065a770cef/src/rt/dmain2.d#L364
>>
>>
>>
>
> I stand corrected. I had no idea about the magic involved here!
>
> The proprietary Windows tool chain is seriously problematic...
>

So can anybody do something with it? At least document a bit what does 
proprietary part do.

-- 
Денис В. Шеломовский
Denis V. Shelomovskij
May 22, 2012
Re: druntime investigation troubles
On Tue, 22 May 2012 15:16:30 -0400, Denis Shelomovskij  
<verylonglogin.reg@gmail.com> wrote:

> 21.05.2012 2:13, Alex Rønne Petersen написал:
>> On 20-05-2012 22:13, Jacob Carlborg wrote:
>>> On 2012-05-20 18:25, Alex Rønne Petersen wrote:
>>>
>>>> Seems like I misunderstood what you were saying. Right, the C runtime  
>>>> on
>>>> *Windows* is closed source. But, I don't know why you think that
>>>> function is called by the C runtime; see src/rt/dmain2.d.
>>>
>>> Have a look again. It's only called on Posix:
>>>
>>> https://github.com/D-Programming-Language/druntime/blob/7d663821d39cfe8874cb95b0df46b5065a770cef/src/rt/dmain2.d#L364
>>>
>>>
>>>
>>
>> I stand corrected. I had no idea about the magic involved here!
>>
>> The proprietary Windows tool chain is seriously problematic...
>>
>
> So can anybody do something with it? At least document a bit what does  
> proprietary part do.
>

It looks like code that is not called on Windows.  Which doesn't make  
sense.  It would seem that you must initialize a critical section in order  
to use it.

I can't find any reference to STI_monitor in dmd, dmc, or druntime source  
code, except those calls that are done for Posix only.  This isn't some  
closed-source mystery, I think it is just unused code.

Sean, does this make sense?  Are we using uninitialized critical sections?

-Steve
May 23, 2012
Re: druntime investigation troubles
On 2012-05-22 23:01, Steven Schveighoffer wrote:

> It looks like code that is not called on Windows. Which doesn't make
> sense. It would seem that you must initialize a critical section in
> order to use it.
>
> I can't find any reference to STI_monitor in dmd, dmc, or druntime
> source code, except those calls that are done for Posix only. This isn't
> some closed-source mystery, I think it is just unused code.
>
> Sean, does this make sense? Are we using uninitialized critical sections?
>
> -Steve

"_STI_critical_init" is defined both in critical.c and critical_.d, but 
I can't find a place where it's called on Windows.

-- 
/Jacob Carlborg
May 23, 2012
Re: druntime investigation troubles
On 2012-05-22 23:01, Steven Schveighoffer wrote:

> It looks like code that is not called on Windows. Which doesn't make
> sense. It would seem that you must initialize a critical section in
> order to use it.
>
> I can't find any reference to STI_monitor in dmd, dmc, or druntime
> source code, except those calls that are done for Posix only. This isn't
> some closed-source mystery, I think it is just unused code.
>
> Sean, does this make sense? Are we using uninitialized critical sections?
>
> -Steve

I found a call now, it's in "_d_criticalenter", both in critical.c and 
critical_.d.

-- 
/Jacob Carlborg
May 23, 2012
Re: druntime investigation troubles
On Wed, 23 May 2012 02:21:14 -0400, Jacob Carlborg <doob@me.com> wrote:

> On 2012-05-22 23:01, Steven Schveighoffer wrote:
>
>> It looks like code that is not called on Windows. Which doesn't make
>> sense. It would seem that you must initialize a critical section in
>> order to use it.
>>
>> I can't find any reference to STI_monitor in dmd, dmc, or druntime
>> source code, except those calls that are done for Posix only. This isn't
>> some closed-source mystery, I think it is just unused code.
>>
>> Sean, does this make sense? Are we using uninitialized critical  
>> sections?
>>
>> -Steve
>
> I found a call now, it's in "_d_criticalenter", both in critical.c and  
> critical_.d.
>

OK, so does this mean monitor is only used on Posix, and critical is used  
only on windows?  This seems a little weird.  Especially since we are  
still compiling monitor.c.

-Steve
« First   ‹ Prev
1 2 3
Top | Discussion index | About this forum | D home