Q: SIGSEGV... What's wrong?

Q: SIGSEGV... What's wrong?

Post by Sergey S. Lys » Mon, 22 Jul 1996 04:00:00



Hello,

 i've got a strange problem... Some time ago i wrote a program. It works
fine on my home computer running (linux 1.2.13 + gcc 2.5.8 + libc 4.5.26).
But it fails with SIGSEGV when i'm trying to run it in my office computer
(linux 1.2.13 + gcc 2.6.3 + 4.6.27 ). It fails on malloc()...

 Is it bug in my brains (program) or....????

--
 Sergey S. Lysov

--

System Administrator

GoldNet Information System ====================================

 
 
 

Q: SIGSEGV... What's wrong?

Post by Philippe Troi » Mon, 22 Jul 1996 04:00:00


    Sergey> Hello, i've got a strange problem... Some time ago i wrote
    Sergey>  a program. It works fine on my home computer running
    Sergey>  (linux 1.2.13 + gcc 2.5.8 + libc 4.5.26).  But it fails
    Sergey>  with SIGSEGV when i'm trying to run it in my office
    Sergey>  computer (linux 1.2.13 + gcc 2.6.3 + 4.6.27 ). It fails
    Sergey>  on malloc()...

    Sergey>  Is it bug in my brains (program) or....????

Nope: Welcome to the joys of C programming !

It's just that your heap has become corrupted. At your home, because
of the different compiler/libraries, it worked okay (but something
_is_ wrong anyway), but with other compilers/libraries, it crashes.

At some point you must be writing out a malloced area (just a byte too
much can do this). The problem with these it that is SIGSEGV long
after the causing write.

Have a good debugging. You might be interested by Electric Fence which
is a quite good malloc de* (it will tell you exactly at what
point you corrupt your heap, not after everything's got berserk).

Phil.

 
 
 

Q: SIGSEGV... What's wrong?

Post by Rob Janss » Tue, 23 Jul 1996 04:00:00



Quote:>Hello,
> i've got a strange problem... Some time ago i wrote a program. It works
>fine on my home computer running (linux 1.2.13 + gcc 2.5.8 + libc 4.5.26).
>But it fails with SIGSEGV when i'm trying to run it in my office computer
>(linux 1.2.13 + gcc 2.6.3 + 4.6.27 ). It fails on malloc()...
> Is it bug in my brains (program) or....????

It can be a bug in your program, or in your computer's brains.
Try to re-compile the kernel on that office computer.  When it fails
as well, it is a problem with the memory on that machine.

When it doesn't, it probably is a bug in your program.

Rob
--
+------------------------------------+--------------------------------------+


+------------------------------------+--------------------------------------+

 
 
 

Q: SIGSEGV... What's wrong?

Post by Joe Bu » Wed, 24 Jul 1996 04:00:00



Quote:> i've got a strange problem... Some time ago i wrote a program. It works
>fine on my home computer running (linux 1.2.13 + gcc 2.5.8 + libc 4.5.26).
>But it fails with SIGSEGV when i'm trying to run it in my office computer
>(linux 1.2.13 + gcc 2.6.3 + 4.6.27 ). It fails on malloc()...

Your program probably was always buggy, but you were just lucky (or
unlucky, since it would have saved you time to find the bug earlier).  I
suspect that it writes to freed memory or frees the same pointer twice.
The writes may have gone to a harmless place before, and now, with the new
library, you hit a slightly different place and cause damage to malloc's
data structures.

--

Work for something because it is good,
not just because it stands a chance to succeed.    -- Vaclav Havel

 
 
 

Q: SIGSEGV... What's wrong?

Post by OBryan Anthony » Thu, 25 Jul 1996 04:00:00



: Hello,

:  i've got a strange problem... Some time ago i wrote a program. It works
: fine on my home computer running (linux 1.2.13 + gcc 2.5.8 + libc 4.5.26).
: But it fails with SIGSEGV when i'm trying to run it in my office computer
: (linux 1.2.13 + gcc 2.6.3 + 4.6.27 ). It fails on malloc()...

:  Is it bug in my brains (program) or....????

That is hard to say without looking at the source code.  Have you checked
the return value of malloc() to make sure memory was actually allocated.  If
the call fails and you try to access the phantom memory, you will get a
segment violation signal.  Or if you don't allocate enough memory and the
program tries to access memory beyond its address space then you will have the
same problem.  Or you may be allocating the memory, assigning it to several
pointers, and making logic errors with one or more of the pointers.  There
is a large pool of possible problems, so I would need more information to
pinpoint which one is the culprit.

 
 
 

1. 3 Qs: sio0 overflows, "unknown class 'root'", identd

Hi,

I have a few questions about some entries in my /var/log/messages file
that I was hoping some bright spark could illuminate me on. :)

The first query is about a whole bunch of these:

  <date> <host> /kernel: sio0: 1 more silo overflow (total <count>)

At first I suspected it was to so with me driving my modem port at
115,200 because it's a 16450 UART. Am I correct in my impression that a
16450 UART can be run at 115,200, like a 16550 can?

The second query is about my identd with IRC. I have it in my inetd.conf
with the man page recommended syntax:

  ident stream tcp wait root /usr/local/sbin/identd identd -w -t120

and it actually lets me on to identd-only IRC servers. The only this is
/whois's of me still show the damn tilde (~) prefixing my username. I
get challenged by the occasional IRCOp about it (since I have my two
housemates using our network simultaneously).

Is it a problem at my end, or something to do with the fact I'm
connected via a permanent modem connection to my ISP and their identd
(or lack of) is causing problems?

The third query is about a zillion:

  <date> <host> inetd[<pid>]: login_getclass: unknown class 'root'

I'm damned if I can work out what this is all about. I wondered if it
may be something to with the identd problem mentioned above, but it
seems to happen at frequent irregular intervals 24 hours/day. (Again,
I'm not sure if it's identd involvement because we sometimes detach IRC
screens, etc).

Or might the identd problem be due to the fact I have three Windows
machines connected (via 10base2) to my FreeBSD box (which is acting as a
PPP dialup and IP translator). Could it be that 3 users with 3 different
nicks and usernames are showing up as giving the same IP, thereby
confusing the identd (doesn't ident run on IP, not username?).

If someone can wade through that lot of stuff above and give me some
answers, I'd be greatly appreciative of it. Thanks in advance.

Would you mind Ccing any replies to me via email, please? I read this
group but, obviously, am loathe to miss any input regarding these
problems..

Regards,

--
Matt Bruce

NB: Remove X's to email me (anti-spam)

2. xvidtune

3. Wrong major or minor number --but it's wrong

4. Installing Slackware with 1.3.n kernel. How?

5. mount: wrong fs type,... What's wrong?

6. LILO Bug with Slackware 2.0 release

7. How I trace back SIGSEGV etc. (was: Re: SIGSEGV trace)

8. getty_ps fails to spawn login on modem, any ideas ?

9. 'signal SIGSEGV(11)' ???????

10. What's wrong with 'file protocol' or 'http://localhost protocol'?

11. 'signal SIGSEGV(11)' ???????

12. 'df' and 'du' show wrong sizes

13. External 'time_t' variable 'altzone' seems to be wrong !