Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax.copy() throws UnsupportedOperationException #156

Open
necipfazil opened this issue Aug 31, 2021 · 0 comments
Open

Syntax.copy() throws UnsupportedOperationException #156

necipfazil opened this issue Aug 31, 2021 · 0 comments

Comments

@necipfazil
Copy link
Contributor

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant