<div dir="ltr"><div dir="ltr">On Thu, Sep 28, 2023 at 2:50 AM Mathias Krause <<a href="mailto:minipli@grsecurity.net">minipli@grsecurity.net</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Lianbo,<br>
<br>
Thanks for testing! My response is inline below...<br>
<br>
On 27.09.23 11:14, lijiang wrote:<br>
> Hi, Mathias<br>
> Thank you for the patchset.<br>
> On Tue, Sep 26, 2023 at 10:36 PM <<a href="mailto:crash-utility-request@redhat.com" target="_blank">crash-utility-request@redhat.com</a><br>
> <mailto:<a href="mailto:crash-utility-request@redhat.com" target="_blank">crash-utility-request@redhat.com</a>>> wrote:<br>
> <br>
>     Date: Tue, 26 Sep 2023 12:12:47 +0200<br>
>     From: Mathias Krause <<a href="mailto:minipli@grsecurity.net" target="_blank">minipli@grsecurity.net</a><br>
>     <mailto:<a href="mailto:minipli@grsecurity.net" target="_blank">minipli@grsecurity.net</a>>><br>
>     To: <a href="mailto:crash-utility@redhat.com" target="_blank">crash-utility@redhat.com</a> <mailto:<a href="mailto:crash-utility@redhat.com" target="_blank">crash-utility@redhat.com</a>><br>
>     Subject: [Crash-utility] [PATCH 2/2] memory_driver: Support overriding<br>
>             kernel directory<br>
>     Message-ID: <<a href="mailto:20230926101247.1237748-3-minipli@grsecurity.net" target="_blank">20230926101247.1237748-3-minipli@grsecurity.net</a><br>
>     <mailto:<a href="mailto:20230926101247.1237748-3-minipli@grsecurity.net" target="_blank">20230926101247.1237748-3-minipli@grsecurity.net</a>>><br>
>     Content-Type: text/plain; charset="US-ASCII"; x-default=true<br>
> <br>
>     Support compiling the module against a different kernel version than the<br>
>     currently running one by allowing to set either KVER or KDIR variables<br>
>     on the make commandline.<br>
> <br>
>     Also modernize the makefile slightly and make use of the kernel's<br>
>     'clean' target to ensure to remove all generated files.<br>
> <br>
> <br>
> The [PATCH 1/2] looks good to me.<br>
<br>
Thanks.<br>
<br>
> <br>
> For the [PATCH 2/2], I only have two questions:<br>
> <br>
> [1] With the patch 2/2, it always triggers recompiling the gdb like this:<br>
> # make lzo<br>
> TARGET: PPC64<br>
>  CRASH: 8.0.3++<br>
>    GDB: 10.2<br>
> <br>
>   CXX    gdb.o<br>
>   CXX    ../../crash_target.o<br>
>   CXX    ada-exp.o<br>
>   CXX    ada-lang.o<br>
>   CXX    ada-tasks.o<br>
>   CXX    ada-typeprint.o<br>
>   CXX    ada-valprint.o<br>
>   CXX    ada-varobj.o<br>
>   CXX    addrmap.o<br>
>   CXX    agent.o<br>
>   CXX    alloc.o<br>
>   CXX    annotate.o<br>
> ...<br>
<br>
Hmm, I cannot reproduce this. If I do 'make lzo' it builds 'crash' only<br>
once, not multiple times as you're observing. Can you please provide<br>
instructions how to reproduce the issue? Or, maybe, it's related to the<br>
second one...<br>
<br></blockquote><div> </div><div>This issue still exists with the v2:</div><div><a href="https://listman.redhat.com/archives/crash-utility/2023-September/011021.html">https://listman.redhat.com/archives/crash-utility/2023-September/011021.html</a> </div><div><br></div><div>I can reproduce it with the following steps(require kernel-devel package):</div><div><br></div><div>[1] make lzo</div><div>[2] make clean</div><div>[3] make lzo(or make warn)</div><div># make lzo<br>TARGET: ARM64<br> CRASH: 8.0.3++<br>   GDB: 10.2<br><br>  CXX    gdb.o<br>  CXX    ../../crash_target.o<br>  CXX    aarch32-linux-nat.o<br>  CXX    aarch32-tdep.o<br>  CXX    aarch64-linux-nat.o<br>  CXX    aarch64-linux-tdep.o<br>  CXX    aarch64-ravenscar-thread.o<br>  CXX    aarch64-tdep.o<br></div><div>...</div><div><br></div><div># make warn<br>TARGET: ARM64<br> CRASH: 8.0.3++<br>   GDB: 10.2<br><br>  CXX    gdb.o<br>  CXX    ../../crash_target.o<br>  CXX    aarch32-linux-nat.o<br>  CXX    aarch32-tdep.o<br>  CXX    aarch64-linux-nat.o<br>  CXX    aarch64-linux-tdep.o<br>  CXX    aarch64-ravenscar-thread.o<br>  CXX    aarch64-tdep.o<br></div><div>...</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> <br>
> [2] With the patch 2/2, it always reports the following error "No such<br>
> file or directory", if the kernel-devel package is not installed.<br>
> # make clean<br>
> ...<br>
> make -C /lib/modules/xxx/build M=/home/crash SUBDIRS=/home/crash clean<br>
> || rm -f *.mod.c *.ko *.o Module.*<br>
> make[3]: *** /lib/modules/xxx/build: No such file or directory.  Stop.<br>
> <br>
> Actually, I did not build the crash.ko in the directory memory_driver/.<br>
> <br>
> Is that expected behavior?<br>
<br>
Ahh, yes. That's expected, but unfortunate behavior. I'll fix it by<br>
testing if the build directory exists first to avoid the error message.<br>
<br>
The fall-back handling is already there -- simply does the old 'rm<br>
*.mod.c *.ko *.o Module.*'. However, there's no need to generate an<br>
error message when we know in advance that the kernel build directory is<br>
missing.<br></blockquote><div><br></div><div>With the v2, this issue disappeared.</div><div><br></div><div>Thanks.</div><div>Lianbo</div></div></div>