p4lang / p4c

P4_16 reference compiler
https://p4.org/
Apache License 2.0
671 stars 442 forks source link

p4test segfaults when provided with two -v flags #838

Closed hanw closed 7 years ago

hanw commented 7 years ago

happens with any p4-16 problem.

./p4test -I p4include --p4v=16 ~/p4-tests/mint.p4 -v -v
Invoking preprocessor
cc -E -x c -Wno-comment -C -undef -nostdinc  -Ip4include -I/Users/hanwang/bf-p4c-compilers/build/p4c/./p4include /Users/hanwang/p4-tests/mint.p4
Parsing P4-16 program /Users/hanwang/p4-tests/mint.p4
Segmentation fault: 11
mihaibudiu commented 7 years ago

I cannot reproduce this problem; I have run successfully p4test with two -v flags using test programs from the testdata/p4_16_samples folder.

hanw commented 7 years ago

With two -v flags, I had the issue with a program that is using another architecture definition (not v1model).

With three -v flags, following error happens on

./p4test --p4v=16 ~/bf-p4c-compilers/p4-tests/p4_16/apply_if.p4 -v -v -v

518655.588:gc:1:****** GC called ****** (heap size 479232)
518655.588:gc:1:****** GC called ****** (heap size 479232)
518655.588:gc:1:****** GC called ****** (heap size 479232)
518655.588:gc:1:****** GC called ****** (heap size 479232)
518655.588:gc:1:****** GC called ****** (heap size 479232)
Segmentation fault: 11
mihaibudiu commented 7 years ago

Can you please supply a program that reproduces this problem? apply_if is not part of the testsuite. I have tried several of the tests and none has failed yet.

sethfowler commented 7 years ago

Han, can you still reproduce now that #852 has landed?

mihaibudiu commented 7 years ago

If this is fixed perhaps we can close it.