[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: More debug infos - was: Re: iMac G5 "windfarm"



Hello!

On 1/4/21 2:32 AM, John Paul Adrian Glaubitz wrote:
> On 1/4/21 2:02 AM, Cameron MacPherson wrote:
>> #define oprintf(...) \        ({ \                char *msg_oprintf; \
>>                fprintf(outfifo,__VA_ARGS__); \
>> fflush(outfifo); \                msg_oprintf =
>> xasprintf(__VA_ARGS__); \                log("OUT: %s\n",
>> msg_oprintf); \                free(msg_oprintf); \        })
>>
>> i would add fsync(fileno(outfifo)) after fflush(outfifo) otherwise its not
>> guaranteed that anything actually gets written to the file which is a fifo
>> so if something (the client?) is reading that fifo it will block until the
>> fsync happens.  if glibc used to fsync on fflush and doesnt any longer (its
>> not required to) i imagine this could cause the problem.
> 
> OK, I'll try that tomorrow.

I have tried this now. It didn't help, unfortunately.

I have, however, added several debug breakpoints now using oprintf():

--- /tmp/partman-base-214/parted_server.c       2019-06-02 05:29:29.000000000 -0700
+++ partman-base/partman-base-213/parted_server.c       2021-01-04 00:43:24.696811596 -0800
@@ -124,6 +124,7 @@
                 char *msg_oprintf; \
                 fprintf(outfifo,__VA_ARGS__); \
                 fflush(outfifo); \
+                fsync(fileno(outfifo)); \
                 msg_oprintf = xasprintf(__VA_ARGS__); \
                 log("OUT: %s\n", msg_oprintf); \
                 free(msg_oprintf); \
@@ -1219,14 +1220,19 @@
         oprintf("OK\n");
         if (NULL != device_named(device_name)) {
                 oprintf("OK\n");
+                oprintf("Debug1\n");
                 deactivate_exception_handler();
+                oprintf("Debug2\n");
                 set_disk_named(device_name,
                                ped_disk_new(device_named(device_name)));
+                oprintf("Debug3\n");
                 unchange_named(device_name);
+                oprintf("Debug4\n");
                 activate_exception_handler();
         } else
                 oprintf("failed\n");
         free(device);
+        free(device_name);
 }
 
 void

The resulting logfile is (ignore the noise in the beginning, scroll to the end):

> https://people.debian.org/~glaubitz/partman/powerpc/partman.debug.log

Thus, it stops at "set_disk_named(device_name, ped_disk_new(device_named(device_name)))".

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913


Reply to: