ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to run Phantasia4 under Slackware. It compiled fine, but when I try to run it, it crashes.
Running under gdb, it seems to crash in /lib/libc.so.6 in the function initstate_r() which is not part of the source. Anyone know why it's crashing? I don't know where else to ask.
In the source, this is the line that calls initstate_r:
Code:
/* seed the random number generator */
initstate_r (time(NULL), (char *)&randomStateBuffer, STATELEN,
(struct random_data *)&randData);
How do you know it's bug in glibc ?! With which error/signal it crashes ? It may be a bug in mentioned application. Slackware's glibc is built with only a few patches just fixing known bugs. I even tried to create a small app using initstate glibc function and it worked without problems. Maybe Phantasia calls it with wrong parameters f.E. with uninitialized pointer or improper field size. You didn't gave enough informations to determine the source of the problem.
Well considering it tells me nothing when it crashes in initstate_r (I can't even list in gdb when in the function), it doesn't seem normal. Also it works fine on RedHat.
The signal is SIGSEGV.
How do I find out what the parameters are? There is no man for initstate_r.
Last edited by Zeno McDohl; 01-29-2006 at 01:33 PM.
initstate_r is just a reentrant version of initstate.
SIGSEGV is raised by invalid memory reference.
Just for curiosity, what glibc version are you running on ? Quick search on google revealed some older versions of glibc may contained bug in this function.
I've make a short test and although my initstate_r has passed I can confirm phantasia server crashes with segment violation. I've no spare time now to do a deeper research but if it's no problem for you, upgrade your box to Slackware-current and it should work (glibc 2.3.6, gcc 3.4.5) - atleast it worked for me.
Well I replaced all the _r functions (srandom_r, etc) with the normal version (srandom etc) and I got it running. If anyone could still tell me why it was crashing in the _r versions, that'd be great.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.