It is currently Thu Apr 19, 2018 8:02 pm


All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Segmentation error using %M
PostPosted: Thu Mar 01, 2012 9:47 am 
User avatar

Joined: Wed Nov 17, 2010 8:37 am
Posts: 136
Real Name: Terry L. Wiechmann
Began Programming in MUMPS: 0- 0-1971
I'm running MUMPS V1.55 for Linux i686 (Ubuntu build).

If you enter the following:

MCL> K

MV1 will hang and if you hit Ctrl C, it will issue a segmentation error and the image will run down.

_________________
Terry L. Wiechmann


Top
Offline Profile  
 
 Post subject: Re: Segmentation error using %M
PostPosted: Thu Mar 01, 2012 1:53 pm 
User avatar

Joined: Sun Mar 27, 2011 8:12 am
Posts: 87
Location: Europe , HUNGARY
Real Name: Josef Nagy
Began Programming in MUMPS: 0- 0-1991
Terry

Because KILL delete all memory variable .
Change the first line of ERROR label in %M routine , something like :

ERROR U 0 I $ES<2 S $EC="" G %M

This working !

_________________
Josef Nagy
[MUMPS based industrial application in Processing Controll (MCU/PLC/MUX)]


Top
Offline Profile  
 
 Post subject: Re: Segmentation error using %M
PostPosted: Thu Mar 01, 2012 4:05 pm 
User avatar

Joined: Mon Nov 01, 2010 3:33 pm
Posts: 104
Location: Australia
Real Name: Ray Newman
Began Programming in MUMPS: 01 Jul 1976
Yes, it seems to be in the $ECODE set stuf - I'll see if I can find the underlying problem.

Ray


Top
Offline Profile  
 
 Post subject: Re: Segmentation error using %M
PostPosted: Thu Mar 01, 2012 7:01 pm 
User avatar

Joined: Wed Nov 17, 2010 8:37 am
Posts: 136
Real Name: Terry L. Wiechmann
Began Programming in MUMPS: 0- 0-1971
This issue is the app (MCL) should crash, not the underlying MV1 system.

_________________
Terry L. Wiechmann


Top
Offline Profile  
 
 Post subject: Re: Segmentation error using %M
PostPosted: Fri Mar 02, 2012 2:48 am 
User avatar

Joined: Mon Nov 01, 2010 3:33 pm
Posts: 104
Location: Australia
Real Name: Ray Newman
Began Programming in MUMPS: 01 Jul 1976
There are actually several problems here.

1. %M goes into a nonsense loop
2. %M doesn't detect this
3. A <Ctrl><C> or SIGINT (unix) is not passed back to %M
4. Even if the SIGIN was passed back, %M would not handle it correctly

So... some fixes are required to %M in the error stuff
and the mumps image needs to be better with signals.

I'll get there eventually.

Ray


Top
Offline Profile  
 
 Post subject: Re: Segmentation error using %M
PostPosted: Fri Mar 02, 2012 7:30 am 
User avatar

Joined: Wed Nov 17, 2010 8:37 am
Posts: 136
Real Name: Terry L. Wiechmann
Began Programming in MUMPS: 0- 0-1971
Definitely something wrong with setting $ECODE.

It takes:

Set $ECODE="UThis is an error!"

But rejects:

Set $ECODE=",UThis is an error!,"

which is the standard format.

EsiObjects uses this extensively!

_________________
Terry L. Wiechmann


Top
Offline Profile  
 
 Post subject: Re: Segmentation error using %M
PostPosted: Fri Mar 02, 2012 12:08 pm 
User avatar

Joined: Mon Nov 01, 2010 3:33 pm
Posts: 104
Location: Australia
Real Name: Ray Newman
Began Programming in MUMPS: 01 Jul 1976
Hmmm, I've never heard of putting the commas in there before.

Ray


Top
Offline Profile  
 
 Post subject: Re: Segmentation error using %M
PostPosted: Fri Mar 02, 2012 2:04 pm 
User avatar

Joined: Wed Nov 17, 2010 8:37 am
Posts: 136
Real Name: Terry L. Wiechmann
Began Programming in MUMPS: 0- 0-1971
I've been reading the standard and it explicitly says the code(s) are surrounded by commas. The description of the $ECODE states "...information is loaded by the implementation after detecting an erroneous condition, or by the application via the SET command." It the goes on to define the format: , L ecode , where ecode can be a M, U or Z followed by a graphic. The implication is that it is the format generated by the system and the format the programmer should use when setting it to activate error processing.

However, The SET command description for setting $ECODE simply states that it is set to the expr and makes no distinction as to the format. In other words, there's room for confusion. I'm assuming it requires the commas since EsiObjects has run on most MUMPS systems and it uses the comma format exclusively. Additionally, I tried it on GT.M and it will complain if you don't include them.

_________________
Terry L. Wiechmann


Top
Offline Profile  
 
 Post subject: Re: Segmentation error using %M
PostPosted: Fri Mar 02, 2012 2:11 pm 
User avatar

Joined: Mon Nov 01, 2010 3:33 pm
Posts: 104
Location: Australia
Real Name: Ray Newman
Began Programming in MUMPS: 01 Jul 1976
Ya, after your last post, I googled and most implementations seem to use the comma.
GTM even allows S $EC=",M1," which I thought should have been against the rules; however, the standard doesn't explicitly disallow that either.
I checked the ANSI and ISO standards and, as you say, they don't specify the requirement explicitly. I will get around to modifying my version of MUMPS to allow either.

Ray

NOW DONE and loaded to sourceforge.


Top
Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net