Giter VIP home page Giter VIP logo

Comments (35)

octo avatar octo commented on May 22, 2024

Looks like an invalid argument to host_processors:

#define KERN_INVALID_ARGUMENT       4
        /* The function requested was not applicable to this
         * type of argument, or an argument is invalid
         */

from collectd.

octo avatar octo commented on May 22, 2024

From http://www.linuxselfhelp.com/gnu/machinfo/html_chapter/mach_9.html:
"This function returns KERN_SUCCESS if the call succeeded, KERN_INVALID_ARGUMENT if host_priv is not a privileged host port, and KERN_INVALID_ADDRESS if processor_count points to inaccessible memory."

from collectd.

ChrisLundquist avatar ChrisLundquist commented on May 22, 2024

I can reproduce this as well details can be found #72 (comment)

from collectd.

ChrisLundquist avatar ChrisLundquist commented on May 22, 2024

@octo We should be able to close this issue as #72 is closed. One step closer to 4.10 :)

from collectd.

octo avatar octo commented on May 22, 2024

Hi Chris,

how are the two issues related? Is this fixed and working now?

Best regards,
โ€”octo

from collectd.

ChrisLundquist avatar ChrisLundquist commented on May 22, 2024

I am confused as well. I must have been mistaken. I think I just wanted to confirm the issue and then later made the mistake of thinking it was resolved / related. This indeed does appear to be a different issue, my apologies.

from collectd.

dpzmick avatar dpzmick commented on May 22, 2024

This issue does not seem to be closed. I am getting the same error with a git clone I just made.

OS X 10.8

from collectd.

dpzmick avatar dpzmick commented on May 22, 2024

Nevermind. I noticed some permissions errors showing up in logs. Needed to run as root!

from collectd.

schmurfy avatar schmurfy commented on May 22, 2024

still not working for me with 5.3 on OSX 10.8:

$ sudo collectd -f
,[2013-07-15 09:54:50] cpu plugin: Found 4 processors.
[2013-07-15 09:54:50] cpu plugin: processor_info failed: (os/kern) failure
[2013-07-15 09:54:50] cpu plugin: processor_info failed: (os/kern) failure
[2013-07-15 09:54:50] Initialization complete, entering read-loop.


[2013-07-15 09:54:58] cpu plugin: processor_info failed: (os/kern) failure
[2013-07-15 09:55:08] cpu plugin: processor_info failed: (os/kern) failure
[2013-07-15 09:55:28] cpu plugin: processor_info failed: (os/kern) failure
[2013-07-15 09:56:18] cpu plugin: processor_info failed: (os/kern) failure

This problem has been there since I started using collectd, cpu just never worked on my dev machine ;)
I can provide more infos if I know what to look for.

from collectd.

schmurfy avatar schmurfy commented on May 22, 2024

After doing some more tests the failure logged do not appear to cause any problem, the cpu stats are reported despite the error.

from collectd.

dpzmick avatar dpzmick commented on May 22, 2024

Same thing happens here. Plugin works, but claims to not be working. Here are log messages:

Jul 17 23:53:04 misao collectd[33503]: cpu plugin: processor_info failed: (os/kern) failure
Jul 17 23:53:04 misao kernel[0]: cpu_info(268435458,5,0xffffff801e76248c,0xffffff801e762488) not implemented

from collectd.

lorenzfischer avatar lorenzfischer commented on May 22, 2024

@dpzmick: do you remember which permissions the plugin complained about? I cannot run as root and I also don't have access to syslog :-(

from collectd.

dpzmick avatar dpzmick commented on May 22, 2024

@lorenzfischer I don't sorry. That machine is long gone now :/

from collectd.

dch avatar dch commented on May 22, 2024

OK I can repro this atm, on a macbook pro 15" running Mavericks. I've got a debug enabled build and can provide whatever is needed here, incl access if thats useful.

from collectd.

