<div dir="ltr"><div class="gmail_quote">On Thu, Jun 10, 2010 at 5:02 PM, Matthias Bolte <span dir="ltr"><<a href="mailto:matthias.bolte@googlemail.com">matthias.bolte@googlemail.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">2010/6/10 Emre Erenoglu <<a href="mailto:erenoglu@gmail.com">erenoglu@gmail.com</a>>:<br>
> On Thu, Jun 10, 2010 at 2:05 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>
>> > Dear list,<br>
>> ><br>
>> > I'm trying to package libvirt 0.8.1 for our distribution, Pardus 2009.2.<br>
>> > libvirt is installed perfectly normal, and libvirtd runs OK when I start<br>
>> > it<br>
>> > in a console using root account.<br>
>> ><br>
>> > However, when I start libvirtd as a service, with the same parameters,<br>
>> > through the normal service startup functions, it segfaults.<br>
>> ><br>
>> > The services in Pardus 2009.2 are started using a management backend<br>
>> > which<br>
>> > works with python and service start/stop scripts are python based.<br>
>> ><br>
>> > For libvirt, it's the following:<br>
>> > <a href="http://svn.pardus.org.tr/pardus/playground/ozan/libvirt/comar/service.py" target="_blank">http://svn.pardus.org.tr/pardus/playground/ozan/libvirt/comar/service.py</a><br>
>> ><br>
>> > Whatever I did, I couldn't find why libvirt is crashing. It works normal<br>
>> > when I run it from console with exactly the same parameters. Here's an<br>
>> > earlier syslog section ending with the crash:<br>
>> ><br>
>><br>
>> There are some things to consider:<br>
>><br>
>> - Did you use the exact same commandline as the initscript when<br>
>> testing manually?<br>
><br>
> Yes. In fact, the only parameter passed is the --daemon parameter with<br>
> current configuration.<br>
<br>
</div>With absolute path as the initscript?<br>
<br>
  /usr/sbin/libvirtd --daemon --config /etc/libvirt/libvirtd.conf<br>
<br>
Assuming LIBVIRTD_ARGS is empty in the initscript.<br></blockquote><div><br>Yes, if you check the script service.py, you'll see. We start libvirtd with the absolute path and exactly the above parameters. The conf file itself is the default one. <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>
>><br>
>> - Did you make sure to use the same environment variable configuration<br>
>> when starting libvirtd manually, compared to the initscript?<br>
><br>
> Here's the environment of the root user, I will try to find out the<br>
> environment of the service script:<br>
><br>
><br>
> MANPATH=/usr/local/share/man:/usr/share/man:/opt/sun-jre/man:/usr/kde/4/share/man<br>
> HOSTNAME=EMRE<br>
> SHELL=/bin/bash<br>
> TERM=linux<br>
> XDG_SESSION_COOKIE=3d6ade2bb28141896f3212d64bf41670-1276174999.886063-1263776093<br>
> HUSHLOGIN=FALSE<br>
> LC_ALL=en_US.UTF-8<br>
> USER=root<br>
</div>> LS_COLORS= ...<br>
<div class="im">> GUILE_LOAD_PATH=/usr/share/guile/1.8<br>
> MC_ENV=/usr/share/mc/bin/mc.sh<br>
> PAGER=/usr/bin/less<br>
> CONFIG_PROTECT_MASK=/etc/texmf/web2c /etc/texmf/language.dat.d<br>
> /etc/texmf/language.def.d /etc/texmf/updmap.d<br>
> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/opt/sun-jre/bin:/usr/kde/4/sbin:/usr/kde/4/bin<br>
<br>
</div>I asked about the environment variables and the commandline because<br>
you have /usr/local/sbin befreo /usr/bin in PATH. So you might have<br>
two libvirtds installed, one in /usr/local/sbin and one in /usr/sbin.<br></blockquote><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
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></blockquote><div><br>There's no other installation of libvirt in the system. I can also 
reproduce the same thing in all Pardus machines, so I believe it's something in libvirt not doing well with something else in our service init mechanisms. <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, core<br>
> file is not generated. I'll also try to fix this out and come back to the<br>
> list.<br>
><br>
<br>
</div>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></blockquote><div>I can't reproduce the segfault when I run it manually. It only happens when it's run from this python script. I will try to initialize gdb inside the script and connect remotely to the gdb session, but it's getting a bit over my debugging capabilities :)  For example, I don't know how to assign the symbols and source code etc from the package build directory to gdb.<br>
<br>Thanks a lot for your support Matthias!<br><br>Emre<br><br>
</div></div></div>