lua-users home
lua-l archive

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


On 4/30/2012 8:52 AM, Dimiter 'malkia' Stanev wrote:
On 4/29/12 11:06 AM, KHMan wrote:
On 4/30/2012 1:22 AM, Peng Zhicheng wrote:
于 2012-4-29 22:59, Shmuel Zeigerman 写道:
On 29/04/2012 08:04, Peng Zhicheng wrote:
[snip snip]

I did some further experiments. I set a break point at `TlsAlloc',
and my debugger stopped just a few times there, but all before the
EntryPoint of lua.exe is reached.
which means all are called by the system loader before even the
program is completely loaded.

And then after the program started running from its entry point,
the function TlsAlloc was never called again.
and finally the program exit normally. that means, the program did
not allocate any TLS slots at all!
so there couldn't be such problem as `not freed TLS index'. so I
suppose this might be a OS specific problem.

I think there is a hint in mingw-runtime (I'm looking at
mingw-runtime-3.7). See the mthr* files. Some TLS memory is
allocated
for C++ EH, and if it's not cleaned up, they may leak.

Beyond that, I'm totally clueless about the technical details.

That sounds like it, but other things that have leaked on certain
computers and not others (I'm in tools group in gamedev company)
were for example wacom drivers, leaking stuff (not tls, but
another reference counted resource) from the AFX/ATL lib (can't
remmember what).  [snip]

Anyway, I hope this glitch can be resolved in some way for MinGW gcc users; if it's the MinGW runtime, it may be a corner case or something.

IIRC, the 4.5.x and later series of MinGW gcc dropped the requirement of needing mingwm10.dll for multi-thread binaries. From newer mingwrt-3.20-mingw32, the new TLS handling code is in tls*. These may be relevant:

2011-08-19  Chris Sutcliffe
	* tlssup.c: Remove mingwm10.dll fallback.
2010-01-25  Kai Tietz
	Implement TLS Callback.

Maybe someone should ask Kai Tietz...

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia