YottaDB / YDB

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

Certain edge cases of VIEW and $VIEW() work correctly without terminating the process #224

Closed nars1 closed 6 years ago

nars1 commented 6 years ago

Final Release Note

VIEW commands and $VIEW functions work correctly. Previously, edge cases in YottaDB, and newly introduced in GT.M V6.3-004, in commands like VIEW "NOISOLATION", functions like $VIEW("GVFILE"), etc., could terminate the process abnormally with a SIG-11, SIG-6, GTMASSERT2 error. (#224)

Description

There are various issues identified here. test1, test2 and test3 are longstanding issues. test4, test5, test6 and test7 are new to GT.M V6.3-004 (which was integrated into YottaDB mainline after r1.20).

> mumps -run test1^test
%YDB-F-GTMASSERT2, YottaDB r998 Linux x86_64 - Assert failed sr_port/view_arg_convert.c line 247 for expression (SIZEOF(global_names) > parm->str.len)

> mumps -run test2^test
*** buffer overflow detected ***: mumps terminated
.
.
%GTM-F-KILLBYSIGSINFO1, YottaDB process 27474 has been killed by a signal 6 at address 0x00007F4A45A10428 (vaddr 0x000000E400006B52)

> mumps -run test3^test
%GTM-F-KILLBYSIGSINFO1, YottaDB process 27479 has been killed by a signal 11 at address 0x00007F81874F770D (vaddr 0x00007FFE6A22A000)
%GTM-F-SIGMAPERR, Signal was caused by an address not mapped to an object

> mumps -run test4^test
%GTM-F-KILLBYSIGSINFO1, YottaDB process 27484 has been killed by a signal 11 at address 0x00007FAFEEFBA70D (vaddr 0x00007FFE550AD000)
%GTM-F-SIGMAPERR, Signal was caused by an address not mapped to an object

> mumps -run test5^test
%GTM-F-KILLBYSIGSINFO1, YottaDB process 27492 has been killed by a signal 11 at address 0x00007FCD122E470D (vaddr 0x00007FFD402B8000)
%GTM-F-SIGMAPERR, Signal was caused by an address not mapped to an object

> mumps -run test6^test
%GTM-F-KILLBYSIGSINFO1, YottaDB process 27497 has been killed by a signal 11 at address 0x00007EFFA9032704 (vaddr 0x0000000000000000)
%GTM-F-SIGMAPERR, Signal was caused by an address not mapped to an object

> mumps -run test7^test
%GTM-F-KILLBYSIGSINFO1, YottaDB process 27502 has been killed by a signal 11 at address 0x00007FA2AF331704 (vaddr 0x0000000000000000)
%GTM-F-SIGMAPERR, Signal was caused by an address not mapped to an object
> cat test.m
test1
   set xstr="view ""NOISOLATION"":""^a"
   for i=1:1:1024 set xstr=xstr_"0"
   set xstr=xstr_""""
   xecute xstr
   quit

test2
   view "NOISOLATION":"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"
   quit

test3
   set regname="a"
   for i=1:1:80000 set regname=regname_"0"
   write $view("GVFILE",regname)
   quit

test4
   set reglist="a"
   for i=1:1:800000 set reglist=reglist_"0"
   view "STATSHARE":reglist
   quit

test5
   set reglist="DEFAULT"
   for i=1:1:15 set reglist=reglist_","_reglist
   view "STATSHARE":reglist
   quit

; Note: A lot of $view commands where a region name is expected in the second argument will SIG-11 if "" is specified
; Only 2 of them are tested here (test6 and test7).
test6
   write $view("GVSTATS",""),!
   quit

test7
   write $view("GVFILE",""),!
   quit

Draft Release Note

VIEW commands and $VIEW functions work correctly. In prior versions of YottaDB, commands like VIEW "NOISOLATION", functions like $VIEW("GVFILE") etc. could terminate the mumps process abnormally with a SIG-11/SIG-6/GTMASSERT2 error. Additionally, a few issues (could cause SIG-11) in GT.M V6.3-004 (which was integrated into YottaDB after r1.20) are now fixed.