Skip to content

Syntax.copy() throws UnsupportedOperationException #156

@necipfazil

Description

@necipfazil

The following error can be reproduced on branch sourceline_pc at commit 70380d3.

# get specific linux commit for kernel/locking/spinlock.c
cd ~/
git clone https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/
cd linux-next/
git checkout e2db7592be8e

# build kernel/locking/spinlock.c
klocalizer -a x86_64 kernel/locking/spinlock.c
make olddefconfig && make clean kernel/locking/spinlock.o

# create superc config file
SUPERC_DIR = ~/xtc-dev/ # or wherever it is installed
mkdir superc-configs/
bash $SUPERC_DIR/scripts/superc_linux.sh -w -L superc-configs/ kernel/locking/spinlock.c

# clear autoconf.h
rm include/generated/autoconf.h
touch include/generated/autoconf.h

# run superc
$SUPERC_DIR/scripts/superc_linux.sh -S"-restrictConfigToPrefix CONFIG_  -sourcelinePC sourceline_pc.txt" -L superc-configs/ kernel/locking/spinlock.c > out.txt 2> err.txt

Content of out.txt:

Processing kernel/locking/spinlock.c

Content of err.txt:

warning: #warning inconsistent configuration , CONFIG_CPU_BIG_ENDIAN is set

error: header string.h not found
warning: #warning inconsistent configuration , CONFIG_CPU_BIG_ENDIAN is set

error: header string.h not found
error: header asm/vtime.h not found
error: #error "include/generated/timeconst.h has the wrong HZ value!"

error: #error Invalid value of HZ .

error: #error "Unknown RCU implementation specified to kernel configuration"

error: macro "_raw_spin_lock_irqsave" requires 2 arguments, but only 1 given at kernel/locking/spinlock.c:126:34
java.lang.UnsupportedOperationException
	at superc.core.Syntax$Error.copy(Syntax.java:723)
	at superc.core.Preprocessor.replaceArgs(Preprocessor.java:4274)
	at superc.core.Preprocessor.expandFunction(Preprocessor.java:3028)
	at superc.core.Preprocessor.expandAndHoistFunction(Preprocessor.java:3266)
	at superc.core.Preprocessor.processToken(Preprocessor.java:2410)
	at superc.core.Preprocessor.__next(Preprocessor.java:409)
	at superc.core.Preprocessor.next(Preprocessor.java:371)
	at superc.SuperC$ConditionalBlock.readConditionalBlockGroups(SuperC.java:312)
	at superc.SuperC$ConditionalBlock.readConditionalBlock(SuperC.java:220)
	at superc.SuperC$ConditionalBlock.readConditionalBlockGroup(SuperC.java:264)
	at superc.SuperC$ConditionalBlock.readConditionalBlockGroups(SuperC.java:302)
	at superc.SuperC$ConditionalBlock.getConditionalBlockGroups(SuperC.java:176)
	at superc.SuperC.parse(SuperC.java:935)
	at xtc.util.Tool.run(Tool.java:502)
	at superc.SuperC.main(SuperC.java:2004)
1 error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions