YottaDB / YDB

Mirrored from https://gitlab.com/YottaDB/DB/YDB
Other
76 stars 37 forks source link

Error inside indirection usage in direct mode using $ETRAP (not $ZTRAP) causes process to incorrectly terminate #324

Closed nars1 closed 6 years ago

nars1 commented 6 years ago

Final Release Note

Description

Below is a simple test case describing the issue. When z=1/0 is done without using indirection (@ syntax), the DIVZERO error is displayed and control returns to the YDB prompt. But when the same is done inside indirection, the DIVZERO error is displayed and control returns back to the shell (i.e. the mumps process got abruptly terminated).

SHELL> $ydb_dist/mumps -direct
YDB>set $etrap="write $zstatus,!",z=1/0
%YDB-E-DIVZERO, Attempt to divide by zero

YDB>set $etrap="write $zstatus,!",@"z=1/0"
150373210,+1^GTM$DMOD,%YDB-E-DIVZERO, Attempt to divide by zero
SHELL>

This seems to be a day-one issue in the code where any errors inside an indirection usage while in direct mode are considered as non-direct-mode actions and so get handled differently in case of an error.

Draft Release Note

Errors inside indirection usage (@ syntax) while in the direct mode (i.e. YDB> prompt) and using $ETRAP return control back to the YDB> prompt after executing the $ETRAP error handler. Previously, this usage caused the mumps process to abruptly terminate.

shabiel commented 6 years ago

Wow! I have seen this and never thought to report it as a bug. I don't think is the only instance where that happens.

On Fri, Jul 27, 2018 at 3:26 PM, Narayanan Iyer notifications@github.com wrote:

Final Release Note Description

Below is a simple test case describing the issue. When z=1/0 is done without using indirection (@ syntax), the DIVZERO error is displayed and control returns to the YDB prompt. But when the same is done inside indirection, the DIVZERO error is displayed and control returns back to the shell (i.e. the mumps process got abruptly terminated).

SHELL> $ydb_dist/mumps -direct YDB>set $etrap="write $zstatus,!",z=1/0 %YDB-E-DIVZERO, Attempt to divide by zero

YDB>set $etrap="write $zstatus,!",@"z=1/0" 150373210,+1^GTM$DMOD,%YDB-E-DIVZERO, Attempt to divide by zero SHELL>

This seems to be a day-one issue in the code where any errors inside an indirection usage while in direct mode are considered as non-direct-mode actions and so get handled differently in case of an error. Draft Release Note

Errors inside indirection usage (@ syntax) while in the direct mode (i.e. YDB> prompt) and using $ETRAP return control back to the YDB> prompt after executing the $ETRAP error handler. Previously, this usage caused the mumps process to abruptly terminate.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/YottaDB/YottaDB/issues/324, or mute the thread https://github.com/notifications/unsubscribe-auth/ABEtwj8CABaG4xaqJoy2dZmnXaW2SzJtks5uK2lfgaJpZM4VkkFB .

nars1 commented 6 years ago

@shabiel : If you know of any other instance where an unexpected process termination occurs, let us know and we will investigate.

whitten commented 6 years ago

I've seen direct mode exit unexpectedly with indirection and the ZWRITE command. I'll try to duplicate it and get you more details. By the way, why doesn't CONTROL-C stop ZWRITE when it has a lot of output?

nars1 commented 6 years ago

@whitten : This is an issue that is fixed in GT.M V6.2-000. What version of GT.M are you running?

http://tinco.pair.com/bhaskar/gtm/doc/articles/GTM_V6.2-000_Release_Notes.html#GTM-8003

Ctrl-C terminates potentially long-running operations, for example, ZWRITE. Since V6.0-003, the revisions associated with GTM-5576 caused ZWRITE and ZSHOW "V" to not respond to in direct mode. Additionally, unlike utility programs, GT.M does not display informational messages unless they expand on another message, or you are in direct mode. Previously under rare circumstances, such informational messages could potentially appear in a running application. UNIX