All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <87tuzp4zhx.fsf@linaro.org>

diff --git a/a/content_digest b/N1/content_digest
index 854481f..ec6947b 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -5,12 +5,12 @@
  "Subject\0Re: [PATCH v1 2/3] linux-user: deal with address wrap for ARM_COMMPAGE on 32 bit\0"
  "Date\0Fri, 05 Jun 2020 10:45:46 +0100\0"
  "To\0Richard Henderson <richard.henderson@linaro.org>\0"
- "Cc\0qemu-devel@nongnu.org"
-  qemu-arm@nongnu.org
+ "Cc\0Peter Maydell <peter.maydell@linaro.org>"
   Bug 1880225 <1880225@bugs.launchpad.net>
-  Peter Maydell <peter.maydell@linaro.org>
   Riku Voipio <riku.voipio@iki.fi>
- " Laurent Vivier <laurent@vivier.eu>\0"
+  qemu-devel@nongnu.org
+  Laurent Vivier <laurent@vivier.eu>
+ " qemu-arm@nongnu.org\0"
  "\00:1\0"
  "b\0"
  "\n"
@@ -70,4 +70,4 @@
  "-- \n"
  "Alex Benn\303\251e"
 
-0898e62a07d7b7f9a1465a23b7f85aff5840d49ac19d94a79fc72b37e8568e6f
+15887cc8a76dc46426684195b3c9b9f0021edf6c318575552ff2174f1cc45048

diff --git a/a/1.txt b/N2/1.txt
index 9609411..16178dc 100644
--- a/a/1.txt
+++ b/N2/1.txt
@@ -1,4 +1,3 @@
-
 Richard Henderson <richard.henderson@linaro.org> writes:
 
 > On 5/27/20 3:05 AM, Alex Bennée wrote:
@@ -54,3 +53,161 @@ I do kinda wish rr worked on i386 :-/
 
 -- 
 Alex Bennée
