Author Topic: Anomaly 'stepping into' srand() function  (Read 3422 times)

Offline David Danforth

  • Single posting newcomer
  • *
  • Posts: 3
Anomaly 'stepping into' srand() function
« on: March 04, 2015, 10:25:44 pm »
Hello:
I am using Code:Blocks svn 10122 in Xubuntu 14.04 LTS.

I have a file which has been given to me in order to demonstrate certain functions. (I am a student.)

Running this file in the debugger produces an anomaly around the srand() function that I think may be of concern to developers.  That is why I am posting to this forum.

When the debugger is run using the "start/continue" red arrow,  the .cpp file (called boolModule.cpp) compiles and runs.  However, when I try to step through (using the 'step into' arrow) the debugger hangs at the srand() function. (This is line 30 in boolModule.cpp. boolModule.cpp is attached to this posting.)  The error reads "Cannot open file: random.c".  Continued pushing of the 'step into' arrow changes this error to: "Cannot open file: random_r.c".  I attach a screen shot of the Call Stack window.

To add to the concern, when I run the debugger on boolModule.cpp in Code:Blocks in Windows 7, there are no problems.

Again, to recap:

1. in xubuntu: run debugger, program compiles and runs
2. in xubuntu: step into, program stalls at srand() function.
3. in windows:  no problem evident.

I hope this posting is placed as it is supposed to be.  As I said, I'm a student.  But I've spent some time trying to determine how I could induce this anomalous behavior, and I haven't been able to do so.  Hence, the posting.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Anomaly 'stepping into' srand() function
« Reply #1 on: March 04, 2015, 10:38:29 pm »
1. This is the wrong sub-forum, this one is for talks about improvements to cb, not general development questions, next time please use one of the user sub forums
2. I see no bug here. C::B works as expected. You've somehow installed debug symbols for glibc. Thus you're able to see detailed backtraces. And also be able to step into them. Unfortunately the source files have not been installed and so cb cannot open them.
3. Are you sure you want to use step-into and not next-line command?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline David Danforth

  • Single posting newcomer
  • *
  • Posts: 3
Re: Anomaly 'stepping into' srand() function
« Reply #2 on: March 05, 2015, 12:00:00 am »
Thanks for your kind reply.

Further to your comment regarding glibc, I uninstalled gdb... and discovered the Code::Blocks debugger won't work without it.

So I re-installed it, and the problem I was experiencing was gone.

Who knows?  But what I saw happening may have been some glibc glitch that corrected itself when I 'cycled' the installation

Thanks again.