lua-users home
lua-l archive

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



It reproduces steadily.

I'm begining to wonder if something special needs to be done in FreeBSD to create a multithreaded program, maybe in the phase when Lua itself is compiled.

man pages have this to say:

" recursive call A process has attempted to call an allocation function recursively. This is not permitted. In particular, signal handlers
     should not attempt to allocate memory."

It does not say about multithreaded programs, maybe the particular malloc is _not_ multithreading capable? My Lanes module links with - lpthread, but Lua itself does not.

-asko



Gerhard Sittig kirjoitti 19.5.2007 kello 14:34:

On Sat, May 19, 2007 at 01:48 +0300, Asko Kauppi wrote:

Testing Lua Lanes on FreeBSD gives the above error.  Does anyone have
an idea what might be the cause?

$ uname -a
FreeBSD td152.testdrive.hp.com 6.2-RELEASE FreeBSD 6.2-RELEASE #0:
Fri Jan 12 11:05:30 UTC 2007     root@dessler.cse.buffalo.edu:/usr/
obj/usr/src/sys/SMP  i386

Can you reproduce it?

The PHK implementation of the memory allocator has a very nice feature:
Have a look at the malloc(3) manpage, search for "malloc.conf".  This
"file" is a symlink and its content lists options to tune malloc()'s
behaviour. Alternatively -- or to influence an individual process only
-- you could set the MALLOC_CONF environment variable.  A third option
is to change the program's source and adjust a global _malloc_options
variable in the process.

All of the above methods allow you to instruct malloc(3) to not just
issue the message, but to abort() the process and generate a core dump
so you can do a post mortem analysis and see what happened.


virtually yours
Gerhard Sittig
--
     If you don't understand or are scared by any of the above
             ask your parents or an adult to help you.