dch avatar dch commented on May 22, 2024
Created new plugin context.
[2014-06-05 19:34:45] [info] cpu plugin: Found 8 processors.
[2014-06-05 19:34:45] [error] cpu plugin: processor_info failed: (os/kern) failure
[2014-06-05 19:34:45] [error] cpu plugin: processor_info failed: (os/kern) failure
[2014-06-05 19:34:45] [debug] plugin_dispatch_values: time = 1401989685.821; interval = 5.000; host = akai.skunkwerks.at; plugin = cpu; plugin_instance = 0; type = cpu; type_instance = user;
[2014-06-05 19:34:45] [debug] plugin_dispatch_values: time = 1401989685.821; interval = 5.000; host = akai.skunkwerks.at; plugin = cpu; plugin_instance = 0; type = cpu; type_instance = nice;
[2014-06-05 19:34:45] [debug] plugin_dispatch_values: time = 1401989685.821; interval = 5.000; host = akai.skunkwerks.at; plugin = cpu; plugin_instance = 0; type = cpu; type_instance = system;
[2014-06-05 19:34:45] [debug] plugin_dispatch_values: time = 1401989685.822; interval = 5.000; host = akai.skunkwerks.at; plugin = cpu; plugin_instance = 0; type = cpu; type_instance = idle;
[2014-06-05 19:34:45] [debug] plugin_dispatch_values: time = 1401989685.822; interval = 5.000; host = akai.skunkwerks.at; plugin = cpu; plugin_instance = 1; type = cpu; type_instance = user;
[2014-06-05 19:34:45] [debug] uc_insert: Added akai.skunkwerks.at/cpu-0/cpu-user to the cache.
[2014-06-05 19:34:45] [error] cpu plugin: processor_info failed: (os/kern) failure
[2014-06-05 19:34:45] [debug] uc_insert: Added akai.skunkwerks.at/cpu-0/cpu-nice to the cache.
[2014-06-05 19:34:45] [debug] uc_insert: Added akai.skunkwerks.at/cpu-0/cpu-system to the cache.
[2014-06-05 19:34:45] [debug] uc_insert: Added akai.skunkwerks.at/cpu-0/cpu-idle to the cache.
[2014-06-05 19:34:45] [debug] uc_insert: Added akai.skunkwerks.at/cpu-1/cpu-user to the cache.
[2014-06-05 19:34:45] [debug] write_riemann plugin: Successfully created protobuf for metric: host = "akai.skunkwerks.at", service = "cpu-0/cpu-user"
[2014-06-05 19:34:45] [debug] write_riemann plugin: Successfully created protobuf for metric: host = "akai.skunkwerks.at", service = "cpu-0/cpu-nice"
[2014-06-05 19:34:45] [debug] write_riemann plugin: Successfully created protobuf for metric: host = "akai.skunkwerks.at", service = "cpu-0/cpu-system"
[2014-06-05 19:34:45] [debug] write_riemann plugin: Successfully created protobuf for metric: host = "akai.skunkwerks.at", service = "cpu-0/cpu-idle"
[2014-06-05 19:34:45] [debug] write_riemann plugin: Successfully created protobuf for metric: host = "akai.skunkwerks.at", service = "cpu-1/cpu-user"
[2014-06-05 19:34:45] [debug] name = collectd; num_proc = 2; num_lwp = 17; vmem_size = 5106257920; vmem_rss = 6897664; vmem_data = 0; vmem_code = 0; vmem_minflt_counter = 280; vmem_majflt_counter = 17700; cpu_user_counter = 4817609760; cpu_system_counter = 8825174929; io_rchar = -1; io_wchar = -1; io_syscr = -1; io_syscw = -1;
[2014-06-05 19:34:45] [debug] name = beam; num_proc = 1; num_lwp = 35; vmem_size = 2840875008; vmem_rss = 82137088; vmem_data = 0; vmem_code = 0; vmem_minflt_counter = 502; vmem_majflt_counter = 28684; cpu_user_counter = 51953853006; cpu_system_counter = 6779186057; io_rchar = -1; io_wchar = -1; io_syscr = -1; io_syscw = -1;
[2014-06-05 19:34:45] [debug] name = java; num_proc = 0; num_lwp = 0; vmem_size = 0; vmem_rss = 0; vmem_data = 0; vmem_code = 0; vmem_minflt_counter = 0; vmem_majflt_counter = 0; cpu_user_counter = 0; cpu_system_counter = 0; io_rchar = -1; io_wchar = -1; io_syscr = -1; io_syscw = -1;

from collectd.

ojilles avatar ojilles commented on May 22, 2024

Still here, indeed. (Fails on all my Macs)

from collectd.

octo avatar octo commented on May 22, 2024

[2014-06-05 19:34:45] [error] cpu plugin: processor_info failed: (os/kern) failure

This error appears to be returned when querying the PROCESSOR_TEMPERATURE property. This at least explains why the plugin "appears to be working": Reading the cpu performance works, but reading the temperature fails.

from collectd.

ChrisLundquist avatar ChrisLundquist commented on May 22, 2024

Prior Art for reading CPU temps on OS X

from collectd.

octo avatar octo commented on May 22, 2024

Thanks Chris! It actually very much looks like the temperature is (attempted to be) read, but after that the variable holding the temperature is never touched again, making this an entirely pointless endeavor.

Since this doesn't appear to break backwards compatibility, I'll likely just remove the code from the cpu plugin entirely and look into adding it to the apple_sensors plugin instead.

from collectd.

ChrisLundquist avatar ChrisLundquist commented on May 22, 2024

๐Ÿ‘ That would simplify the cross platform concerns, and make for less code to maintain.

from collectd.

ojilles avatar ojilles commented on May 22, 2024

Thanks for very swift action!

from collectd.

ifesdjeen avatar ifesdjeen commented on May 22, 2024

Still fails on master...

