Skip to content

Instantly share code, notes, and snippets.

@ihabunek
Last active September 2, 2016 05:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihabunek/6054022 to your computer and use it in GitHub Desktop.
Save ihabunek/6054022 to your computer and use it in GitHub Desktop.
How to crash Informix 11.70.UC7GE

Create the following stored procedure:

CREATE DBA PROCEDURE foo
(
    foo01 NVARCHAR(255),
    foo02 NCHAR(50),
    foo03 NCHAR(100),
    foo04 NCHAR(12),
    foo05 NCHAR(8),
    foo06 NCHAR(12),
    foo07 NCHAR(12),
    foo08 INTEGER,
    foo09 NCHAR(4),
    foo10 NCHAR(255),
    foo11 NCHAR(255),
    foo12 FLOAT,
    foo13 DATETIME MONTH TO DAY,
    foo14 DATETIME MONTH TO DAY,
    foo15 INTERVAL YEAR TO YEAR,
    foo16 NCHAR(255),
    foo17 FLOAT
)

END PROCEDURE;

Then run this query:

SELECT ifx_param_types(procid)
FROM sysprocedures 
WHERE procname = 'foo';

Generated error:

[Error Code: -9791, SQL State: IX000]  User Defined Routine (ifx_param_types) execution failed.

From the online.log:

07/22/13 15:55:07  Assert Failed: Exception Caught. Type: MT_EX_OS, Context: mem
07/22/13 15:55:07  IBM Informix Dynamic Server Version 11.70.UC7GE
07/22/13 15:55:07   Who: Session(5, informix@[CENSORED MACHINE NAME], -1, 0x65723750)
                Thread(126, sqlexec, 65704ab0, 8)
                File: mtex.c Line: 416
07/22/13 15:55:07   Action: Please notify IBM Informix Technical Support.
07/22/13 15:55:07  stack trace for pid 27767 written to /opt/informix/_IDS_SYS_LOG_/af.46639ba
07/22/13 15:55:07   See Also: /opt/informix/_IDS_SYS_LOG_/af.46639ba
07/22/13 15:55:08  Exception Caught. Type: MT_EX_OS, Context: mem
07/22/13 15:55:08  (-9791): ERROR: Routine execution trap -- procname=<ifx_param_types> procid=7
    reason: mem

Note: replaced machine name with [CENSORED MACHINE NAME].

@nurettin
Copy link

nurettin commented Sep 2, 2016

Same error happens when I use row_number() over(...) in a cursor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment