LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-27-2006, 07:39 PM   #1
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 322

Rep: Reputation: 30
Crash in initstate_r()


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);
But the actual crash is in initstate_r...
 
Old 01-28-2006, 06:53 AM   #2
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 322

Original Poster
Rep: Reputation: 30
Could someone move this to the Slackware section? I believe this is a bug in Slackware, based on searches for initstate_r such as this result:
http://www.mail-archive.com/debian-g.../msg27848.html
 
Old 01-29-2006, 01:20 PM   #3
dunric
Member
 
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498

Rep: Reputation: 100Reputation: 100
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.
 
Old 01-29-2006, 01:29 PM   #4
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 322

Original Poster
Rep: Reputation: 30
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.
 
Old 01-29-2006, 03:22 PM   #5
dunric
Member
 
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498

Rep: Reputation: 100Reputation: 100
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.
 
Old 01-29-2006, 03:46 PM   #6
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 322

Original Poster
Rep: Reputation: 30
I'm using version 2.3.5, and as for initstate it doesn't match the parameters that initstate_r has... (so says the manual)

It must be the version I have is bugged? But I just downloaded Slackware days ago, yet it didn't include a new version of glibc?

Last edited by Zeno McDohl; 01-29-2006 at 03:49 PM.
 
Old 01-29-2006, 05:05 PM   #7
dunric
Member
 
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498

Rep: Reputation: 100Reputation: 100
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.
 
Old 01-30-2006, 06:57 AM   #8
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 322

Original Poster
Rep: Reputation: 30
*nod* I was updating yesterday, but ran into a problem and can't seen to update...
 
Old 01-31-2006, 08:53 PM   #9
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 322

Original Poster
Rep: Reputation: 30
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
First crash! maunded Linux - Newbie 3 10-13-2005 07:33 PM
Crash, Crash, Crash, Crash and You Guessed it Crash! little_penguin SUSE / openSUSE 8 07-04-2005 09:34 AM
X.Org crash........very odd crash..... doctorzoidberg Linux - Software 11 01-07-2005 07:38 PM
kde crash, then other crash, now weird problems true_atlantis Linux - Laptop and Netbook 1 04-28-2004 12:01 AM
xmms crash xine crash mplayer crash paledread Linux - Software 9 03-09-2004 07:09 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration