🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.modula2
4 messages
4 total messages Started by Bimal Shah Wed, 17 Jan 1996 12:38
Funny problem
#3130
Author: Bimal Shah
Date: Wed, 17 Jan 1996 12:38
31 lines
1134 bytes
Hello,

The following is happening in one of the modules
i have wrote :

IF condition THEN
	WriteString('blah, blah, blah'); 
	CALLING PROCEDURE HERE
	WriteString('blah, blah, blah');
ELSE
	CODE HERE;
END;

Now the above program (its in an implementation module)
compiles and i have no problem linking it to the client
program and the client program calls the above OK.

Now (here's the funny bit), if i remove both the above
WriteString procedures, (and re-compile, re-link), then
it crashes and doesn't seem to call the procedure (almost
like it's skipping it).

Does ANYONE have any idea what's wrong ?

Is there a MAJOR bug is Modula-2 ? I am using GPM September '95.

Thankyou.

 ---------------------------
| Bimal Shah c2bs@dmu.ac.uk | 
 ---------------------------
Re: Funny problem
#3145
Author: Bill Seurer
Date: Fri, 19 Jan 1996 16:56
35 lines
1788 bytes
In article <4diqjd$b19@macondo.dmu.ac.uk>, c2bs@dmu.ac.uk (Bimal Shah) writes:
|> Hello,
|> 
|> The following is happening in one of the modules
|> i have wrote :
|> 
|> IF condition THEN
|> 	WriteString('blah, blah, blah'); 
|> 	CALLING PROCEDURE HERE
|> 	WriteString('blah, blah, blah');
|> ELSE
|> 	CODE HERE;
|> END;
|> 
|> Now the above program (its in an implementation module)
|> compiles and i have no problem linking it to the client
|> program and the client program calls the above OK.
|> 
|> Now (here's the funny bit), if i remove both the above
|> WriteString procedures, (and re-compile, re-link), then
|> it crashes and doesn't seem to call the procedure (almost
|> like it's skipping it).
|> 
|> Does ANYONE have any idea what's wrong ?
|> 
|> Is there a MAJOR bug is Modula-2 ? I am using GPM September '95.

I have no idea what in particular might be wrong but whenever you add or
remove code you change the way it and it's data may lie in memory.  You
could very well have some uninitialized data that gets a valid value when
the Write's are there but gets a "bad" value when they are not.  I see
this quite a lot in both my own code and in code I help others to debug.

- Bill Seurer     ID Tools and Compiler Development      IBM Rochester, MN
  Business: BillSeurer@vnet.ibm.com               Home: BillSeurer@aol.com
Re: Funny problem
#3175
Author: Geoff Elgey
Date: Wed, 24 Jan 1996 03:02
24 lines
1580 bytes
Are you using GPM-LINUX? GPM-PC?

I came across a similar problem late last year under GPM-LINUX. I had a piece
of code that would crash in certain procedures, so I added some WriteString's
to provide debug output. With the debugging code, however, the program would
not crash.

As far as I can remember, this is due to a bug in the way that GPM handles
procedures that accept parameters that are arrays of some structured type
(RECORDS, etc). The stack frame wasn't being set up correctly upon procedure
entry. However, using a few empty WriteString's (ie WriteString("")) seemed to
fix the problem. 

I spoke to the person that writes the GPM backend, and the bug was confirmed
and fixed. The latest GPM-Linux release should contain the bug fix.

Of course, this may not be the same bug that you are experiencing....

Cheers,

Geoff Elgey,
Researcher, Programming Languages and Systems Group,
Faculty of Information Technology,
QUT. Brisbane, Queensland, Australia.
Re: Funny problem
#3186
Author: "David Collier"
Date: Wed, 24 Jan 1996 18:39
8 lines
594 bytes
I think to be any help we would need to know the compiler, memory model 
etc.

There are such things as compiler bugs, I've seen a few, especially in 
JPI V1.17. If you have the choice, turn off ALL optimisation, and try 
gain. Maybe change memory model too.

D.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads