pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: rustc panic



On Wed, Jul 26, 2017 at 10:48:18PM +0000, Chavdar Ivanov wrote:
> There is no invocation of pthread_set_guardsize in rustc, so it should be
> getting the default from the sysctl, i.e. 65536, but for some reason it is
> getting a zero. I maybe missing something obvious, I couldn't see it by
> reading only.

I verified that pthread__init() is run before any of this happens.
BUT: it is run again some time later (which I think is not expected).

The guardsize is fetched from the thread structure of the second (or third?)
thread started by rustc, and this somehow has a guard size of zero. The
global pthread__guardsize value is fine (comes from the sysctl and is
initialized at this time).

So somehow thread creation/startup makes later threads get guardsize 0 in
rust, but it does not seem to happen in C programs.

Slightly difficult to trace, I'm open to suggestions where to put printfs ;-)

Joerg: should pthread__init() protect itself against duplicate calls?
Guess I'll need to test with a debug ld.elf_so to see if that runs ctors
twice.

Martin


Home | Main Index | Thread Index | Old Index