question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't install with 64-bit Python3 on AIX 7.1

See original GitHub issue

With Python3 from IBM’s AIX Toolbox site, I can’t install psutil. It fails to build the C code:

psutil/arch/aix/net_connections.c:63:15: error: 'struct mbuf' has no member named 'm_len'
         if (mb.m_len > sizeof(struct sockaddr_un))
               ^
psutil/arch/aix/net_connections.c:64:15: error: 'struct mbuf' has no member named 'm_len'
             mb.m_len = sizeof(struct sockaddr_un);
               ^
psutil/arch/aix/net_connections.c:65:26: error: 'struct mbuf' has no member named 'm_len'
         *((char *)ua + mb.m_len - 1) = '\0';
                          ^

This build of Python is 64-bit:

$ python3 -c 'import struct; print(struct.calcsize("P"))'
8

I can get it to build by editing psutil/arch/aix/net_kernel_structs.h to move the last #define outside of the conditional.

$ git diff | cat
diff --git a/psutil/arch/aix/net_kernel_structs.h b/psutil/arch/aix/net_kernel_structs.h
index 09f320ff..11e343d8 100644
--- a/psutil/arch/aix/net_kernel_structs.h
+++ b/psutil/arch/aix/net_kernel_structs.h
@@ -105,6 +105,6 @@ struct mbuf64
     struct m_hdr64 m_hdr;
 };

-#define m_len               m_hdr.mh_len
+#endif

-#endif
\ No newline at end of file
+#define m_len               m_hdr.mh_len

But, I assume this was inside the conditional for a reason, most likely that it will break on other AIX versions which I don’t have access to test on.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
wiggin15commented, Feb 14, 2019

@tbrownaw can you please try this fix instead?

diff --git a/psutil/arch/aix/net_kernel_structs.h b/psutil/arch/aix/net_kernel_structs.h
index 09f320ff..60194f80 100644
--- a/psutil/arch/aix/net_kernel_structs.h
+++ b/psutil/arch/aix/net_kernel_structs.h
@@ -18,6 +18,7 @@
 #include <sys/protosw.h>
 #include <sys/unpcb.h>
 #include <sys/mbuf_base.h>
+#include <sys/mbuf_macro.h>
 #include <netinet/ip_var.h>
 #include <netinet/tcp.h>
 #include <netinet/tcpip.h>
0reactions
giampaolocommented, Feb 14, 2019

Thanks Arnon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Install Python3 (AIX 7.1) | AIX Open Source - IBM Community
9. Re: Install Python3 (AIX 7.1) As i mentioned earlier, remove the openssl rpm & get the openssl installp package from AIX web...
Read more >
Not able to install Python3 on AIX server - Stack Overflow
Show activity on this post. I am trying to install Python 3 on a AIX server. I got the Python 3 RPM file...
Read more >
How to Install Python 3.11.0 on Windows 7, 10 or ... - YouTube
python # python3 #programming hey guys in this tutorial I'll show you how to download and install Python 3.11.0 on your Windows OS....
Read more >
4. Using Python on Windows — Python 3.11.1 documentation
This document aims to give an overview of Windows-specific behaviour you should know about when using Python on Microsoft Windows. Unlike most Unix...
Read more >
How to install Python the smart way - InfoWorld
Windows users can run 32-bit editions of Python on 64-bit Windows, ... directory (e.g. C:\Python3.7 ) to make it easier to find.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found