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
Can't create field name of more than 7 characters on Mac #136
Comments
I'm able to reproduce this on Sierra and it looks to me like it crashes inside Judy.
|
Okay, here's what I've found:
typedef struct SHORCUTLEAF
{
Pvoid_t scl_Pvalue; // callers value area.
uint8_t scl_Index[WORDSIZE]; // base Index string.
} scl_t , *Pscl_t;
As to the solution, I see three options:
|
If a compiler flag fixes it, we can include the flag in our tap. |
On Mac OS, strcpy under the hood calls `__strcpy_chk` which attempts to check if the destination is large enough to fit the input. Due to how the `SHORTCUTLEAF` struct is defined in `JudySL.c`, `__strcpy_chk` believes it can only fit `sizeof(WORDSIZE)`, while it is actually a variable-sized field. This change passes `_FORTIFY_SOURCE=0` to clang, which ensures `__strcpy_chk` is *not* inserted. Fixes traildb/traildb#136
When running this command I get a crash with
Abort trap: 6
:However, if the 8 characters field is not the first, it works:
I tried installing traildb manually or with Homebrew with the same results.
I found this bug because the first tutorial has a field with 'username' and it made my program crash.
Machine configuration:
Macbook pro retina
Processor: 2.9 GHz Intel Core i5
OS: macOS Sierra (10.12.5)
Note that I tried on a mac which didn't run on Sierra and
tdb
worked fine.The text was updated successfully, but these errors were encountered: