Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exceeding an arbitrary limit on number of SOL IPMI consoles causes conmand to crash on start #15

Closed
GoogleCodeExporter opened this issue Mar 17, 2015 · 2 comments
Labels
Milestone

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

Create a conman.conf file with 4,096 or more "console" entries, all using IPMI SOL, and try to run conmand. It will crash.

What version of the software are you using? On what operating system?

ConMan 0.2.7, CentOS 5.5 (kernel 2.6.18)

Please provide any additional information below.

The relevant defines:

#define IPMI_ENGINE_CONSOLES_PER_THREAD 128
#define IPMICONSOLE_THREAD_COUNT_MAX 32

When there are 4,096 or more consoles using IPMI SOL, the following line is run:

num_threads = ((num_consoles - 1) / IPMI_ENGINE_CONSOLES_PER_THREAD) + 1;

(this is on line 96 of the file server-ipmi.c. The math works out to: ((4096 - 1) / 128) + 1. That goes to 33 when num_consoles is >= 4096. But 33 is greater than IPMICONSOLE_THREAD_COUNT_MAX, and libipmiconsole refuses to initialize the engine.

The workaround is to make sure that num_threads never exceeds IPMICONSOLE_THREAD_COUNT_MAX:

Mark-Pettits-Twitter-Laptop:~/conman/conman$ git diff
diff --git a/server-ipmi.c b/server-ipmi.c
index ba2ec65..2b7775a 100644
--- a/server-ipmi.c
+++ b/server-ipmi.c
@@ -93,6 +93,7 @@ void ipmi_init(int num_consoles)
         return;
     }
     num_threads = ((num_consoles - 1) / IPMI_ENGINE_CONSOLES_PER_THREAD) + 1;
+    num_threads = MIN(num_threads, IPMICONSOLE_THREAD_COUNT_MAX);

     if (ipmiconsole_engine_init(num_threads, 0) < 0) {
         log_err(0, "Unable to start IPMI SOL engine");

Original issue reported on code.google.com by markkawikapettit on 27 Nov 2012 at 7:16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants