Project

General

Profile

Actions

Bug #749

closed

Alias Collision on 'init_module'

Added by Alexey Khoroshilov almost 14 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Start date:
01/28/2011
Due date:
% Done:

0%

Estimated time:
Detected in build:
master
Platform:
Published in build:
e2a8d1f

Description

'ldv-git --force --no-update-meta --rule=08_1 --filter=isdn/capi/capidrv check' fails now at link stage of rule-instrumentor:

/opt/rule-instrumentor/aspectator/bin/linker: link error in '/home/tester/ldv/workdir/envs/1/work/work-4162cf64973df51fc885825bc9ca4d055891c49f/drivers/isdn/capi/capidrv.c/work/current--X--commands.xml--X--defaultshadows--X--08_1/artificial_env_1/csd_deg_dscv/20/dscv_tempdir/dscv/ri/08_1/drivers/isdn/i4l/isdn_common.o.usual': Alias Collision on 'init_module': aliases have different aliasees

Files

linux-2.6.38-dev20110111.log6.08-capidrv-fixed (643 KB) linux-2.6.38-dev20110111.log6.08-capidrv-fixed Log file with debug level 100 Alexey Khoroshilov, 01/28/2011 07:36 PM
isdn_common.o.usual (622 KB) isdn_common.o.usual The first bitcode file with module_init function Evgeny Novikov, 01/29/2011 01:21 PM
kcapi.o.usual (327 KB) kcapi.o.usual The second bitcode file with module_init function Evgeny Novikov, 01/29/2011 01:21 PM
isdn_common.c.p (58.3 KB) isdn_common.c.p The first source code file with module_init function Evgeny Novikov, 01/29/2011 01:21 PM
kcapi.c.p (29.7 KB) kcapi.c.p The second source code file with module_init function Evgeny Novikov, 01/29/2011 01:21 PM
meta-4162cf64973df51fc885825bc9ca4d055891c49f (9.99 MB) meta-4162cf64973df51fc885825bc9ca4d055891c49f Alexey Khoroshilov, 02/04/2011 03:13 PM
meta-3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5 (842 KB) meta-3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5 Evgeny Novikov, 02/04/2011 03:38 PM
meta-3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5 (5.45 MB) meta-3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5 Updated metadata file Evgeny Novikov, 02/08/2011 03:08 PM

Related issues 2 (0 open2 closed)

Related to Linux Driver Verification - Bug #789: LDV-Git doesn't detect call-graph dependenciesClosedPavel Shved02/04/2011

Actions
Blocks C Instrumentation Framework - Bug #876: Issues related with LLVM usage should be removedClosedEvgeny Novikov02/21/2011

Actions

Updated by Evgeny Novikov almost 14 years ago

I investigate the given problem and found that the problem is in incorrectly formed cmdstream. So cmdstream contains two source code files both with module_init function that of course leads to linking problem. The full list of linked objects are so (marked those of them which contains module_init):

/drivers/isdn/capi/capidrv.o.general
/drivers/isdn/i4l/isdn_v110.o.usual
/drivers/isdn/capi/kcapi_proc.o.usual
/drivers/base/power/main.o.usual
/drivers/isdn/i4l/isdn_tty.o.usual
/drivers/isdn/i4l/isdn_net.o.usual
/drivers/isdn/i4l/isdn_common.o.usual (*)
/drivers/isdn/capi/capiutil.o.usual
/drivers/base/power/sysfs.o.usual
/drivers/isdn/i4l/isdn_audio.o.usual
/drivers/base/class.o.usual
/drivers/base/dd.o.usual
/drivers/base/power/wakeup.o.usual
/drivers/base/core.o.usual
/drivers/tty/tty_io.o.usual
/drivers/base/bus.o.usual
/drivers/isdn/i4l/isdn_ppp.o.usual
/drivers/base/devres.o.usual
/drivers/isdn/capi/kcapi.o.usual (*)
-o /capidrv.ko.linked (here files are linked to)

I attached corresponding bitcode files and their source code files. If you will try simply something like this (LLVM linker can be found in the directory rule-instrumentor/aspectator/bin of installed ldv-tools):
llvm-2.6-bin/bin/llvm-ld isdn_common.o.usual kcapi.o.usual

you will gain the same problem as described:
llvm-ld: error: Cannot link file 'kcapi.o.usual': Alias Collision on 'init_module': aliases have different aliasees

