Package: micropython
Version: 1.14+ds-1
Followup-For: Bug #988267
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu impish ubuntu-patch
Control: tags -1 patch

Dear Maintainer,

   * Micropython FTBFS on multiple architectures
   * Fixed by pulling in upstream change of variable type

*** /tmp/tmpvi9f9xor/bug_body

In Ubuntu, the attached patch was applied to achieve the following:

Successfully building mircopython on all architectures. These failures
are ocurring in Debian as well.

  * Change subpkg_tried to a static variable to avoid clobbering by longjmp
    (LP: #1931955)


Thanks for considering the patch.


-- System Information:
Debian Release: bullseye/sid
  APT prefers hirsute-updates
  APT policy: (500, 'hirsute-updates'), (500, 'hirsute-security'), (500, 
'hirsute')
Architecture: arm64 (aarch64)

Kernel: Linux 5.11.0-1007-raspi (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_CRAP, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru 
micropython-1.14+ds/debian/patches/0011-make-static-variable-potentially-clobbered-by-longjmp.patch
 
micropython-1.14+ds/debian/patches/0011-make-static-variable-potentially-clobbered-by-longjmp.patch
--- 
micropython-1.14+ds/debian/patches/0011-make-static-variable-potentially-clobbered-by-longjmp.patch
 1970-01-01 00:00:00.000000000 +0000
+++ 
micropython-1.14+ds/debian/patches/0011-make-static-variable-potentially-clobbered-by-longjmp.patch
 2021-06-23 20:36:11.000000000 +0000
@@ -0,0 +1,27 @@
+Description: Change a potentially clobbered variable to static
+  There was a bool that was not static and potentially clobbered. This was 
causing build
+  failures in certain architectures and is fixed by making it a static bool.
+Origin: upstream, 
https://github.com/micropython/micropython/commit/9c9bfe1968d4260924316353bd1c941fe7e8741d
+Bug: https://github.com/micropython/micropython/issues/6636
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/micropython/+bug/1931955
+Last-Update: 2021-06-23
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: micropython-1.14+ds/ports/unix/main.c
+===================================================================
+--- micropython-1.14+ds.orig/ports/unix/main.c
++++ micropython-1.14+ds/ports/unix/main.c
+@@ -592,7 +592,12 @@ MP_NOINLINE int main_(int argc, char **a
+ 
+                 mp_obj_t mod;
+                 nlr_buf_t nlr;
+-                bool subpkg_tried = false;
++
++                // Allocating subpkg_tried on the stack can lead to compiler 
warnings about this
++                // variable being clobbered when nlr is implemented using 
setjmp/longjmp.  Its
++                // value must be preserved across calls to setjmp/longjmp.
++                static bool subpkg_tried;
++                subpkg_tried = false;
+ 
+             reimport:
+                 if (nlr_push(&nlr) == 0) {
diff -Nru micropython-1.14+ds/debian/patches/series 
micropython-1.14+ds/debian/patches/series
--- micropython-1.14+ds/debian/patches/series   2021-02-16 09:52:54.000000000 
+0000
+++ micropython-1.14+ds/debian/patches/series   2021-06-23 20:34:42.000000000 
+0000
@@ -8,3 +8,4 @@
 0008-samd-Makefile-Include-ldexp-in-build-if-needed-by-fl.patch
 0009-py-parsenum-Improve-parsing-of-floats-with-large-num.patch
 0010-unix-modjni-Add-missing-const.patch
+0011-make-static-variable-potentially-clobbered-by-longjmp.patch

Reply via email to