Begin forwarded message:
> From: Jeff Johnson <n3npq@mac.com>
> Date: June 14, 2008 9:55:21 AM EDT
> To: Bernhard Rosenkränzer <bero@arklinux.ch>
> Subject: Re: rpm 5.1.2: apt-get crash with lua, and forgetting --
> target parameters
>
>
> On Jun 14, 2008, at 9:23 AM, Bernhard Rosenkränzer wrote:
>
>> On Wednesday 11 June 2008 16.55:18 Jeff Johnson wrote:
>>>> When rpmlib is compiled with lua support, apt-get crashes on
>>>> startup, during an invocation of "rpmReadConfigFiles(NULL,
>>>> NULL);" (since
>>>> I didn't have any time to debug this further, the temporary fix is
>>>> building rpm --without-lua, none of our specs use it yet anyway).
>>>
>>> Details will get you a fix. Likely something easy to fix.
>>
>> I didn't get very far in debugging this yet (too busy with the day
>> job), but
>> what I have so far is:
>>
>> pkgInitSystem() in apt/apt-pkg/init.cc try to determine what low
>> level
>> packaging system is being used, and call Score() on every of them.
>> rpmSystem::Score (in apt/apt-pkg/rpm/rpmsystem.cc) crashes on an
>> invocation of
>> rpmReadConfigFiles(NULL, NULL);
>>
>> Putting some debug statements into rpmlib shows:
>> rpmReadConfigFiles calls rpmluaGetPrintBuffer, which in turn calls
>> rpmluaNew,
>> which crashes on lua_call (line 107) with lib->name == "" and lib-
>> >func ==
>> luaopen_base
>>
>
> Ah, thanks for context. I think I know the nature of the problem
> even if not yet the specific flaw.
>
> There's a class of peculier issues with initializing under bindings
> and applications because the code paths are rather different. I get
> burned by the library <-> executable initialization differences
> frequently.
>
> That's basically why the lua initialization is buried under
> rpmReadConfig()
> rather than some other, more natural, place. It's likely time to
> attempt
> a more natural and less contorted lua initialization lazily
> somewhere else
> instead.
>
> Guessing from "rpmSystem::Score" names:
> If apt is attempting rpmPlatformScore(), then patterns need to be
> added to /etc/rpm/platform. Likely easier/better for apt would be
> internalizing its own conception of arch scoring instead. rpmlib
> is in no better position to guess what arch is "preferred" with
> the proliferation of names like "x86_64", "amd64" "ia32e" and
> the thundering herd of ppc* arches than apt is. Pretending otherwise
> is silly.
>
>> The same code works when used outside of apt though, so I'm
>> suspecting some
>> uninitialized variable somewhere.
>>
>
> Valgrind is the easiest test for uninitialized. But you know that ;-)
>
>> Another possibly related thing: genbasedir (the server side apt
>> thing that
>> generates the package list) crashes with rpm5, regardless of
>> whether rpm is
>> built with or without lua. Didn't have any time to debug this yet
>> either.
>>
>
> Thanks for the details.
>
> 73 de Jeff
Received on Sat Jun 14 15:58:07 2008