+
+-- 
+You received this bug notification because you are a member of qemu-
+devel-ml, which is subscribed to QEMU.
+https://bugs.launchpad.net/bugs/1880225
+
+Title:
+  Emulation of some arm programs fail with "Assertion `have_guest_base'
+  failed."
+
+Status in QEMU:
+  In Progress
+
+Bug description:
+  This issue is observer with QEMU ToT, checked out around May 15th (but
+  I believe it is present in current master too), and wasn't present in
+  QEMU v5.0.0.
+
+  I am using 32-bit Intel(R) Pentium(R) M processor 1.73GHz host.
+
+  Arm cross-compiler is a standard cross-compiler that comes with
+  Debian-based distributions, and gcc version is:
+
+  $ arm-linux-gnueabi-gcc --version
+  arm-linux-gnueabi-gcc (Debian 8.3.0-2) 8.3.0
+
+  Compile this program with cross compiler:
+
+  $ arm-linux-gnueabi-gcc -O2 -static toupper_string.c -o
+  toupper_string-arm
+
+  Emulation with QEMU v5.0.0 is correct, and gives expected output:
+
+  $ ~/Build/qemu-5.0.0/build-gcc/arm-linux-user/qemu-arm ./toupper_string-arm
+  CONTROL RESULT: (toupper_string)
+   nwlrbbmqbhcdarz owkkyhiddqscdxr jmowfrxsjybldbe fsarcbynecdyggx xpklorellnmpapq
+   NWLRBBMQBHCDARZ OWKKYHIDDQSCDXR JMOWFRXSJYBLDBE FSARCBYNECDYGGX XPKLORELLNMPAPQ
+
+  While, in case of QEMU master it fails:
+
+  $ ~/Build/qemu-master/build-gcc/arm-linux-user/qemu-arm ./toupper_string-arm
+  qemu-arm: /home/rtrk/Build/qemu-master/linux-user/elfload.c:2294: probe_guest_base: Assertion `have_guest_base' failed.
+  Aborted
+
+  There are many other programs that exibit the same behavior. The
+  failure is arm-sprecific.
+
+  
+  -----------------------------------------------------
+
+  source code: (let's call this file toupper_string.c) (similar file is
+  also in attachment)
+
+  
+  #include <stdlib.h>
+  #include <string.h>
+  #include <stdio.h>
+  #include <unistd.h>
+
+  
+  #define MAX_STRING_LENGHT              15
+  #define NUMBER_OF_RANDOM_STRINGS       100
+  #define DEFAULT_NUMBER_OF_REPETITIONS  30000
+  #define MAX_NUMBER_OF_REPETITIONS      1000000000
+  #define NUMBER_OF_CONTROL_PRINT_ITEMS  5
+
+  /* Structure for keeping an array of strings */
+  struct StringStruct {
+      char chars[MAX_STRING_LENGHT + 1];
+  };
+
+  /**
+   * Sets characters of the given string to random small letters a-z.
+   * @param s String to get random characters.
+   * @len Length of the input string.
+   */
+  static void gen_random_string(char *chars, const int len)
+  {
+      static const char letters[] = "abcdefghijklmnopqrstuvwxyz";
+
+      for (size_t i = 0; i < len; i++) {
+          chars[i] = letters[rand() % (sizeof(letters) - 1)];
+      }
+      chars[len] = 0;
+  }
+
+  void main (int argc, char* argv[])
+  {
+      struct StringStruct random_strings[NUMBER_OF_RANDOM_STRINGS];
+      struct StringStruct strings_to_be_uppercased[NUMBER_OF_RANDOM_STRINGS];
+      int32_t number_of_repetitions = DEFAULT_NUMBER_OF_REPETITIONS;
+      int32_t option;
+
+      /* Parse command line options */
+      while ((option = getopt(argc, argv, "n:")) != -1) {
+          if (option == 'n') {
+              int32_t user_number_of_repetitions = atoi(optarg);
+              /* Check if the value is a negative number */
+              if (user_number_of_repetitions < 1) {
+                  fprintf(stderr, "Error ... Value for option '-n' cannot be a "
+                                  "negative number.\n");
+                  exit(EXIT_FAILURE);
+              }
+              /* Check if the value is a string or zero */
+              if (user_number_of_repetitions == 0) {
+                  fprintf(stderr, "Error ... Invalid value for option '-n'.\n");
+                  exit(EXIT_FAILURE);
+              }
+              /* Check if the value is too large */
+              if (user_number_of_repetitions > MAX_NUMBER_OF_REPETITIONS) {
+                  fprintf(stderr, "Error ... Value for option '-n' cannot be "
+                                  "more than %d.\n", MAX_NUMBER_OF_REPETITIONS);
+                  exit(EXIT_FAILURE);
+              }
+              number_of_repetitions = user_number_of_repetitions;
+          } else {
+              exit(EXIT_FAILURE);
+          }
+      }
+
+      /* Create an array of strings with random content */
+      srand(1);
+      for (size_t i = 0; i < NUMBER_OF_RANDOM_STRINGS; i++) {
+          gen_random_string(random_strings[i].chars, MAX_STRING_LENGHT);
+      }
+
+      /* Perform uppercasing of a set of random strings multiple times */
+      for (size_t j = 0; j < number_of_repetitions; j++) {
+          /* Copy initial set of random strings to the set to be uppercased */
+          memcpy(strings_to_be_uppercased, random_strings,
+                 NUMBER_OF_RANDOM_STRINGS * (MAX_STRING_LENGHT + 1));
+          /* Do actual changing case to uppercase */
+          for (size_t i = 0; i < NUMBER_OF_RANDOM_STRINGS; i++) {
+              int k = 0;
+    
+              while (strings_to_be_uppercased[i].chars[k]) { 
+                  char ch = strings_to_be_uppercased[i].chars[k] - 32; 
+                  memcpy((void *)strings_to_be_uppercased[i].chars + k,
+                         &ch, 1);
+                  k++; 
+              } 
+          }
+      }
+
+      /* Control printing */
+      printf("CONTROL RESULT: (toupper_string)\n");
+      for (size_t i = 0; i < NUMBER_OF_CONTROL_PRINT_ITEMS; i++) {
+          printf(" %s", random_strings[i].chars);
+      }
+      printf("\n");
+      for (size_t i = 0; i < NUMBER_OF_CONTROL_PRINT_ITEMS; i++) {
+          printf(" %s", strings_to_be_uppercased[i].chars);
+      }
+      printf("\n");
+  }
+
+To manage notifications about this bug go to:
+https://bugs.launchpad.net/qemu/+bug/1880225/+subscriptions
diff --git a/a/content_digest b/N2/content_digest
index 854481f..4355c72 100644
--- a/a/content_digest
+++ b/N2/content_digest
@@ -1,19 +1,10 @@
- "ref\020200527100546.29297-1-alex.bennee@linaro.org\0"
- "ref\020200527100546.29297-3-alex.bennee@linaro.org\0"
- "ref\0355ff6ba-ed8a-bc1e-4b74-c87a532e47bd@linaro.org\0"
- "From\0Alex Benn\303\251e <alex.bennee@linaro.org>\0"
- "Subject\0Re: [PATCH v1 2/3] linux-user: deal with address wrap for ARM_COMMPAGE on 32 bit\0"
- "Date\0Fri, 05 Jun 2020 10:45:46 +0100\0"
- "To\0Richard Henderson <richard.henderson@linaro.org>\0"
- "Cc\0qemu-devel@nongnu.org"
-  qemu-arm@nongnu.org
-  Bug 1880225 <1880225@bugs.launchpad.net>
-  Peter Maydell <peter.maydell@linaro.org>
-  Riku Voipio <riku.voipio@iki.fi>
- " Laurent Vivier <laurent@vivier.eu>\0"
+ "ref\0159017301531.7966.9120113243897778171.malonedeb@gac.canonical.com\0"
+ "From\0Alex Benn\303\251e <1880225@bugs.launchpad.net>\0"
+ "Subject\0[Bug 1880225] Re: [PATCH v1 2/3] linux-user: deal with address wrap for ARM_COMMPAGE on 32 bit\0"
+ "Date\0Fri, 05 Jun 2020 09:45:46 -0000\0"
+ "To\0qemu-devel@nongnu.org\0"
  "\00:1\0"
  "b\0"
- "\n"
  "Richard Henderson <richard.henderson@linaro.org> writes:\n"
  "\n"
  "> On 5/27/20 3:05 AM, Alex Benn\303\251e wrote:\n"
@@ -68,6 +59,164 @@
  "\n"
  "\n"
  "-- \n"
- "Alex Benn\303\251e"
+ "Alex Benn\303\251e\n"
+ "\n"
+ "-- \n"
+ "You received this bug notification because you are a member of qemu-\n"
+ "devel-ml, which is subscribed to QEMU.\n"
+ "https://bugs.launchpad.net/bugs/1880225\n"
+ "\n"
+ "Title:\n"
+ "  Emulation of some arm programs fail with \"Assertion `have_guest_base'\n"
+ "  failed.\"\n"
+ "\n"
+ "Status in QEMU:\n"
+ "  In Progress\n"
+ "\n"
+ "Bug description:\n"
+ "  This issue is observer with QEMU ToT, checked out around May 15th (but\n"
+ "  I believe it is present in current master too), and wasn't present in\n"
+ "  QEMU v5.0.0.\n"
+ "\n"
+ "  I am using 32-bit Intel(R) Pentium(R) M processor 1.73GHz host.\n"
+ "\n"
+ "  Arm cross-compiler is a standard cross-compiler that comes with\n"
+ "  Debian-based distributions, and gcc version is:\n"
+ "\n"
+ "  $ arm-linux-gnueabi-gcc --version\n"
+ "  arm-linux-gnueabi-gcc (Debian 8.3.0-2) 8.3.0\n"
+ "\n"
+ "  Compile this program with cross compiler:\n"
+ "\n"
+ "  $ arm-linux-gnueabi-gcc -O2 -static toupper_string.c -o\n"
+ "  toupper_string-arm\n"
+ "\n"
+ "  Emulation with QEMU v5.0.0 is correct, and gives expected output:\n"
+ "\n"
+ "  $ ~/Build/qemu-5.0.0/build-gcc/arm-linux-user/qemu-arm ./toupper_string-arm\n"
+ "  CONTROL RESULT: (toupper_string)\n"
+ "   nwlrbbmqbhcdarz owkkyhiddqscdxr jmowfrxsjybldbe fsarcbynecdyggx xpklorellnmpapq\n"
+ "   NWLRBBMQBHCDARZ OWKKYHIDDQSCDXR JMOWFRXSJYBLDBE FSARCBYNECDYGGX XPKLORELLNMPAPQ\n"
+ "\n"
+ "  While, in case of QEMU master it fails:\n"
+ "\n"
+ "  $ ~/Build/qemu-master/build-gcc/arm-linux-user/qemu-arm ./toupper_string-arm\n"
+ "  qemu-arm: /home/rtrk/Build/qemu-master/linux-user/elfload.c:2294: probe_guest_base: Assertion `have_guest_base' failed.\n"
+ "  Aborted\n"
+ "\n"
+ "  There are many other programs that exibit the same behavior. The\n"
+ "  failure is arm-sprecific.\n"
+ "\n"
+ "  \n"
+ "  -----------------------------------------------------\n"
+ "\n"
+ "  source code: (let's call this file toupper_string.c) (similar file is\n"
+ "  also in attachment)\n"
+ "\n"
+ "  \n"
+ "  #include <stdlib.h>\n"
+ "  #include <string.h>\n"
+ "  #include <stdio.h>\n"
+ "  #include <unistd.h>\n"
+ "\n"
+ "  \n"
+ "  #define MAX_STRING_LENGHT              15\n"
+ "  #define NUMBER_OF_RANDOM_STRINGS       100\n"
+ "  #define DEFAULT_NUMBER_OF_REPETITIONS  30000\n"
+ "  #define MAX_NUMBER_OF_REPETITIONS      1000000000\n"
+ "  #define NUMBER_OF_CONTROL_PRINT_ITEMS  5\n"
+ "\n"
+ "  /* Structure for keeping an array of strings */\n"
+ "  struct StringStruct {\n"
+ "      char chars[MAX_STRING_LENGHT + 1];\n"
+ "  };\n"
+ "\n"
+ "  /**\n"
+ "   * Sets characters of the given string to random small letters a-z.\n"
+ "   * @param s String to get random characters.\n"
+ "   * @len Length of the input string.\n"
+ "   */\n"
+ "  static void gen_random_string(char *chars, const int len)\n"
+ "  {\n"
+ "      static const char letters[] = \"abcdefghijklmnopqrstuvwxyz\";\n"
+ "\n"
+ "      for (size_t i = 0; i < len; i++) {\n"
+ "          chars[i] = letters[rand() % (sizeof(letters) - 1)];\n"
+ "      }\n"
+ "      chars[len] = 0;\n"
+ "  }\n"
+ "\n"
+ "  void main (int argc, char* argv[])\n"
+ "  {\n"
+ "      struct StringStruct random_strings[NUMBER_OF_RANDOM_STRINGS];\n"
+ "      struct StringStruct strings_to_be_uppercased[NUMBER_OF_RANDOM_STRINGS];\n"
+ "      int32_t number_of_repetitions = DEFAULT_NUMBER_OF_REPETITIONS;\n"
+ "      int32_t option;\n"
+ "\n"
+ "      /* Parse command line options */\n"
+ "      while ((option = getopt(argc, argv, \"n:\")) != -1) {\n"
+ "          if (option == 'n') {\n"
+ "              int32_t user_number_of_repetitions = atoi(optarg);\n"
+ "              /* Check if the value is a negative number */\n"
+ "              if (user_number_of_repetitions < 1) {\n"
+ "                  fprintf(stderr, \"Error ... Value for option '-n' cannot be a \"\n"
+ "                                  \"negative number.\\n\");\n"
+ "                  exit(EXIT_FAILURE);\n"
+ "              }\n"
+ "              /* Check if the value is a string or zero */\n"
+ "              if (user_number_of_repetitions == 0) {\n"
+ "                  fprintf(stderr, \"Error ... Invalid value for option '-n'.\\n\");\n"
+ "                  exit(EXIT_FAILURE);\n"
+ "              }\n"
+ "              /* Check if the value is too large */\n"
+ "              if (user_number_of_repetitions > MAX_NUMBER_OF_REPETITIONS) {\n"
+ "                  fprintf(stderr, \"Error ... Value for option '-n' cannot be \"\n"
+ "                                  \"more than %d.\\n\", MAX_NUMBER_OF_REPETITIONS);\n"
+ "                  exit(EXIT_FAILURE);\n"
+ "              }\n"
+ "              number_of_repetitions = user_number_of_repetitions;\n"
+ "          } else {\n"
+ "              exit(EXIT_FAILURE);\n"
+ "          }\n"
+ "      }\n"
+ "\n"
+ "      /* Create an array of strings with random content */\n"
+ "      srand(1);\n"
+ "      for (size_t i = 0; i < NUMBER_OF_RANDOM_STRINGS; i++) {\n"
+ "          gen_random_string(random_strings[i].chars, MAX_STRING_LENGHT);\n"
+ "      }\n"
+ "\n"
+ "      /* Perform uppercasing of a set of random strings multiple times */\n"
+ "      for (size_t j = 0; j < number_of_repetitions; j++) {\n"
+ "          /* Copy initial set of random strings to the set to be uppercased */\n"
+ "          memcpy(strings_to_be_uppercased, random_strings,\n"
+ "                 NUMBER_OF_RANDOM_STRINGS * (MAX_STRING_LENGHT + 1));\n"
+ "          /* Do actual changing case to uppercase */\n"
+ "          for (size_t i = 0; i < NUMBER_OF_RANDOM_STRINGS; i++) {\n"
+ "              int k = 0;\n"
+ "    \n"
+ "              while (strings_to_be_uppercased[i].chars[k]) { \n"
+ "                  char ch = strings_to_be_uppercased[i].chars[k] - 32; \n"
+ "                  memcpy((void *)strings_to_be_uppercased[i].chars + k,\n"
+ "                         &ch, 1);\n"
+ "                  k++; \n"
+ "              } \n"
+ "          }\n"
+ "      }\n"
+ "\n"
+ "      /* Control printing */\n"
+ "      printf(\"CONTROL RESULT: (toupper_string)\\n\");\n"
+ "      for (size_t i = 0; i < NUMBER_OF_CONTROL_PRINT_ITEMS; i++) {\n"
+ "          printf(\" %s\", random_strings[i].chars);\n"
+ "      }\n"
+ "      printf(\"\\n\");\n"
+ "      for (size_t i = 0; i < NUMBER_OF_CONTROL_PRINT_ITEMS; i++) {\n"
+ "          printf(\" %s\", strings_to_be_uppercased[i].chars);\n"
+ "      }\n"
+ "      printf(\"\\n\");\n"
+ "  }\n"
+ "\n"
+ "To manage notifications about this bug go to:\n"
+ https://bugs.launchpad.net/qemu/+bug/1880225/+subscriptions
 
-0898e62a07d7b7f9a1465a23b7f85aff5840d49ac19d94a79fc72b37e8568e6f
+ac0f5553c012510718e19af099cd175eac0965c465a419da6e520f127c4f3f57

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.