cpu plugin: host_processors returned 4
Initialization of plugin `cpu' failed with status -1. Plugin will be unloaded.

from collectd.

HakShak avatar HakShak commented on May 22, 2024

Yeah, same here with 5.4 using homebrew on OSX 10.10.1

I get the log error and I also don't get any data for the CPU in graphite (everything else is working fine). There really isn't anywhere f710030 could have been reverted...

from collectd.

ilyaevseev avatar ilyaevseev commented on May 22, 2024

The problem still actual.
Mac OS X 10.8.5, Collectd 5.4.1 from Homebrew:

[error] cpu plugin: processor_info failed: (os/kern) failure

from collectd.

mfournier avatar mfournier commented on May 22, 2024

On Tue, Mar 03, 2015 at 12:41:11PM -0800, Ilya Evseev wrote:

The problem still actual.
Mac OS X 10.8.5, Collectd 5.4.1 from Homebrew:

Yes, 5.4.1 is know to have this problem. Give 5.4.2 a try please, and let
us know if you encounter any problem.

from collectd.

philhq avatar philhq commented on May 22, 2024

I'm running 5.4.2 and I have the same error.

from collectd.

mfournier avatar mfournier commented on May 22, 2024

OK, so it seems there is another issue resulting in the same error message. Can somebody build collectd with --enable-debug and post a gdb backtrace of the crash ? Thanks!

from collectd.

theoriginalgri avatar theoriginalgri commented on May 22, 2024

I built 5.4.2 with --enable-debug. Even though I don't see any [debug] messages.

My log (cleared prior to start):

08.05.15 20:43:23,824 collectd[75864]: cpu plugin: host_processors returned 4
08.05.15 20:43:23,824 collectd[75864]: Initialization of plugin `cpu' failed with status -1. Plugin will be unloaded.

Executing plugin test (-f -T):

Created new plugin context.
[New Thread 0x1047 of process 75864]
[New Thread 0x1203 of process 75864]
[New Thread 0x1303 of process 75864]
[New Thread 0x1403 of process 75864]
[New Thread 0x1503 of process 75864]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x1047 of process 75864]
0x000000010000ab08 in plugin_write (plugin=<optimized out>, ds=<optimized out>, vl=0x100200090) at plugin.c:1650
1650          status = (*callback) (ds, vl, &cf->cf_udata);
(gdb) bt
#0  0x000000010000ab08 in plugin_write (plugin=<optimized out>, ds=<optimized out>, vl=0x100200090) at plugin.c:1650
#1  0x00000001000067e7 in fc_bit_write_invoke (ds=0x7fff83a4b101 <__psynch_cvclrprepost+5>, vl=0x240056e429dafce5, meta=<optimized out>,
    user_data=<optimized out>) at filter_chain.c:708
#2  fc_default_action (ds=0x100200090, vl=0x1002003c8) at filter_chain.c:1041
#3  0x000000010000c9d9 in plugin_dispatch_values_internal (vl=<optimized out>) at plugin.c:1989
#4  plugin_write_thread (args=<optimized out>) at plugin.c:734
#5  0x00007fff909e4268 in _pthread_body () from /usr/lib/system/libsystem_pthread.dylib
#6  0x00007fff909e41e5 in _pthread_start () from /usr/lib/system/libsystem_pthread.dylib
#7  0x00007fff909e241d in thread_start () from /usr/lib/system/libsystem_pthread.dylib
#8  0x0000000000000000 in ?? ()
(gdb)

from collectd.

digitalrinaldo avatar digitalrinaldo commented on May 22, 2024

Is there any update on this issue. I am seeing this on OSX 10

/usr/local/Cellar/collectd/5.4.2/sbin/collectd -C /usr/local/etc/collectd.conf -T -f
[2015-07-06 07:54:20] cpu plugin: host_processors returned 4
[2015-07-06 07:54:20] Initialization of plugin `cpu' failed with status -1. Plugin will be unloaded.

from collectd.

maikelvdh avatar maikelvdh commented on May 22, 2024

Actually facing the same problem when running it as current active user, but seem to get it passing when running collectd as root. The mach_host_self() doesnโ€™t return the privileged host_priv port to non-root users in fact.

from collectd.

maireadmccabe avatar maireadmccabe commented on May 22, 2024

I'm running into the same issue on OS X 10, I was wondering if anybody has a work around as the cpu stats don't seem to be getting reported because of this issues. See below for messages found in syslog

cpu plugin: host_processors returned 4
Initialisation of plugin `cpu' failed with status -1. Plugin will be unloaded.

from collectd.

ryan-williams avatar ryan-williams commented on May 22, 2024

Same error here, collectd 5.5.0 on OSX 10.11.1, whether running collectd as my user or root.

Update: seems like it is actually reporting stats correctly now that I run as root; I guess I was mistaken!

from collectd.

octo avatar octo commented on May 22, 2024

Thanks @maikelvdh and @ryan-williams, I'll improve the logged error message. If there's any way to get a processor_t without a privileged host control port, please let me know :)

โ€”octo

from collectd.

rubenk avatar rubenk commented on May 22, 2024

I'm going to close this, since there's not much more we can from our point of view, sorry.

from collectd.

philippelatulippe avatar philippelatulippe commented on May 22, 2024

XRG uses a non-privileged call to retrieve CPU info:
https://github.com/mikepj/XRG/blob/f45e5b9a2d30816271d3f90d73bc937100c643b7/Data%20Miners/XRGCPUMiner.m

Maybe this issue could be re-opened as a feature request?

from collectd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.