Assert Warning: Memory block header corruption detected in mt_realloc 2
Posted in 2024
Dennis Melnikov saw memory block header corruption warnings in mt_realloc on 11.70.FC5XE, caused by genxmlclob on a 125-row set that failed with error -8369; he found the failure depended on row order and posted a reproduction. Paul Watson thought it a memory issue; Andreas Legner suggested trying a recent version. Gerd Kaluzinski could not reproduce it on 14.10.FC10.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Topics: Stored Procedures & SPL, Error Codes & Troubleshooting, Cloud, Docker & Containers, Versions, Editions & End-of-Life
Hi,
IBM Informix Dynamic Server Version 11.70.FC5XE
We got the following warnings:
17:58:53 Assert Warning: Memory block header corruption detected in mt_realloc 2
17:58:53 IBM Informix Dynamic Server Version 11.70.FC5XE
17:58:53 Who: Session(5284871, sap_xi@pfp-app1, 0, 70000423f9c9f08)
Thread(58573054, sqlexec, 70000449bf0d068, 13)
File: mtshpool.c Line: 2988
17:58:53 Results:
17:58:53 Action: Please notify IBM Informix Technical Support.
17:58:53 stack trace for pid 13697538 written to /tmp/af.c4e6ed2d
/tmp/af.c4e6ed2d is as follows:
17:58:53 Found during mt_realloc 2
17:58:53 Pool 'EXE.5284871' (0x700004f954b7040)
17:58:53 Bad block header 0x700004bcb9f0028
blk-640700004bcb9effe8: 3422206c 696e655f 6e756d3d 22313030 4" line_ num="100
0700004bcb9efff8: 22206974 656d5f6e 756d3d22 35303731 " item_n um="5071
0700004bcb9f0008: 38222071 74793d22 31302220 69735f64 8" qty=" 10" is_d
0700004bcb9f0018: 616d6167 653d2222 2f3e0a3c 6c696e65 amage="" />.<line
blk+64
0700004bcb9f0028: 0000009b 60ea6081 ffff04e0 008008c1 ....`.`. ........
0700004bcb9f0038: 0700004f 954b70a8 0700004b cb9ee000 ...O.Kp. ...K....
0700004bcb9f0048: 00000000 00000fd8 0700004f 954b70e8 ........ ...O.Kp.
0700004bcb9f0058: 0700004f 954b70e8 0e00009f 2a96e1d1 ...O.Kp. ....*...
17:58:53 Bad block removed from pool
17:58:53 Attempting to clean up free list...
17:58:53 Bad free block 0x700004bcb9f0050
blk-640700004bcb9f0010: 31302220 69735f64 616d6167 653d2222 10" is_d amage=""
0700004bcb9f0020: 2f3e0a3c 6c696e65 0000009b 60ea6081 />.<line ....`.`.
0700004bcb9f0030: ffff04e0 008008c1 0700004f 954b70a8 ........ ...O.Kp.
0700004bcb9f0040: 0700004b cb9ee000 00000000 00000fd8 ...K.... ........
blk+64
0700004bcb9f0050: 0700004f 954b70e8 0700004f 954b70e8 ...O.Kp. ...O.Kp.
0700004bcb9f0060: 0e00009f 2a96e1d1 0700004b cb9f00b0 ....*... ...K....
0700004bcb9f0070: 0700004b cb9f00f0 00000000 00000000 ...K.... ........
0700004bcb9f0080: 00000000 00000000 0e00009b 60ea8049 ........ ....`..I
17:58:53 Bad free block removed from pool
17:58:53
17:58:53 IBM Informix Dynamic Server Version 11.70.FC5XE Software Serial Number AAA#B000000
17:58:53 Assert Warning: Memory block header corruption detected in mt_realloc 2
17:58:53 Who: Session(5284871, sap_xi@pfp-app1, 0, 70000423f9c9f08)
Thread(58573054, sqlexec, 70000449bf0d068, 13)
File: mtshpool.c Line: 2988
17:58:53 Results:
17:58:53 Action: Please notify IBM Informix Technical Support.
17:58:53 Raw hex dump of stack located in /tmp/af.c4e6ed2d.rawstk
17:58:53 Stack for thread: 58573054 sqlexecbase: 0x0700004410659000
len: 135168
pc: 0x0000000100096cec
tos: 0x0700004410675800
state: running
vp: 13
0x0000000100096a98 (oninit)afstack
0x000000010009603c (oninit)afhandler
0x00000001000963ec (oninit)afwarn_interface
0x0000000100068294 (oninit)mt_realloc
0x00000001001d4ee8 (oninit)mi_realloc
0x0000000100556fe4 (oninit)genxml
0x000000010055fc50 (oninit)iter_aggrxmlc
0x0000000100dddb1c (oninit)udrlm_clang_execute_internal
0x0000000100ddd728 (oninit)udrlm_clang_execute
0x00000001013c5550 (oninit)udrlm_exec_routine
0x000000010061c72c (oninit)udr_execute
0x00000001005507b0 (oninit)sqexop
0x00000001013a0320 (oninit)compagg
0x000000010139ef70 (oninit)updategrpcols
0x000000010139bb88 (oninit)process_non_groupby
0x0000000101398e54 (oninit)group_open
0x000000010068c460 (oninit)prepselect
0x00000001002ca0d0 (oninit)subqprep
0x00000001002c8fe8 (oninit)exsubq
0x000000010083d868 (oninit)ev_cb
0x0000000100833c10 (oninit)new_eval
0x000000010069f548 (oninit)IPRA.$ip_evalexpr
0x000000010069caec (oninit)runproc
0x00000001006b1dfc (oninit)udrlm_spl_execute
0x00000001013c5508 (oninit)udrlm_exec_routine
0x000000010061c72c (oninit)udr_execute
0x00000001006adeb4 (oninit)udr_spl_curnext
0x00000001006adb04 (oninit)ip_curnext
0x00000001006add50 (oninit)ip_fetch
0x0000000100689754 (oninit)getrow
0x000000010068acd8 (oninit)fetchrow
0x0000000100737b44 (oninit)exfetch
0x00000001001fb024 (oninit)sql_nfetch
0x00000001001fa808 (oninit)sq_nfetch
0x00000001004889c0 (oninit)sqmain
0x00000001009f8cd4 (oninit)listen_verify
0x00000001009f7d88 (oninit)spawn_thread
0x0000000101489440 (oninit)startup
17:58:53 See Also: /tmp/af.c4e6ed2d
------------------------------Begin System Alarm Program Output
------------------------------
Assertion Failure Type: Warning
Host Name: elids5
Database Server Name: elids5
Time of failure: Fri Mar 1 17:58:53 MSK 2024
AF file: /tmp/af.c4e6ed2d
Shared memory file: None
System Blocking: OFF
------------------------------
End System Alarm Program Output
------------------------------
17:58:53 sh /opt/informix/11.70fc5xe/etc/evidence.sh 1 0 /tmp/af.c4e6ed2d 5284871 0x70000449bf0d068 58573054 0x700005161e61220 1025 0 0 0 0
17:58:53
------------------ End of assertion failure 0 ----------------
-A failing query that causes the warning is:
SELECT genxml(row(line_id, line_num, item_num, qty, is_damage, is_cross_docking, mark_chz),"line")
<...>
Does genxml() have any tips and tricks to tune?
------------------------------
Sincerely,
Dennis
------------------------------
Just a memory issue, if it is repeatable I would separate into separate SQLs (if possible). You are not going to get IBM to fix this, but might be a known stack Cheers Paul
An idsxmlvp virtual processor is declared to be created automatically the first time an XML function is used. However, there is no idsxmlvp VP running. Is it optional? Should I add the VP manually? ------------------------------ Sincerely, Dennis ------------------------------
If the VP is mandatory then you should get an error indicating that if it can't be found.
Digging deeper into the problem we found that the query fails with error -8369, -8369 Function <funcname> Memory allocation for internal buffer failed Explanation:Function <funcname> was not able to allocate more memory. Action:Make sure that the system has enough memory to run the command. If the problem persists, contact Technical Support to resolve the problem. The failing set has 125 rows. At the same time, another set of 335 rows is handled by genxml() without a problem. Q: How to tune the internal buffer, how to check it has enough memory? Can the problem be related to RSS replication? ------------------------------ Sincerely, Dennis ------------------------------
Our further investigation proved we have encountered an apparent Informix's bug, i.e. the AF is triggered by the order rows lie in the set--the query succeeds if the order is reversed. ------------------------------ Sincerely, Dennis ------------------------------
Provided a reproduction, this could be tried with a recent Informix version. ------------------------------ Andreas Legner ------------------------------
Andreas,
To reproduce,
CREATE TEMP TABLE tmp_osa5632 (
line_id INTEGER,
line_num INTEGER,
item_num CHAR(10),
qty CHAR(10),
is_damage CHAR(1),
is_cross_docking SMALLINT,
mark_chz CHAR(1)
) WITH NO LOG;
LOAD FROM 'osa-5632.unl' DELIMITER "|" INSERT INTO tmp_osa5632;SELECT genxmlclob(row(line_id, line_num, item_num, qty, is_damage, is_cross_docking, mark_chz),"line")
FROM (SELECT line_id, line_num, TRIM(item_num) AS item_num, TRIM(qty) AS qty, TRIM(is_damage) AS is_damage, is_cross_docking, mark_chz
FROM tmp_osa5632 ORDER BY line_id);
First, save it to 'osa-5632.unl':
865147945|1|256112|10|\\ |||
865147946|2|856689|11|\\ |||
865147947|3|1021606|41|\\ |||
865147948|4|1061718|50|\\ |||
865147949|5|1495398|57|\\ |||
865147950|6|1495408|64|\\ |||
865147951|7|1613576|2|\\ |||
865147952|8|933324|52|\\ |||
865147953|9|933325|43|\\ |||
865147954|10|933327|41|\\ |||
865147955|11|933329|59|\\ |||
865147956|12|1258553|229|\\ |||
865147957|13|877410|33|\\ |||
865147958|14|26917|4|\\ |||
865147959|15|1472044|3|\\ |||
865147960|16|1079352|104|\\ |||
865147961|17|1195820|4|\\ |||
865147962|18|762|89|\\ |||
865147963|19|882896|77|\\ |||
865147964|20|517148|5|\\ |||
865147965|21|328755|9|\\ |||
865147966|22|964109|6|\\ |||
865147967|23|964108|6|\\ |||
865147968|24|964107|6|\\ |||
865147969|25|964106|13|\\ |||
865147970|26|867261|30|\\ |||
865147971|27|867249|127|\\ |||
865147972|28|166832|1|\\ |||
865147973|29|1136178|116|\\ |||
865147974|30|147841|18|\\ |||
865147975|31|882894|101|\\ |||
865147976|32|262865|34|\\ |||
865147977|33|198685|22|\\ |||
865147978|34|129|46|\\ |||
865147979|35|1547354|109|\\ |||
865147980|36|112336|6|\\ |||
865147981|37|1111999|10|\\ |||
865147982|38|1442|7|\\ |||
865147983|39|901708|166|\\ |||
865147984|40|901702|31|\\ |||
865147985|41|901704|5|\\ |||
865147986|42|1113840|9|\\ |||
865147987|43|737053|12|\\ |||
865147988|44|1348206|7|\\ |||
865147989|45|906433|81|\\ |||
865147990|46|900306|79|\\ |||
865147991|47|1384140|123|\\ |||
865147992|48|809697|12|\\ |||
865147993|49|274113|35|\\ |||
865147994|50|916920|40|\\ |||
865147995|51|891642|44|\\ |||
865147996|52|115676|15|\\ |||
865147997|53|1153854|4|\\ |||
865147998|54|127651|30|\\ |||
865147999|55|1467018|111|\\ |||
865148000|56|882891|1|\\ |||
865148001|57|257232|17|\\ |||
865148002|58|76130|30|\\ |||
865148003|59|129819|119|\\ |||
865148004|60|1556510|44|\\ |||
865148005|61|949924|2|\\ |||
865148006|62|201928|13|\\ |||
865148007|63|396998|2|\\ |||
865148008|64|650136|5|\\ |||
865148009|65|979412|14|\\ |||
865148010|66|979413|14|\\ |||
865148011|67|144630|60|\\ |||
865148012|68|1277748|21|\\ |||
865148013|69|730859|14|\\ |||
865148014|70|730858|6|\\ |||
865148015|71|266552|29|\\ |||
865148016|72|27258|10|\\ |||
865148017|73|1121495|7|\\ |||
865148018|74|52638|25|\\ |||
865148019|75|1202371|11|\\ |||
865148020|76|1226617|7|\\ |||
865148021|77|892707|26|\\ |||
865148022|78|633901|117|\\ |||
865148023|79|954118|51|\\ |||
865148024|80|916459|51|\\ |||
865148025|81|916461|18|\\ |||
865148026|82|916460|11|\\ |||
865148027|83|1471178|7|\\ |||
865148028|84|10018|1|\\ |||
865148029|85|710171|39|\\ |||
865148030|86|47585|66|\\ |||
865148031|87|1479872|12|\\ |||
865148032|88|76335|1|\\ |||
865148033|89|926648|15|\\ |||
865148034|90|33177|28|\\ |||
865148035|91|1243049|28|\\ |||
865148036|92|1203507|36|\\ |||
865148037|93|1547365|44|\\ |||
865148038|94|1547364|44|\\ |||
865148039|95|34468|17|\\ |||
865148040|96|254660|2|\\ |||
865148041|97|1647993|2|\\ |||
865148042|98|901703|112|\\ |||
865148043|99|919791|33|\\ |||
865148044|100|50718|10|\\ |||
865148045|101|434191|415|\\ |||
865148046|102|934504|1|\\ |||
865148047|103|1742607|4|\\ |||
865148048|104|148250|50|\\ |||
865148049|105|1252582|17|\\ |||
865148050|106|146162|11|\\ |||
865148051|107|491330|268|\\ |||
865148052|108|263350|70|\\ |||
865148053|109|107250|27|\\ |||
865148054|110|198|15|\\ |||
865148055|111|601885|3|\\ |||
865148056|112|253736|29|\\ |||
865148057|113|392958|10|\\ |||
865148058|114|73647|2|\\ |||
865148059|115|965722|50|\\ |||
865148060|116|19757|30|\\ |||
865148061|117|33055|3|\\ |||
865148062|118|1675999|13|\\ |||
865148063|119|257241|22|\\ |||
865148064|120|347861|9|\\ |||
865148065|121|917380|36|\\ |||
865148066|122|901705|4|\\ |||
865148067|123|1752211|1|\\ |||
865148068|124|874769|10|\\ |||
865148069|125|1593980|4|\\ |||
------------------------------
Sincerely,
Dennis
------------------------------
INFORMIX 14.10.FC10 on Ubuntu 22.04: No Problem. I get the XML and at the end: 1 row(s) retrieved. Mit freundlichen Grüßen - Kind regards Gerd Kaluzinski Consultant Software Services IBM Expert Labs DACH, Data & AI Phone: +49 175 228 1983 EMail: gerd.kaluzinski@de.ibm.com IBM Deutschland GmbH Vorsitzender des Aufsichtsrats: Sebastian Krause Geschäftsführung: Gregor Pillen (Vorsitzender), Nicole Reimer, Gabriele Schwarenthorer, Christine Rupp, Frank Theisen Sitz der Gesellschaft: Ehningen / Registergericht: Amtsgericht Stuttgart, HRB 14562 / WEEE-Reg.-Nr. DE 99369940