I believe that the problem comes from ldv-git that forms cmdstream incorrectly for this case (especially since the problem came when Alexey updated the ldv-git after 2 months out-of-date state).

Actions #3

Updated by Evgeny Novikov almost 14 years ago

More details (but not all... there is no cmdstream file for example) can be found in the attached by Alexey file.

Actions #4

Updated by Evgeny Novikov almost 14 years ago

  • Category changed from LDV-Git to 15
  • Assignee changed from Pavel Shved to Evgeny Novikov

module_init function is something like this:

module_init(cmodio_init);

static inline initcall_t __inittest(void) { return cmodio_init; } int init_module(void) __attribute__((alias("cmodio_init")));

I suggest that we really can remove it from code by means of small simple aspect extension and in fact it's the problem of llvm-ld.

Actions #5

Updated by Evgeny Novikov almost 14 years ago

I try to reproduce the given bug on pure linux-2.6.37.y (git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.37.y.git) without any cached and stored previously data and has neither the given problem nor #718. All works good. Now I'll try to obtain the list of linked drivers as the above one.

Actions #6

Updated by Evgeny Novikov almost 14 years ago

This list consists of just one object file:

drivers/isdn/capi/capidrv.o.general

Actions #7

Updated by Pavel Shved almost 14 years ago

Please, attach your metadata files for the commits you check. I'll check if there's any difference

$LDVGIT_BASE/envs/1/metadata/meta-<commit>
Actions #10

Updated by Pavel Shved almost 14 years ago

Joker's metadata contain no dependency data at all! Perhaps, the reason is in format of GCC debug dump, see #789.

Actions #12

Updated by Evgeny Novikov almost 14 years ago

Just see on file sizes. They are really too different!

Actions #13

Updated by Pavel Shved almost 14 years ago

Yeah, and your dump now contains the function calls. You may continue with fixing alias collision, and I'll merge the fix into master tomorrow.

Actions #14

Updated by Evgeny Novikov almost 14 years ago

Eugene Novikov wrote:

I try to reproduce the given bug on pure linux-2.6.37.y (git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.37.y.git) without any cached and stored previously data and has neither the given problem nor #718. All works good. Now I'll try to obtain the list of linked drivers as the above one.

Even with correct metadata I still has no problem as I've already described above.
May be different commit history causes this effect.

Actions #15

Updated by Evgeny Novikov almost 14 years ago

The given addition to all aspect models:

around: define(module_init(initfn))
{}
around: define(module_exit(exitfn))
{}

should fix the problem with alias collisions.
It's tested now.

Actions #16

Updated by Pavel Shved almost 14 years ago

Eugene Novikov wrote:

It's tested now.

I don't see anything in the master branch... Is it tested, or is it being tested?

Actions #17

Updated by Evgeny Novikov almost 14 years ago

Now it's tested by Alexey since he has appropriate environment and often encounters the problem. If he'll see that the problem is fixed and new problems related with the fix don't arise on 08_1 model and on other aspect models then this will be pushed to the master.

Also we've keep in mind that after aspectator migration from LLVM platform these model fixes possibly should be canceled.

Actions #18

Updated by Pavel Shved almost 14 years ago

Eugene Novikov wrote:

Now it's tested by Alexey

Eugene, please! The correct usage is "the fix is being tested", to stress that it's both passive voice and the action that is taking place right now.

Also we've keep in mind that after aspectator migration from LLVM platform these model fixes possibly should be canceled.

Could you please create a new bug "migrate from LLVM to bare GCC" and mark this bug as related to that one? Just to collect such issues in one place...

Actions #19

Updated by Pavel Shved almost 14 years ago

  • Priority changed from Urgent to Normal
Actions #20

Updated by Evgeny Novikov almost 14 years ago

Add this bug as blocker of Bug #876.

Actions #21

Updated by Evgeny Novikov over 13 years ago

  • Status changed from Open to Resolved
  • Published in build set to e2a8d1f

There is no more the given issue since we have moved aspectator from LLVM to GCC.

Actions #22

Updated by Pavel Shved over 13 years ago

  • Status changed from Resolved to Closed
Actions #23

Updated by Evgeny Novikov about 12 years ago

  • Project changed from Linux Driver Verification to C Instrumentation Framework
  • Category deleted (15)
Actions

Also available in: Atom PDF