Thanks Art.
The peculiar usage of "/dev/null" appears to be a legacy decision.
However, have replaced most filetoblob("/dev/null", "server") references with NULL. One was an INSERT INTO a specific variable, so just used "0" (SPL parser didn't like NULL).
The error 22 was tracked down to the following call:
...
12819 0.000166 open("/dev/null", 16384, 00 <unfinished ...>
12819 0.000135 SYS_openat(0xffffff9c, 0x6cae2fe0, 0x4000, 0) = -22
...
For some bizarre reason, 0x4000 is used as the oflag when opening /dev/null in the specific VM environment I'm using (?)
However, when I use the exact same installation (installer, installer options, with a default server), on a different VM, the oflag is 0x00.
Note: Both VMs are using the same exact Linux OS.
Which strongly implies it's the underlying VM implementation doing some weird things.
The "failing" VM is VMWare, the successful one is VirtualBox.
It's not an issue for us at the moment, with the workaround above, but, interesting to note.
Kind regards,
Daniil
Original Message:
Sent: Thu June 11, 2020 06:53 AM
From: Art Kagel
Subject: filetoblob error with /dev/null
Danil:
Not sure why it works on one system and not another. I can say that errno 22 is a system call error indicating that there is an invalid argument to some system call.
However, I would wonder why you are trying to insert "/dev/null" to a BLOB type column? Do you want to insert a NULL BLOB? If so, this would be the statement:
insert into foo values (NULL);
Witness:
> create temp table foo (x blob) with no log;
Temporary table created.
> insert into foo values (NULL);
1 row(s) inserted.
> select * from foo;
x <SBlob Data>
1 row(s) retrieved.
Art
Art S. Kagel, President and Principal Consultant
ASK Database Management
Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves.
Original Message:
Sent: 6/11/2020 6:22:00 AM
From: Daniil T
Subject: filetoblob error with /dev/null
Greetings,
The following statements:
create temp table foo (x blob) with no log;
insert into foo values ( filetoblob('/dev/null', 'server') );
Throw a "22: Invalid argument" error on one of our servers.
However, I can run the same statements on a simple server (dev licensed), with no issues at all.
In both cases I run the statements as user informix.
Also, the informix user can read from or write to /dev/null in either server without any issues from the command shell.
I'd happily trace the appropriate oninit process, if I knew how to isolate it, or even if I knew how to reduce the number oninit's to a bare minimum, so as to make the trace more manageable.
Any ideas as to what the issue might be, or how I could reveal the underlying cause would be much appreciated.
Thanks in advance.
#Informix