This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

get/set/swapcontext + linuxthreads/glibc + MTasker


glibc, NPTL people,

I'm working on MTasker (http://ds9a.nl/mtasker) and encountering some
problems.

Is there a fundamental reason why get/set/swapcontext and linuxthreads bite
eachother? Would this be a problem for NPTL?

I'm using C++, g++ 3.2.1, libc 2.2.5 Debian, i386, Linux 2.5.54.

I get a coredump whenever the first call to malloc is made:

#0  0x400299d7 in libc_internal_tsd_get () from /lib/libpthread.so.0
#1  0x4017c00b in malloc () from /lib/libc.so.6
#2  0x400bfb8e in operator new(unsigned) (sz=1500)
    at ../../../../gcc-3.2.1/libstdc++-v3/libsupc++/new_op.cc:48
#3  0x400bfcff in operator new[](unsigned) (sz=0)
    at ../../../../gcc-3.2.1/libstdc++-v3/libsupc++/new_opv.cc:36
#4  0x08076300 in LWRes::LWRes() ()
#5  0x0807ab12 in houseKeeping(void*) ()

This stems from: 
	d_bufsize=1500;
	d_buf=new unsigned char[d_bufsize];

And happens within a swapped context. The problem disappears as soon as
libpthread.so is not linked in. 

It does the same on Debian sid, g++ "3.2.2", libc 2.3.1. 

Any way to resolve this? Would using 'sigaltstack' help resolve this? Would
using NPTL solve this?

Thanks for your attention. I'm not on the libc-alpha list, a CC would be
appreciated!

Regards,

bert

-- 
http://www.PowerDNS.com      Open source, database driven DNS Software 
http://lartc.org           Linux Advanced Routing & Traffic Control HOWTO
http://netherlabs.nl                         Consulting


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]