phorward / unicc

LALR parser generator targetting C, C++, Python, JavaScript, JSON and XML
MIT License
58 stars 9 forks source link

Build failing with newest libphorward develop #8

Closed phorward closed 5 years ago

phorward commented 5 years ago

Due to changes in the libphorward hashing algorithms, UniCC fails to compile with a segmentation fault. image

$ valgrind ./unicc_boot1 -svwb parse_boot2 parse.par
==17116== Memcheck, a memory error detector
==17116== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==17116== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
==17116== Command: ./unicc_boot1 -svwb parse_boot2 parse.par
==17116== 
UniCC version: 1.5
Parsing grammar...==17116== Invalid write of size 1
==17116==    at 0x10CF60: parse (parse_boot1.c:1677)
==17116==    by 0x10D6D3: parse_grammar (parse_boot1.c:1949)
==17116==    by 0x123317: main (main.c:285)
==17116==  Address 0x4c is not stack'd, malloc'd or (recently) free'd
==17116== 
==17116== 
==17116== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==17116==  Access not within mapped region at address 0x4C
==17116==    at 0x10CF60: parse (parse_boot1.c:1677)
==17116==    by 0x10D6D3: parse_grammar (parse_boot1.c:1949)
==17116==    by 0x123317: main (main.c:285)
==17116==  If you believe this happened as a result of a stack
==17116==  overflow in your program's main thread (unlikely but
==17116==  possible), you can try to increase the size of the
==17116==  main thread stack using the --main-stacksize= flag.
==17116==  The main thread stack size used in this run was 8388608.
==17116== 
==17116== HEAP SUMMARY:
==17116==     in use at exit: 354,785 bytes in 3,316 blocks
==17116==   total heap usage: 3,786 allocs, 470 frees, 464,350 bytes allocated
==17116== 
==17116== LEAK SUMMARY:
==17116==    definitely lost: 763 bytes in 45 blocks
==17116==    indirectly lost: 5,024 bytes in 120 blocks
==17116==      possibly lost: 0 bytes in 0 blocks
==17116==    still reachable: 348,998 bytes in 3,151 blocks
==17116==         suppressed: 0 bytes in 0 blocks
==17116== Rerun with --leak-check=full to see details of leaked memory
==17116== 
==17116== For counts of detected and suppressed errors, rerun with: -v
==17116== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)
phorward commented 5 years ago

Fixed with 22c2303e4bd233e66f8e6b5c61b1dbc857039e8a