Please help, my program doesn't work!

Discussion in 'C Programming' started by Mihai Moldovan, Oct 4, 2011.

  1. Hello dear readers,

    My program segfaults when I run it on my server: http://pastie.org/2637933

    Please anyone know the issue?

    You can reach me at

    Thanks!

    ~Ionic/Mihai
     
    Mihai Moldovan, Oct 4, 2011
    #1
    1. Advertising

  2. Mihai Moldovan

    nroberts Guest

    On Oct 4, 8:18 am, Mihai Moldovan <> wrote:
    > Hello dear readers,
    >
    > My program segfaults when I run it on my server:http://pastie.org/2637933
    >
    > Please anyone know the issue?
    >
    > You can reach me at
    >
    > Thanks!
    >
    > ~Ionic/Mihai


    No null terminator in the_actual_truth. This is clearly an issue, and
    I'd guess it's the issue you're having.
     
    nroberts, Oct 4, 2011
    #2
    1. Advertising

  3. Mihai Moldovan

    Angel Guest

    On 2011-10-04, Mihai Moldovan <> wrote:
    > Hello dear readers,
    >
    > My program segfaults when I run it on my server: http://pastie.org/2637933
    >
    > Please anyone know the issue?
    >
    > You can reach me at
    >
    > Thanks!
    >
    > ~Ionic/Mihai


    puts() expects a zero-terminated string. Your array of unsigned char
    is not zero-terminated, so most likely the puts() call will veer outside
    allocated memory while looking for the \0 and thus generate a segfault.

    There are a couple of other issues with your program as well, but I'm
    sure the others here can point them out better than I can.


    --
    "C provides a programmer with more than enough rope to hang himself.
    C++ provides a firing squad, blindfold and last cigarette."
    - seen in comp.lang.c
     
    Angel, Oct 4, 2011
    #3
  4. Mihai Moldovan

    Ike Naar Guest

    On 2011-10-04, nroberts <> wrote:
    > On Oct 4, 8:18?am, Mihai Moldovan <> wrote:
    >> Hello dear readers,
    >>
    >> My program segfaults when I run it on my server:http://pastie.org/2637933
    >>
    >> Please anyone know the issue?
    >>
    >> You can reach me at
    >>
    >> Thanks!
    >>
    >> ~Ionic/Mihai

    >
    > No null terminator in the_actual_truth. This is clearly an issue, and
    > I'd guess it's the issue you're having.


    Whatever the issue is, it's not that.
    the_actual_truth[89] is a null terminator.
     
    Ike Naar, Oct 4, 2011
    #4
  5. Mihai Moldovan

    John Bode Guest

    On Oct 4, 12:00 pm, Ike Naar <> wrote:
    > On 2011-10-04, nroberts <> wrote:
    >
    > > On Oct 4, 8:18?am, Mihai Moldovan <> wrote:
    > >> Hello dear readers,

    >
    > >> My program segfaults when I run it on my server:http://pastie.org/2637933

    >
    > >> Please anyone know the issue?

    >
    > >> You can reach me at

    >
    > >> Thanks!

    >
    > >> ~Ionic/Mihai

    >
    > > No null terminator in the_actual_truth.  This is clearly an issue, and
    > > I'd guess it's the issue you're having.

    >
    > Whatever the issue is, it's not that.
    > the_actual_truth[89] is a null terminator.


    The issue is that it's an epic troll.

    At least if you're familiar with German.
     
    John Bode, Oct 4, 2011
    #5
  6. Mihai Moldovan <> writes:
    > Hello dear readers,
    >
    > My program segfaults when I run it on my server: http://pastie.org/2637933
    >
    > Please anyone know the issue?
    >
    > You can reach me at

    [...]

    I believe someone has forged Mihai Moldovan's name in an effort
    to insult him. The program prints a stupid insult in German.
    It doesn't segfault, and there *is* a null terminator in the
    string being printed. The insulting message is not obvious from
    the source code, presumably to trick readers into compiling and
    running the program.

    Mr. Moldovan: I have no idea what's going on, but if someone this
    stupid hates you, you must be doing something right.

    [Cc'ed to the apparent poster, who is probably the intended target of
    the insult.]

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Oct 4, 2011
    #6
  7. Keith Thompson <> writes:
    > Mihai Moldovan <> writes:
    >> Hello dear readers,
    >>
    >> My program segfaults when I run it on my server: http://pastie.org/2637933
    >>
    >> Please anyone know the issue?
    >>
    >> You can reach me at

    > [...]
    >
    > I believe someone has forged Mihai Moldovan's name in an effort
    > to insult him. The program prints a stupid insult in German.
    > It doesn't segfault, and there *is* a null terminator in the
    > string being printed. The insulting message is not obvious from
    > the source code, presumably to trick readers into compiling and
    > running the program.
    >
    > Mr. Moldovan: I have no idea what's going on, but if someone this
    > stupid hates you, you must be doing something right.
    >
    > [Cc'ed to the apparent poster, who is probably the intended target of
    > the insult.]


    I got an e-mail response from Mihai Moldovan:

    | Hello Keith,
    |
    | thanks for forwarding this, I was not aware of it.
    |
    | You are absolutely right, I did not post to the newsgroup.
    | I suspect one (or for that matter, two) of my fellow students forged it.
    | They know that for once I use pastie.org as my favorite pasting service
    | and second made fun of my habit to include my mail address and telephone
    | number in the copyright notice.
    |
    | Please disregard any more posts, whether alike the one you quoted or
    | not, unless they are digitally signed with my certificate (S-MIME, as
    | you can see in this message).
    |
    | Also, I would like you to forward this message to the newsgroup, if it's
    | not too much trouble.
    |
    | Best regards,
    |
    |
    | Mihai

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Oct 5, 2011
    #7
  8. On Tue, 04 Oct 2011 10:28:35 -0700, John Bode wrote:

    > On Oct 4, 12:00 pm, Ike Naar <> wrote:
    >> On 2011-10-04, nroberts <> wrote:
    >>
    >> > On Oct 4, 8:18?am, Mihai Moldovan <> wrote:
    >> >> Hello dear readers,

    >>
    >> >> My program segfaults when I run it on my
    >> >> server:http://pastie.org/2637933

    >>
    >> >> Please anyone know the issue?

    >>
    >> >> You can reach me at

    >>
    >> >> Thanks!

    >>
    >> >> ~Ionic/Mihai

    >>
    >> > No null terminator in the_actual_truth.  This is clearly an issue,
    >> > and I'd guess it's the issue you're having.

    >>
    >> Whatever the issue is, it's not that. the_actual_truth[89] is a null
    >> terminator.

    >
    > The issue is that it's an epic troll.
    >
    > At least if you're familiar with German.


    The "epic" may be slightly exaggerated. Personally i think it's rather
    pathetic. I've seen better provocations from 4 year olds

    -------------------------------------------------------------------------------
    _______________________________________
    / Psychoanalysis?? I thought this was a \
    \ nude rap session!!! /
    ---------------------------------------
    \
    \
    ___
    {~._.~}
    ( Y )
    ()~*~()
    (_)-(_)
    -------------------------------------------------------------------------------
     
    Kleuskes & Moos, Oct 5, 2011
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. KK
    Replies:
    2
    Views:
    622
    Big Brian
    Oct 14, 2003
  2. pjar09
    Replies:
    0
    Views:
    773
    pjar09
    Aug 11, 2010
  3. KathyB
    Replies:
    3
    Views:
    99
    George M Jempty
    Sep 10, 2003
  4. Replies:
    2
    Views:
    126
  5. RC
    Replies:
    5
    Views:
    254
    Laurent Bugnion
    Oct 4, 2006
Loading...

Share This Page