I've got a BIG problem... pls help

I've got a BIG problem... pls help

Post by 54401-93 Chan Kwong K » Fri, 06 Sep 1996 04:00:00



It is really a big problem....

I am writing my final year project using Motif and C under Solaris and
it should work at home with Linux too I hope...

But the progarm is now ok at Solaris, but core dump at my Linux 2.0.17
with gcc 2.7.

Following is my procedure...
1) I make a pointer to a structure which have some strings and some other
structure pointer inside. I fill up all the field under a procedure using
strdup.

2) I run a procedure to free all resources like memory for pointer.

3) Then I run step 1) again. Core dump....

No problem at Solaris at university. I can create and destroy 100 times
at Solaris without any problem. The core dump is not out at the 1st
strdup under the creation routine... One of my testing program dump at
the 3rd one and one dump at the 6th one.

What's wrong.... It true to me and I am not telling lies. Pls help.

--
---
Bestregards
Louis Chan

   /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  /_/  Louis Chan, Kwong Kit                                      /_/_
 /_/_/ Computer Studies, Year 4                                  /_/_/
  /_/  City Univerity of Hong Kong.                               /_/
 /_/                                                             /_/
  /_/                        http://www.cs.cityu.edu.hk/~ckkchan  /_/

  /_/                      pager : +(852)7111 1076 a/c 4624       /_/
 /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
                                            Printed on Recycled Paper.

 
 
 

I've got a BIG problem... pls help

Post by B.A.McCau.. » Sat, 07 Sep 1996 04:00:00



Quote:>I am writing my final year project using Motif and C under Solaris and
>it should work at home with Linux too I hope...

>But the progarm is now ok at Solaris, but core dump at my Linux 2.0.17
>with gcc 2.7.

>Following is my procedure...
>1) I make a pointer to a structure which have some strings and some other
>structure pointer inside. I fill up all the field under a procedure using
>strdup.

>2) I run a procedure to free all resources like memory for pointer.

>3) Then I run step 1) again. Core dump....

Linux is a lot better than several other Unicies at detecting bad
memory management in programs.

Quote:>What's wrong.... It true to me and I am not telling lies. Pls help.

You are also not giving hard facts.  If you want other people to help
you with your homework the very least you should do is post the
actual source code.

Please, please, please if you want help on Usenet *show* people the
problems don't *describe* the problems!

--

 .  _\\__[oo       from       | Phones: +44 121 471 3789 (home)

.  l___\\    /~~) /~~[  /   [ | PGP-fp: D7 03 2A 4B D8 3A 05 37...
 # ll  l\\  ~~~~ ~   ~ ~    ~ | http://wcl-l.bham.ac.uk/~bam/


 
 
 

I've got a BIG problem... pls help

Post by robe » Sat, 07 Sep 1996 04:00:00



 >Following is my procedure...
 >1) I make a pointer to a structure which have some strings and some other
 >structure pointer inside. I fill up all the field under a procedure using
 >strdup.
 >2) I run a procedure to free all resources like memory for pointer.
 >3) Then I run step 1) again. Core dump....

Perhaps it would be nice if you included some (notice the 'some'...it
means 'relevant' :) sourcecode.

                                                                robert

 
 
 

I've got a BIG problem... pls help

Post by Michael J. Fromberg » Sun, 08 Sep 1996 04:00:00




Quote:>I am writing my final year project using Motif and C under Solaris and
>it should work at home with Linux too I hope...

>But the progarm is now ok at Solaris, but core dump at my Linux 2.0.17
>with gcc 2.7.

[...]

>No problem at Solaris at university. I can create and destroy 100 times
>at Solaris without any problem. The core dump is not out at the 1st
>strdup under the creation routine... One of my testing program dump at
>the 3rd one and one dump at the 6th one.

>What's wrong.... It true to me and I am not telling lies. Pls help.

Hmm...could it maybe be some kind of byte-alignment problem?  I had a
similar type of problem porting database routines from an RS/6000 running
AIX to an SGI running IRIX; the one didn't complain about unaligned
access, the other dumped core.  But if you're using the standard library
functions, they should theoretically take that into account.

You should definitely at least get a stack trace in the de* to find
out what caused the core dump -- it could have been a bus error, a seg
violation, or a couple of other things.  And also, if you're not already,
double-check the pointers that are returned by strdup() to make sure
they're getting allocated correctly (at least in your test program).

Cheers,
-M

--
Michael J. Fromberger
Composer, Guitarist, Linguist, Mediaevalist
Dartmouth College, Hanover, New Hampshire, USA

 
 
 

1. Forgive me Gurus but I've f**ked up big time HELP HELP HELP!

OK I have really gone & done it!

I was using an old Sun box we have in the office,
for which we have a root user and a root
password, but that's about it.

OK thought I, I'll just make myself a new user so
I did, I used USERADD which then told me to run a
password updating utility, I think called PASSUPD
or maybe PASSCONV but I didn't write it down. The
app ran, no problem and, with no comments
returned me to the shell prompt. So I set up my
password for my new user, crossed my fingers and
logged out.

STUPID STUPID STUPID!

Now when I try to log in as root with the root
password it won't let me in. I can get in as my
new user but with hardly any access rights.

What gives? What have I done? How on earth did
the root password change without it telling me?
What sort of an OS changes root
password "invisibly". Aargh. I need to get this
machine back and running by the end of today and
I haven't a clue how to.

Anyone, anywhere? Any ideas? Any hints? PLEASE
PLEASE PLEASE!

BTW I'm using SunOS 5.4 on a SUN Sparcstation 20

OK, laugh...go on...laugh. Damn Damn damn

Jeremy

Sent via Deja.com http://www.deja.com/
Before you buy.

2. Modem Won't Work :-(

3. I've got the Hard Disk Blues :( ... pls help

4. SMP hang in 2.2.11 and 2.2.12 kernels

5. I've installed Red Hat 5.0 Linux and I've got a problem

6. area afsluiten met uqwk?

7. I've got a BIG PROBLEM

8. Searching for executor

9. i've a big problem

10. Help! I've gotten this far...

11. getting a tar file off a tape when you've tar cf'ed first

12. ATT: Pls help (Big problems)

13. You've got yours, I've got mine... let the others in their shit!