Search:

Type: Posts; User: pfs

Search: Search took 0.01 seconds.

  1. Thread: Stack behaviour

    by pfs
    Replies
    12
    Views
    2,287

    The thing is that this_list[2] it isn't even...

    The thing is that
    this_list[2] it isn't even being used inside of
    int my_function2(int pc, char **plist);.

    That's one of the reasons I can't understand why it is crashing.
  2. Thread: Stack behaviour

    by pfs
    Replies
    12
    Views
    2,287

    Hi again. I've doing some research about stack...

    Hi again.

    I've doing some research about stack corruption and I found this tool called splint, it seems pretty cool (although I haven't use it yet) and I found this in their manual which lead me...
  3. Thread: Stack behaviour

    by pfs
    Replies
    12
    Views
    2,287

    My assumption is obviously wrong then. That...

    My assumption is obviously wrong then.

    That assumption came with the fact that I had a bug which I fixed declaring the variable static. If I didn't declare it that way it would crash and the gdb...
  4. Thread: Stack behaviour

    by pfs
    Replies
    12
    Views
    2,287

    Thanks for the quick response. But I thought I...

    Thanks for the quick response.

    But I thought I couldn't pass local variables of one function to another and different one.

    What am I thinking wrong here? :-P
  5. Thread: Stack behaviour

    by pfs
    Replies
    12
    Views
    2,287

    Stack behaviour

    Hello all.

    I've been programming for an application and unfortunately, I've found a bug while the application was in production.

    The bug was a stack corruption bug.

    Anyways, it seems that...
  6. Thread: Running processes

    by pfs
    Replies
    6
    Views
    1,898

    Running processes

    Is there a function which could tell me the number of running processes?

    Thank you. :D
  7. Thread: Pointer issue

    by pfs
    Replies
    2
    Views
    1,290

    Pointer issue

    Hello guys,

    Am I missing anything here?



    struct whatever
    {
    char data[100];
    };
  8. Thread: Strangeness

    by pfs
    Replies
    16
    Views
    2,393

    Problem solved.

    What I meant was that their behaviour can be random.

    I was able to track down the bugger and squished it right.

    The code that triggered this behaviour was something like this (example):



    ...
  9. Thread: Strangeness

    by pfs
    Replies
    16
    Views
    2,393

    I was able to track down the nasty bug and do a...

    I was able to track down the nasty bug and do a nice squishing sound. :D

    This problem wasn't related to strncpy_irc() or ircsprintf(), its seems that memory leaks can be pretty much random. I...
  10. Thread: Strangeness

    by pfs
    Replies
    16
    Views
    2,393

    So, I guess, doing char* strncpy_irc(char*...

    So, I guess, doing



    char* strncpy_irc(char* s1, const char* s2, size_t n)
    {
    char* endp = s1 + n;
    char* s = s1;
    while (s < endp && (*s++ = *s2++))
    ;
  11. Thread: Strangeness

    by pfs
    Replies
    16
    Views
    2,393

    The functions aren't mine and can be found here...

    The functions aren't mine and can be found here (line 58) and
    here (the whole file).
  12. Thread: Strangeness

    by pfs
    Replies
    16
    Views
    2,393

    Even if the behavior is random? Why does it...

    Even if the behavior is random?

    Why does it assume that behavior?
  13. Thread: Strangeness

    by pfs
    Replies
    16
    Views
    2,393

    Yes, I'm sorry, my bad. So, I have a home-made...

    Yes, I'm sorry, my bad.

    So, I have a home-made strncpy() and sprintf().

    Could these be the source of the problem?

    The strange thing about this is that it triggers this behavior randomly and...
  14. Thread: Strangeness

    by pfs
    Replies
    16
    Views
    2,393

    Strangeness

    Hello guys,

    I have the following buffer:


    char buf[63];

    And sometimes the data is perfectly copied into the buffer and others it gets perfectly copied at some point and them it shows up...
Results 1 to 14 of 14