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

dpkg segfault and internal debconf error with ucf-using package



Hi Benoit, hi fellow developers,

we have a bug report (http://bugs.debian.org/247849) that configuration
of tetex-extra by dpkg fails in the postinst script, with a Perl error
from debconf's Question.pm. The respective postinst script does not use
debconf directly, or source /usr/share/debconf/confmodule. It only calls
a script that itself uses ucf.

Because the same script is also used by tetex-base, which does use
debconf, it calls ucf with "--debconf-ok" also for tetex-extra. I had
suspected that this causes the error, and have asked Benoit to change
the ucf invocation so that --debconf-ok is not used. However, this did
not solve the problem. Now it even causes dpkg to segfault. I attach
Benoits debugging output below, with some comments.

In fact the postinst script and the script "setup-ucf" that it calls do
nothing but assign (and unset) variables, before ucf is called with 

  for file in $BLUESKY_UCF $BSRTETEX_UCF $OMEGA_UCF; do
    $UCF $UCF_SOURCEDIR/$file $DVIPS/$file
  done

where $UCF was 'ucf --debconf-ok' previously, and was set to 'ucf' by
Benoit. On our systems, we cannot reproduce this bug.

I would greatly appreciate your comments:

- Have you had similar reports?

- How could this be debugged?

- Is the dpkg segfault probably a separate issue, or caused by the
  changed behavior of ucf (it didn't segfault in the original
  bugreport)? 

- If the whole mess, reproducible on at least two systems, but not
  generally, is the result of some underlying database or filesystem
  corruption, do you have an idea what this could be?

Regards, Frank


Benoît Sibaud <benoit.sibaud@wanadoo.fr> wrote:

> # grep -n "UCF=\"ucf" /usr/share/tetex-base/setup-ucf 
> 5:#UCF="ucf --verbose -d --debconf-ok"
> 6:UCF="ucf"
>
> # dpkg --configure -a
> Setting up tetex-extra (2.0.2-8) ...
> Can't call method "description" on an undefined value at
> /usr/share/perl5/Debconf/Question.pm line 76, <GEN0> line 1.
> dpkg: error processing tetex-extra (--configure):
>  subprocess post-installation script returned error exit status 9
> (...)
>
> # dpkg -i -D7777 tetex-extra_2.0.2-8_all.deb
> (...)
> D000200: conffderef in=`/etc/texmf/dvips/xypic.map' current
> working=`/etc/texmf/dvips/xypic.map'
> D000020: conffderef in=`/etc/texmf/dvips/xypic.map'
> result=`/etc/texmf/dvips/xypic.map'
> D000020: deferred_configure `/etc/texmf/dvips/xypic.map' (=
> `/etc/texmf/dvips/xypic.map') useredited=-1 distedited=-1 what=2
> D000002: fork/exec /var/lib/dpkg/info/tetex-extra.postinst (dpkg: error
> processing tetex-extra (--install):
>  subprocess post-installation script killed by signal (Segmentation fault),
> core dumped
> Errors were encountered while processing:
>  tetex-extra
>
> # file core
> core: ELF 32-bit LSB core file Intel 80386, version 1 (SYSV), SVR4-style,
> SVR4-style, from 'dpkg'
>
> Huh dpkg coredumped...
>
> (gdb) backtrace
> #0  0x4009cc0f in strlen () from /lib/libc.so.6
> #1  0x40070385 in vfprintf () from /lib/libc.so.6
> #2  0x40071e9e in vfprintf () from /lib/libc.so.6
> #3  0x4006de20 in vfprintf () from /lib/libc.so.6
> #4  0x4007686f in fprintf () from /lib/libc.so.6
> #5  0x0805866d in ?? ()
> #6  0x401500c0 in _IO_2_1_stdout_ () from /lib/libc.so.6
> #7  0x0806fc8b in _IO_stdin_used ()
> #8  0x2e696f63 in ?? ()
> #9  0x080fecc8 in ?? ()
> #10 0x00000004 in ?? ()
> #11 0x080f2640 in stdin ()
> #12 0xbffff8d8 in ?? ()
> #13 0x08058a53 in ?? ()
> #14 0x080fecc8 in ?? ()
> #15 0x0a335d74 in ?? ()
> #16 0x4004ad3f in dcgettext () from /lib/libc.so.6
> Previous frame inner to this frame (corrupt stack?)
>
> On a recompiled dpkg-1.10.22 with CFLAGS="-g -O2"
>
> (gdb) backtrace
> #0  0x4009cc0f in strlen () from /lib/libc.so.6
> #1  0x40070385 in vfprintf () from /lib/libc.so.6
> #2  0x40071e9e in vfprintf () from /lib/libc.so.6
> #3  0x4006de20 in vfprintf () from /lib/libc.so.6
> #4  0x4007686f in fprintf () from /lib/libc.so.6
> #5  0x0805866d in preexecscript (path=0x80fecc8
> #"/var/lib/dpkg/info/tetex-extra.postinst", argv=0xa33f368)
>     at ../../main/help.c:184
> #6  0x08058a53 in do_script (pkg=0x819e0b0 "tetex-extra",
> #scriptname=0x806b1cd "postinst", 
>     scriptpath=0x80fecc8 "/var/lib/dpkg/info/tetex-extra.postinst",
> stab=0x0, arglist=0x80f2640, desc=0x0, 
>     name=0xbffff8a0 "post-installation script", warn=0) at
> ../../main/help.c:268
> #7  0x08058b85 in maintainer_script_installed (pkg=0x819dff8,
> #scriptname=0x806b1cd "postinst", 
>     description=0x806b1e4 "post-installation") at ../../main/help.c:301
> #8  0x08054de1 in deferred_configure (pkg=0x819dff8) at
> #../../main/configure.c:290 9  0x08053e59 in process_queue () at
> #../../main/packages.c:199 10 0x0804f897 in archivefiles (argv=0x8063c8a)
> #at ../../main/archives.c:919 11 0x0804ac79 in main (argc=4,
> #argv=0xbffffd80) at ../../main/main.c:562
>
> #5  0x0805866d in preexecscript (path=0x80fecc8
> #"/var/lib/dpkg/info/tetex-extra.postinst", argv=0xa33f368)
>     at ../../main/help.c:184
> 184         fputs(" )\n",stderr);
> #6  0x08058a53 in do_script (pkg=0x819e0b0 "tetex-extra",
> #scriptname=0x806b1cd "postinst", 
>     scriptpath=0x80fecc8 "/var/lib/dpkg/info/tetex-extra.postinst",
> stab=0x0, arglist=0x80f2640, desc=0x0, 
>     name=0xbffff8a0 "post-installation script", warn=0) at
> ../../main/help.c:268
> 268         scriptexec= preexecscript(scriptpath,narglist);
> #7  0x08058b85 in maintainer_script_installed (pkg=0x819dff8,
> #scriptname=0x806b1cd "postinst", 
>     description=0x806b1e4 "post-installation") at ../../main/help.c:301
> 301       do_script(pkg->name, scriptname, scriptpath, &stab, arglist,
> _("unable to execute %s"), buf, 0);
> #8  0x08054de1 in deferred_configure (pkg=0x819dff8) at
> #../../main/configure.c:290
> 290             if (maintainer_script_installed(pkg, POSTINSTFILE,
> "post-installation",
> #9  0x08053e59 in process_queue () at ../../main/packages.c:199
> 199           deferred_configure(pkg);
> #10 0x0804f897 in archivefiles (argv=0x8063c8a) at
> #../../main/archives.c:919
> 919         process_queue();
> #11 0x0804ac79 in main (argc=4, argv=0xbffffd80) at ../../main/main.c:562
> 562       actionfunction(argv);
>
> Another test:
>
> # grep -n "UCF=\"ucf" /usr/share/tetex-base/setup-ucf 
> 5:#UCF="ucf --verbose -d --debconf-ok"
> 6:UCF="ucf --verbose"

The -d option would give some more information. But I guess in the
following transcripts, the error message comes when ucf loads
confmodule. It would be easier to sea this im you, Benoit, could tell us
whether the destination file (/etc/texmf/dvips/config.ams) does exist
yet, and whether it has a line in /var/lib/ucf/hashfile.

>
> # dpkg --configure -a
> Setting up tetex-extra (2.0.2-8) ...
> ucf: The new file is /usr/share/tetex-extra/config.ams
> ucf: The Destination file is /etc/texmf/dvips/config.ams
> ucf: The Source directory is /usr/share/tetex-extra
> ucf: The State directory is /var/lib/ucf
> The hash file exists
> egrep [[:space:]]/etc/texmf/dvips/config.ams$ /var/lib/ucf/hashfile
> Can't call method "description" on an undefined value at
> /usr/share/perl5/Debconf/Question.pm line 76, <GEN0> line 1.
>
> # dpkg -i -D7777 tetex-extra_2.0.2-8_all.deb
> D000200: conffderef in=`/etc/texmf/dvips/xypic.map' current
> working=`/etc/texmf/dvips/xypic.map'
> D000020: conffderef in=`/etc/texmf/dvips/xypic.map'
> result=`/etc/texmf/dvips/xypic.map'
> D000020: deferred_configure `/etc/texmf/dvips/xypic.map' (=
> `/etc/texmf/dvips/xypic.map') useredited=-1 distedited=-1 what=2
> D000002: fork/exec /var/lib/dpkg/info/tetex-extra.postinst (dpkg: error
> processing tetex-extra (--install):
>  subprocess post-installation script killed by signal (Segmentation fault)
> Errors were encountered while processing:
>  tetex-extra
>
> Hope this helps,
>
> -- 
> Benoît Sibaud

-- 
Frank Küster, Biozentrum der Univ. Basel
Abt. Biophysikalische Chemie



Reply to: