开发者

What is strtol_l_internal?

I'm getting this in my program, C++

Program received signal SIGS开发者_Go百科EGV, Segmentation Fault. 0xb7d62153 in __strtol_l_internal () from /lib/libc.so.6

I got that by using GDB. CC compiled it fine along with G++

    sockf = openSocket(domainname, portc);
    if(sockf > 0){
        log("ZONTRECK","COMPLETED SOCKET!");
        int newsockfd;
        newsockfd = openListen(sockf,portc);
        log("ZONTRECK","Starting console!");


It's an internal function within libc, related to strtol() -- if I had to hazard a guess, I'd say you're trying to read in a number, and something is blowing up.


Use the backtrace command in gdb to see how the program got to that point from your code - that will help find what parameter is being passed that's causing the problem (probably a NULL or otherwise invalid pointer).


Maby you are trying here to read memory corrupted by some code ran before this. If this is the case than the best way is to debug it by Valgrind.


I had to edit a file i didn't post on this site. Its my file that contains openSocket,openListen.

The atoi function requires const char, not char.

I was passing a char to it instead of a const char.

I fixed this issue by changing the char in int main() to const char.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