sendmsg fails with error code 9 - linux

While running ldapsearch utility in Linux, the "sendmsg" function fails with an error code 9. What does error code 9 represent? The man page does not give information about error codes.

You can find all error codes in this page. http://www.virtsync.com/c-error-codes-include-errno . Currently I am taking same result. "send" method works but sendmsg is returning -1 and errno is 9 which means bad file number. I still don't know what the problem is.
#define EBADF 9 /* Bad file number */

Related

How to suppress warnings messages in Rcpp/RcppArmadillo functions

I am using RcppArmadillo within an R package. I want to suppress a warning message that occurs in a C++ function due to numerical precision when a symmetric matrix fails a test of symmetry within eig_sym(). I am confident this is a precision issue as I have saved some of the matrices hitting this warning and tested them in R using isSymmetric() and they pass this.
I have tried including #define ARMA_WARN_LEVEL 0 at the top of the header file where the function with this issue is defined, but this does not solve my issue and I am told 'ARMA_WARN_LEVEL' macro redefined (presumably it is defined in the config file of RcppArmadillo).
Ideally I would suppress only errors associated with this call of eig_sym, but failing this I am content to suppress all warnings. If anyone can advise on how to effect this I would be very grateful.
Thank you.
Looking at Armadillo's config.hpp -- the first header file included by Armadillo -- we see that it starts with
#if !defined(ARMA_WARN_LEVEL)
#define ARMA_WARN_LEVEL 2
#endif
//// The level of warning messages printed to ARMA_CERR_STREAM.
//// Must be an integer >= 0. The default value is 2.
//// 0 = no warnings
//// 1 = only critical warnings about arguments and/or data which are likely to lead to incorrect results
//// 2 = as per level 1, and warnings about poorly conditioned systems (low rcond) detected by solve(), spsolve(), etc
//// 3 = as per level 2, and warnings about failed decompositions, failed saving/loading, etc
so a simple
#define ARMA_WARN_LEVEL 0
#include <RcppArmadillo.h>
should take care of things. We cannot "show" this as we have no reproducible example to work with.
Also note that there is a good reason why warnings are usually on. They signal something you as author should be aware of.

Laravel: Too few arguments to function Vonage\Client::Vonage\{closure}(), 4 passed and exactly 5 expected

I am trying to make a sms notification using nexmo. I dont know what it means Too few arguments to function Vonage\Client::Vonage{closure}(), 4 passed and exactly 5 expected. I was trying to search for the error and it said the error is in line 145 from folder vendor\nexmo\client-core\src\Client.php on line 145enter image description here

Numbers given in error messages in Node.js

I don't understand well the numbers given by error messages in general with Node.js
at /home/gbusey/file.js:525:2
at Frobnicator.refrobulate (/home/gbusey/business-logic.js:424:21)
at Actor.<anonymous> (/home/gbusey/actors.js:400:8)
at increaseSynergy (/home/gbusey/actors.js:701:6)
In the previous message for example, what does 525:2 mean ?
(I dont write code because my question is not about a particular code but about the number in the error messages in general)
That is called a stacktrace.
The function calls through which the error is propagated is shown. The numbers you are asking about represent <line number>:<column number> in the file.
Check the error stack section in the docs.
what does 525:2 mean
Line 525, offset 2 (of the file /home/gbusey/file.js)
The numbers are line:position, so 252:2 would be that the program stopped on line 252 at the second character.

Fortran error check on formatted read

In my code I am attempting to read in output files that may or may not have a formatted integer in the first line of the file. To aid backwards compatibility I am attempting to be able to read in both examples as shown below.
head -n 3 infile_new
22
8
98677.966601475651 -35846.869655806520 3523978.2959464169
or
head -n 3 infile_old
8
98677.966601475651 -35846.869655806520 3523978.2959464169
101205.49395364164 -36765.047712555031 3614241.1159234559
The format of the top line of infile_new is '(i5)' and so I can accommodate this in my code with a standard read statement of
read(iunit, '(I5)' ) n
This works fine, but if I attempt to read in infile_old using this, I as expected get an error. I have attempted to get around this by using the following
read(iunit, '(I5)' , iostat=ios, err=110) n
110 if(ios == 0) then
print*, 'error in file, setting n'
naBuffer = na
!rewind(iunit) #not sure whether to rewind or close/open to reset file position
close(iunit)
open (iunit, file=fname, status='unknown')
else
print*, "Something very wrong in particle_inout"
end if
The problem here is that when reading in either the old or new file the code ends up in the error loop. I've not been able to find much documentation on using the read statement in this way, but cannot determine what is going wrong.
My one theory was my use of ios==0 in the if statement, but figured since I shouldn't have an error when reading the new file it shouldn't matter. It would be great to know if anyone knows a way to catch such errors.
From what you've shown us, after the code executes the read statement it executes the statement labelled 110. Then, if there wasn't an error and iostat==0 the true branch of the if construct is executed.
So, if there is an error in the read the code jumps to that statement, if there isn't it walks to the same statement. The code doesn't magically know to not execute the code starting at label 110 if there isn't an error in the read statement. Personally I've never used both iostat and err in the same read statement and here I think it's tripping you up.
Try changing the read statement to
read(iunit, '(I5)' , iostat=ios) n
You'd then need to re-work your if construct a bit, since iostat==0 is not an error condition.
Incidentally, to read a line which is known to contain only one integer I wouldn't use an explicit format, I'd just use
read(iunit, * , iostat=ios) n
and let the run-time worry about how big the integer is and where to find it.

Poll is causing crash

I am getting a crash with following values :-
Poll is the system call in use
giving "errno" as 24 (EMFILE)
and struct pollfd has values "fd = 1022, events = 1, revents = 32"
Here we are woking on "fd = 1022" then why it is showing "errno" as 24 (EMFILE /Too many files open/)
I have multiple threads which works in an Infinite loop.
On my machine, ulimit -a shows 1024 for max open files. 1022 is really close to that limit.
Do you have code that is trying to open a file and is failing? It is probably some other system call that is setting errno to EMFILE.
Make sure you're handling return values from code that opens fds.
Make sure you're not leaking file descriptors somewhere.
If this code runs with appropriate privileges, you can try increasing the max open file limit with ulimit -n or setrlimit().

Resources