<div dir="ltr"><div class="gmail_quote">On Thu, Jun 10, 2010 at 9:07 PM, Daniel P. Berrange <span dir="ltr"><<a href="mailto:berrange@redhat.com">berrange@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Thu, Jun 10, 2010 at 08:57:15PM +0300, Emre Erenoglu wrote:<br>
> On Thu, Jun 10, 2010 at 5:02 PM, Matthias Bolte <<br>
> <a href="mailto:matthias.bolte@googlemail.com">matthias.bolte@googlemail.com</a>> wrote:<br>
><br>
> > 2010/6/10 Emre Erenoglu <<a href="mailto:erenoglu@gmail.com">erenoglu@gmail.com</a>>:<br>
</div><div class="im">> > The initscript explicitly starts the one in /usr/sbin. If you just<br>
> > start libvirtd manually without an absolute path then you'll start the<br>
> > one in /usr/local/sbin. This might explain why you cannot reproduce<br>
> > the segfault manually, but it doesn't explain why the segfault<br>
> > happens.<br>
> ><br>
><br>
> There's no other installation of libvirt in the system. I can also reproduce<br>
> the same thing in all Pardus machines, so I believe it's something in<br>
> libvirt not doing well with something else in our service init mechanisms.<br>
<br>
</div>I guess I'd put money on some environment variable causing trouble.<br>
It could be a *missing* environment variable that we expect to always<br>
be set, or something like that<br></blockquote><div><br>Hi Daniel, thanks for your message. Yes, I did a small script file as you suggested and found out this environment while libvirtd was run:<br><br><div style="margin-left: 40px;">
DBUS_STARTER_ADDRESS=unix:path=/var/run/dbus/system_bus_socket,guid=6c515f612162b05d554b59cd4c112d43<br>KRB5_KTNAME=/etc/libvirt/krb5.tab<br>PWD=/<br>DBUS_STARTER_BUS_TYPE=system<br>SHLVL=1<br>_=/usr/bin/env<br></div> <br>
This looks very weak compared to the standard root environment that I pasted in my earlier message. <br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div class="im"><br>
> > >> Could you provide a GDB backtrace of the segfault? The syslog entry only<br>
> > >> says that it crashed in libc, that's not enough information to<br>
> > >> debug the segfault.<br>
> > ><br>
> > > Unfortunately, I can't find a related core file in the system. In fact,<br>
> > core<br>
> > > file is not generated. I'll also try to fix this out and come back to the<br>
> > > list.<br>
> > ><br>
> ><br>
> > Getting a backtrace would be simpler if you could reproduce the<br>
> > problem manually. In that case you could just start libvirtd in GDB.<br>
> > But getting a backtrace from a coredump will work too.<br>
> ><br>
> I can't reproduce the segfault when I run it manually. It only happens when<br>
> it's run from this python script. I will try to initialize gdb inside the<br>
> script and connect remotely to the gdb session, but it's getting a bit over<br>
> my debugging capabilities :)  For example, I don't know how to assign the<br>
> symbols and source code etc from the package build directory to gdb.<br>
<br>
</div>Try creating a wrapper script, eg<br>
<br>
   mv /usr/sbin/libvirtd /usr/sbin/libvirtd.real<br>
   cat > /usr/sbin/libvirtd <<EOF<br>
   #!/bin/sh<br>
   cd /tmp<br>
   ulimited -c unlimited<br>
   exec /usr/sbin/libvirtd.real<br>
   EOF<br>
   chmod +x /usr/sbin/libvirtd<br>
<br>
That will hopefully give you a core dump in /tmp you can get get a<br>
stack trace from<br></blockquote><div><br>Yes, I got the core file with the script. However, when I open the core file with gdb, and use bt command to get the backtrace, the only thing it tells me is this:<br><br><div style="margin-left: 40px;">
Core was generated by `/usr/sbin/libvirtd --daemon'.<br>Program terminated with signal 11, Segmentation fault.<br>#0  0xb73ed8f3 in ?? ()<br>(gdb) bt<br>Cannot access memory at address 0x810b9db<br></div><br>Maybe I don't know enough of debugging as I know I have to see the code lines (somehow) at this segfault point. Could you guide me on that?<br>
<br>Thanks,<br><br>Br,<br>Emre<br><br>
</div></div></div>