ut_coverage_html_reporter crashes when code under test contain lines larger than 1911 characters
Describe the bug
When the source code contain one or more lines that are longer than 1911 characters (bytes?) then the ut_coverage_html_reporter crashes.
Provide version info
21.0.0.0.0
21.0.0
PL/SQL procedure successfully completed.
UT_VERSION
------------------------------------------------------------
v3.1.13.4021-develop
BANNER BANNER_FULL BANNER_LEGACY CON_ID
-------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------
Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production 0
Version 21.3.0.0.0
PARAMETER VALUE
------------------------------ ----------------------------------------------------------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD.MM.YYYY HH24:MI:SS
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD.MM.YYYY HH24:MI:SSXFF
PARAMETER VALUE
------------------------------ ----------------------------------------------------------------
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD.MM.YYYY HH24:MI:SSXFF TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
17 rows selected.
PORT_STRING
------------------------------------------------------------
x86_64/Linux 2.4.xx
Information about client software
The client is not relevant. You can reproduce the bug in any SQL client. However, I used SQL Developer 22.2.0 on MacOS 12.5.1.
To Reproduce
Steps to reproduce the behavior:
see chapter "Example code" below.
Expected behavior
From my point of view ut_coverage_html_reporter should not crash. I can understand that processing long lines is problematic. In such cases I suggest to truncate these lines for the HTML output.
Example code
Run the following code to reproduce the problem in any environment:
create or replace type string_array is table of varchar2(5 char); / create or replace function f return integer is l_string_array string_array; l_count integer; begin -- line is 1912 chars long, 1911 characters seem to be the max. line length that works (@formatter:off) l_string_array := string_array('aahed', 'aalii', 'aargh', 'aarti', 'abaca', 'abaci', 'abacs', 'abaft', 'abaka', 'abamp', 'aband', 'abash', 'abask', 'abaya', 'abbas', 'abbed', 'abbes', 'abcee', 'abeam', 'abear', 'abele', 'abers', 'abets', 'abies', 'abler', 'ables', 'ablet', 'ablow', 'abmho', 'abohm', 'aboil', 'aboma', 'aboon', 'abord', 'abore', 'abram', 'abray', 'abrim', 'abrin', 'abris', 'absey', 'absit', 'abuna', 'abune', 'abuts', 'abuzz', 'abyes', 'abysm', 'acais', 'acari', 'accas', 'accoy', 'acerb', 'acers', 'aceta', 'achar', 'ached', 'aches', 'achoo', 'acids', 'acidy', 'acing', 'acini', 'ackee', 'acker', 'acmes', 'acmic', 'acned', 'acnes', 'acock', 'acold', 'acred', 'acres', 'acros', 'acted', 'actin', 'acton', 'acyls', 'adaws', 'adays', 'adbot', 'addax', 'added', 'adder', 'addio', 'addle', 'adeem', 'adhan', 'adieu', 'adios', 'adits', 'adman', 'admen', 'admix', 'adobo', 'adown', 'adoze', 'adrad', 'adred', 'adsum', 'aduki', 'adunc', 'adust', 'advew', 'adyta', 'adzed', 'adzes', 'aecia', 'aedes', 'aegis', 'aeons', 'aerie', 'aeros', 'aesir', 'afald', 'afara', 'afars', 'afear', 'aflaj', 'afore', 'afrit', 'afros', 'agama', 'agami', 'agars', 'agast', 'agave', 'agaze', 'agene', 'agers', 'agger', 'aggie', 'aggri', 'aggro', 'aggry', 'aghas', 'agila', 'agios', 'agism', 'agist', 'agita', 'aglee', 'aglet', 'agley', 'agloo', 'aglus', 'agmas', 'agoge', 'agone', 'agons', 'agood', 'agora', 'agria', 'agrin', 'agros', 'agued', 'agues', 'aguna', 'aguti', 'aheap', 'ahent', 'ahigh', 'ahind', 'ahing', 'ahint', 'ahold', 'ahull', 'ahuru', 'aidas', 'aided', 'aides', 'aidoi', 'aidos', 'aiery', 'aigas', 'aight', 'ailed', 'aimed', 'aimer', 'ainee', 'ainga', 'aioli', 'aired', 'airer', 'airns', 'airth', 'airts', 'aitch', 'aitus', 'aiver', 'aiyee', 'aizle', 'ajies', 'ajiva', 'ajuga', 'ajwan', 'akees', 'akela', 'akene', 'aking', 'akita', 'akkas', 'alaap', 'alack', 'alamo', 'aland', 'alane', 'alang', 'a'); select count(*) into l_count from table(l_string_array); return l_count; end; / create or replace package test_f is --%suite --%test procedure crashing_ut_coverage_html_reporter; end; / create or replace package body test_f is procedure crashing_ut_coverage_html_reporter is begin ut.expect(f()).to_be_greater_or_equal(1); end; end; / set serveroutput on size unlimited -- works execute ut.run('test_f'); -- fails execute ut.run('test_f', ut_coverage_html_reporter());
The output looks like this:
Type STRING_ARRAY compiled
Function F compiled
Package TEST_F compiled
Package Body TEST_F compiled
test_f
crashing_ut_coverage_html_reporter [.024 sec]
Finished in .02968 seconds
1 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)
PL/SQL procedure successfully completed.
ORA-06512: at "SYS.DBMS_XMLGEN", line 19
ORA-06512: at "SYS.DBMS_XMLGEN", line 295
ORA-06512: at "UT3.UT_COVERAGE_REPORT_HTML_HELPER", line 190
ORA-06512: at "UT3.UT_COVERAGE_REPORT_HTML_HELPER", line 202
ORA-06512: at "UT3.UT_COVERAGE_REPORT_HTML_HELPER", line 334
ORA-06512: at "UT3.UT_COVERAGE_HTML_REPORTER", line 37
ORA-06512: at "UT3.UT_REPORTER_BASE", line 193
ORA-06512: at "UT3.UT_EVENT_MANAGER", line 70
ORA-06512: at "UT3.UT_EVENT_MANAGER", line 80
ORA-06512: at "UT3.UT_RUN", line 66
ORA-06512: at "UT3.UT_SUITE_ITEM", line 50
ORA-06512: at "UT3.UT_RUNNER", line 151
ORA-19011: Character string buffer too small
ORA-06512: at "SYS.DBMS_XMLGEN", line 19
ORA-06512: at "SYS.DBMS_XMLGEN", line 295
ORA-06512: at "UT3.UT_COVERAGE_REPORT_HTML_HELPER", line 190
ORA-06512: at "UT3.UT_COVERAGE_REPORT_HTML_HELPER", line 202
ORA-06512: at "UT3.UT_COVERAGE_REPORT_HTML_HELPER", line 334
ORA-06512: at "UT3.UT_COVERAGE_HTML_REPORTER", line 37
ORA-06512: at "UT3.UT_REPORTER_BASE", line 193
ORA-06512: at "UT3.UT_EVENT_MANAGER", line 70
ORA-06512: at "UT3.UT_EVENT_MANAGER", line 80
ORA-06512: at "UT3.UT_RUN", line 66
ORA-06512: at "UT3.UT_SUITE_ITEM", line 50
Error starting at line : 37 in command -
BEGIN ut.run('test_f', ut_coverage_html_reporter()); END;
Error report -
ORA-19011: Character string buffer too small
ORA-06512: at "UT3.UT_RUNNER", line 158
ORA-06512: at "SYS.DBMS_XMLGEN", line 19
ORA-06512: at "SYS.DBMS_XMLGEN", line 295
ORA-06512: at "UT3.UT_COVERAGE_REPORT_HTML_HELPER", line 190
ORA-06512: at "UT3.UT_COVERAGE_REPORT_HTML_HELPER", line 202
ORA-06512: at "UT3.UT_COVERAGE_REPORT_HTML_HELPER", line 334
ORA-06512: at "UT3.UT_COVERAGE_HTML_REPORTER", line 37
ORA-06512: at "UT3.UT_REPORTER_BASE", line 193
ORA-06512: at "UT3.UT_EVENT_MANAGER", line 70
ORA-06512: at "UT3.UT_EVENT_MANAGER", line 80
ORA-06512: at "UT3.UT_RUN", line 66
ORA-06512: at "UT3.UT_SUITE_ITEM", line 50
ORA-06512: at "UT3.UT_RUNNER", line 151
ORA-06512: at "UT3.UT", line 143
ORA-06512: at "UT3.UT", line 566
ORA-06512: at "UT3.UT", line 733
ORA-06512: at line 1
19011. 00000 - "Character string buffer too small"
*Cause: The string result asked for is too big to return back
*Action: Get the result as a lob instead
Additional context
n/a