Closed shove70 closed 5 years ago
On centos7: line 1522: assert(r.numele == 0); Sometimes you will encounter assertion errors.
On macOS: In addition to the four cases mentioned above, there is a fifth case:
malloc: Incorrect checksum for freed object 0x7f92d74040b0: probably modified after being freed.
Corrupt value: 0x7f92d7403230
hunttest_radix(14390,0x1036375c0) malloc: *** set a breakpoint in malloc_error_break to debug
Program exited with code -6
Preliminary judgment:
void* n = malloc (... size)
The structure lacks initialization. After adding memset (n, 0, size);
or *n.init;
after malloc, the error situation is greatly reduced, but it still exists.
In a word, Radix has a lot of problems, which affect the normal use of hunt-framework.
fixed a bug at https://github.com/huntlabs/hunt/commit/2f1dc6d1cca8044edd903d14e24f146474f94dfe. i run your example and radix's unittest in debian with dmd-2.086.0 (x86_64) well. what's compier?
If (s. length = 0) is a small problem, the key problem is not here.
DMD: 2.086.0 (x86_64) OS: MacOS 10.14.5
Run test2() in unittest in the radix.d file in centos7, and you can see the exception triggered by the assert(r.numele == 0);
DMD: 2.086.0 (x86_64)
Run my example and radix's unittest in MacOS with dmd-2.086.0 (x86_64). You can see these problems.
Note: Please add two lines to unittest: test1(); test2();
On MacOS, There may be bugs in Radix tree.
Using this code to test, run it several times, and you will get different results:
Radix has a problem that prevents hunt-framework from working properly.