-
Notifications
You must be signed in to change notification settings - Fork 368
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
Latest waagent coredumps python interpreter when started at boot on FreeBSD #1687
Comments
|
@minusbat - could you capture a verbose log? it may point us to where the problem is. In /etc/waagent.conf, set this this to 'y': The log will be in /var/log/waagent.log Thanks |
|
OK, just doing that now.... |
|
here you are... I think its just repeating over and over again, so I stopped it and uploaded what there is... |
|
Thank you. The stack trace from the core dump seems to indicate a problem while initializing python3. Could you see if these 2 commands produce the same issue? Also, could you see if you can execute other Python scripts using python3? |
|
Python3 works fine exverywhere - but bear in mind that the coredumps only happen when waagent is started at boot time. It doesn't coredump if I start it from a shell. So testing anything will involve changing what it does on boot and rebooting the machine. Am not sure how to chnage the interpreter from 'python' to 'python3'. By the way, if I execute those commands directly at the command line they both do this: |
|
Could this be something to do with the environment in which rc.d scripts are executed at boot time compared to from the shell ? Is waagent needed for any part of the boot process - I could try changign the rc.d script to make it start much later in the process... after login for example ? |
|
'python and 'python3' are indentical by the way: |
|
Thanks. The tasks performed by the Linux Agent are split in 2 processes, which in this case are executing the same script (/usr/local/sbin/waagent) with 2 different command line options: -daemon and -run-exthandlers. The system starts the first process, and that process is running fine. But when this process tries to start the same script with -run-exthandlers then Python is crashing on initialization. I see here https://github.com/Azure/WALinuxAgent/blob/develop/init/freebsd/waagent#L14 that -daemon process is started with "python", while the logs show that the -run-exthandlers is started with "python3", but you already confirmed that they are the same binary, and that -run-exthandlers runs fine from the command line. Sorry, at this point I do not have other suggestions for you, but I'll let you know if I think of any. As far as moving the agent later in the boot process... not sure if that'll work. Do you know if FreeBSD is provisioned in Azure using cloud-init? If not, then the agent is required to provision new VMs. |
|
Its midnight ere, so am going to have to stop trying stuff, but I did try moving the startup to much later in the process, but with no effect. I always create new machines in Azure byu clonign old ones, so I don't need any of the provisioning features. If it is possible to simply run without waagent then that would be a solution for me - but I would quite like to have this fixed, as would you I suspect! I'll do some more experiments tomorrow, and also maybe look into what the difference is between starring a script at boot compared to from a shell. Thanks. |
|
Expressing interest in this issue. If i can replicate the issue or discover any solution I'll update the thread. |
|
There has been some discussion of it over on the FreeBSD STABLE mailing list: https://lists.freebsd.org/pipermail/freebsd-stable/2019-November/thread.html Should eb easy to reprodcue, but tracking down has proved elusive for me! Let me know how you get on or if you have any ideas I could try. Just capturing the stderr from the subprocess would help. |
|
With help from @delphij, we found the error log via ktrace: https://gist.github.com/lwhsu/c020efbd6388fe1636b5ca31baaa1eee and led to: https://bugs.python.org/issue32849 But this fix is only in Python >= 3.7. I tried to backport the patch to 3.6 and waagent can start at the boot without dumping core. I will work on backporting this to FreeBSD's lang/python36 port. |
This is needed for starting sysutils/azure-agent at boot: Azure/WALinuxAgent#1687 Obtained from: python/cpython@f9c01a1 MFH: 2019Q4 Sponsored by: The FreeBSD Foundation git-svn-id: svn+ssh://svn.freebsd.org/ports/head@519241 35697150-7ecd-e111-bb59-0022644237b5
This is needed for starting sysutils/azure-agent at boot: Azure/WALinuxAgent#1687 Obtained from: python/cpython@f9c01a1 MFH: 2019Q4 Sponsored by: The FreeBSD Foundation
Fix namespace pollution in python3.5 and python3.6 (upstreamed fix) The standard math library (libm) may follow IEEE-754 recommendation to include an implementation of sinPi(), i.e. sinPi(x):=sin(pi*x). And this triggers a name clash, found by FreeBSD developer Steve Kargl, who worked on putting sinpi into libm used on FreeBSD (it has to be named "sinpi", not "sinPi", cf. e.g. https://en.cppreference.com/w/c/experimental/fpext4). - python2.7 and > 3.6 are already fixed PR: 232792 Submitted by: Steve Kargl <sgk@troutmask.apl.washington.edu>, Dima Pasechnik <dimpase+freebsd@gmail.com> Approved by: python (maintainer timeout) Obtained from: python/cpython@b545ba0 Backport fix of https://bugs.python.org/issue32849 This is needed for starting sysutils/azure-agent at boot: Azure/WALinuxAgent#1687 Obtained from: python/cpython@f9c01a1 Sponsored by: The FreeBSD Foundation Fix makefile ordering. Reported by: mat Approved by: ports-secteam (miwi) Sponsored by: The FreeBSD Foundation
This is needed for starting sysutils/azure-agent at boot: Azure/WALinuxAgent#1687 Obtained from: python/cpython@f9c01a1 MFH: 2019Q4 Sponsored by: The FreeBSD Foundation git-svn-id: svn+ssh://svn.freebsd.org/ports/head@519241 35697150-7ecd-e111-bb59-0022644237b5
|
This should be fixed and the default Python version of FreeBSD has been updated to 3.7. |
|
I can verify that its fixed for me, and works with the latest default python. Thank you - I never would have found this on my own given the nature of the bug! |
Fix namespace pollution in python3.5 and python3.6 (upstreamed fix) The standard math library (libm) may follow IEEE-754 recommendation to include an implementation of sinPi(), i.e. sinPi(x):=sin(pi*x). And this triggers a name clash, found by FreeBSD developer Steve Kargl, who worked on putting sinpi into libm used on FreeBSD (it has to be named "sinpi", not "sinPi", cf. e.g. https://en.cppreference.com/w/c/experimental/fpext4). - python2.7 and > 3.6 are already fixed PR: 232792 Submitted by: Steve Kargl <sgk@troutmask.apl.washington.edu>, Dima Pasechnik <dimpase+freebsd@gmail.com> Approved by: python (maintainer timeout) Obtained from: python/cpython@b545ba0 Backport fix of https://bugs.python.org/issue32849 This is needed for starting sysutils/azure-agent at boot: Azure/WALinuxAgent#1687 Obtained from: python/cpython@f9c01a1 Sponsored by: The FreeBSD Foundation Fix makefile ordering. Reported by: mat Approved by: ports-secteam (miwi) Sponsored by: The FreeBSD Foundation
This is needed for starting sysutils/azure-agent at boot: Azure/WALinuxAgent#1687 Obtained from: python/cpython@f9c01a1 MFH: 2019Q4 Sponsored by: The FreeBSD Foundation
'I am running the latest waagent on the 'develop branch. Operating system is FreeBSD 12.1 and I am using python3.6 which is the current default python in FreeBSD. Have removed all traces of older python 2.7.
When I run this using 'service waagent start' logged in as root then it runs fine.
If, however, I reboot the machine, and waagent is started on boot, then I find this repeated in dmesg:
It keeps trying to start it and then coredumping. If I run gdb against the coredump I see this:
The text was updated successfully, but these errors were encountered: