[GH-ISSUE #1863] Segmentation fault on ARM build #1238

Closed
opened 2026-10-14 03:40:39 +07:00 by bsakaguchi · 16 comments
Owner

Originally created by @thecommandline on GitHub (Oct 29, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1863

Originally assigned to: @jfoug on GitHub.

I am trying to run JtR on a raspberry pi 2 ( ARM Cortex-A7 ) running RASPBIAN JESSIE fully updated. I compiled with MPI enabled since my end goal is to run it on a cluster.

pi@control ~/JohnTheRipper/run $ ./john --test
Could not find section [List.Generic:dynamic_1000] in the john.ini/conf file
Segmentation fault

pi@control ~/JohnTheRipper/run $ gdb ./john

(gdb) run --test
Starting program: /home/pi/JohnTheRipper/run/john --test
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
Cannot access memory at address 0x0

Program received signal SIGILL, Illegal instruction.
0x76e25d08 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
(gdb) bt
#0  0x76e25d08 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
#1  0x76e223f4 in OPENSSL_cpuid_setup () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
#2  0x76fdf058 in call_init (l=<optimized out>, argc=2, argv=0x7efff744, env=0x7efff750)
    at dl-init.c:78
#3  0x76fdf134 in _dl_init (main_map=0x76fff958, argc=2, argv=0x7efff744, env=0x7efff750)
    at dl-init.c:126
#4  0x76fcfda4 in _dl_start_user () from /lib/ld-linux-armhf.so.3
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Originally created by @thecommandline on GitHub (Oct 29, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1863 Originally assigned to: @jfoug on GitHub. I am trying to run JtR on a raspberry pi 2 ( ARM Cortex-A7 ) running RASPBIAN JESSIE fully updated. I compiled with MPI enabled since my end goal is to run it on a cluster. ``` pi@control ~/JohnTheRipper/run $ ./john --test Could not find section [List.Generic:dynamic_1000] in the john.ini/conf file Segmentation fault pi@control ~/JohnTheRipper/run $ gdb ./john (gdb) run --test Starting program: /home/pi/JohnTheRipper/run/john --test [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". Cannot access memory at address 0x0 Program received signal SIGILL, Illegal instruction. 0x76e25d08 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0 (gdb) bt #0 0x76e25d08 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0 #1 0x76e223f4 in OPENSSL_cpuid_setup () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0 #2 0x76fdf058 in call_init (l=<optimized out>, argc=2, argv=0x7efff744, env=0x7efff750) at dl-init.c:78 #3 0x76fdf134 in _dl_init (main_map=0x76fff958, argc=2, argv=0x7efff744, env=0x7efff750) at dl-init.c:126 #4 0x76fcfda4 in _dl_start_user () from /lib/ld-linux-armhf.so.3 Backtrace stopped: previous frame identical to this frame (corrupt stack?) ```
bsakaguchi 2026-10-14 03:40:39 +07:00
Author
Owner

@magnumripper commented on GitHub (Oct 29, 2015):

The "Could not find section" is strange, we had one other user report that recently. And why did you not get that under gdb?

Your segfault seem to be within OpenSSL and I see no clue as to why. Unless that's just some normal exception during CPU enumeration, that you can 'c'ontinue from and get on to the real problem? The "Illegal instruction" suggests so while the "memory at address 0x0" does not.

In case you have lldb, try using it instead of gdb. Sometimes it gives better backtraces.

<!-- gh-comment-id:152098467 --> @magnumripper commented on GitHub (Oct 29, 2015): The "Could not find section" is strange, we had one other user report that recently. And why did you not get that under gdb? Your segfault seem to be within OpenSSL and I see no clue as to why. Unless that's just some normal exception during CPU enumeration, that you can 'c'ontinue from and get on to the real problem? The "Illegal instruction" suggests so while the "memory at address 0x0" does not. In case you have lldb, try using it instead of gdb. Sometimes it gives better backtraces.
Author
Owner

@magnumripper commented on GitHub (Oct 29, 2015):

Also, perhaps you can run a ./john --list=build-info without getting a segfault? Post output here please.

<!-- gh-comment-id:152100960 --> @magnumripper commented on GitHub (Oct 29, 2015): Also, perhaps you can run a `./john --list=build-info` without getting a segfault? Post output here please.
Author
Owner

@magnumripper commented on GitHub (Oct 29, 2015):

@jfoug there actually is no dynamic_1000 in dynamic.conf - it starts at dynamic_1001. Why do we get that message? And why do I not get it?!

<!-- gh-comment-id:152101836 --> @magnumripper commented on GitHub (Oct 29, 2015): @jfoug there actually is no dynamic_1000 in dynamic.conf - it starts at dynamic_1001. Why do we get that message? And why do I not get it?!
Author
Owner

@magnumripper commented on GitHub (Oct 29, 2015):

@priorityinterrupt you are running latest (give or take) code from here, right? As opposed to some ancient tarball or "release".

<!-- gh-comment-id:152102070 --> @magnumripper commented on GitHub (Oct 29, 2015): @priorityinterrupt you are running latest (give or take) code from here, right? As opposed to some ancient tarball or "release".
Author
Owner

@lei-april commented on GitHub (Oct 29, 2015):

@priorityinterrupt What version of gcc are you using here? I remember having some trouble building JtR for ARM with gcc 4.6.3, while gcc 4.7.3 just worked fine. This might be irrelevant to the segfault you met, though.

<!-- gh-comment-id:152204010 --> @lei-april commented on GitHub (Oct 29, 2015): @priorityinterrupt What version of gcc are you using here? I remember having some trouble building JtR for ARM with gcc 4.6.3, while gcc 4.7.3 just worked fine. This might be irrelevant to the segfault you met, though.
Author
Owner

@thecommandline commented on GitHub (Oct 29, 2015):

Yes I cloned the git repo from here right before the build. Here is the build info.

pi@control ~/JohnTheRipper/run $ ./john --list=build-info
Version: 1.8.0-jumbo-1-4137-g1deee25
Build: linux-gnueabihf 32-bit NEON-ac MPI + OMP
SIMD: NEON, interleaving: MD4:2 MD5:2 SHA1:1 SHA256:1 SHA512:1
$JOHN is ./
Format interface version: 13
Max. number of reported tunable costs: 3
Rec file version: REC4
Charset file version: CHR3
CHARSET_MIN: 1 (0x01)
CHARSET_MAX: 255 (0xff)
CHARSET_LENGTH: 24
SALT_HASH_SIZE: 1048576
Max. Markov mode level: 400
Max. Markov mode password length: 30
gcc version: 4.9.2
GNU libc version: 2.19 (loaded: 2.19)
Crypto library: OpenSSL
OpenSSL library version: 0100010bf
OpenSSL 1.0.1k 8 Jan 2015
File locking: fcntl()
fseek(): fseeko64
ftell(): ftello64
fopen(): fopen64
memmem(): System's

Sorry Im not very familiar with gdb. I was able to continue and get some more info.

pi@control ~/JohnTheRipper/run $ gdb ./john

(gdb) run --test
Starting program: /home/pi/JohnTheRipper/run/john --test
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
Cannot access memory at address 0x0

Program received signal SIGILL, Illegal instruction.
0x76e25d08 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
(gdb) c
Continuing.
Could not find section [List.Generic:dynamic_1000] in the john.ini/conf file

Program received signal SIGSEGV, Segmentation fault.
0x000ab6c4 in Count_Items (Key=Key@entry=0x286cf4 "Func=") at dynamic_parser.c:860
860     gen_line = gen_source->head;
(gdb) c
Continuing.

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb) bt
No stack.

Here is the backtrace after the "could not find section" error.

(gdb) c
Continuing.
Could not find section [List.Generic:dynamic_1000] in the john.ini/conf file

Program received signal SIGSEGV, Segmentation fault.
0x000ab6c4 in Count_Items (Key=Key@entry=0x286cf4 "Func=") at dynamic_parser.c:860
860     gen_line = gen_source->head;
(gdb) bt
#0  0x000ab6c4 in Count_Items (Key=Key@entry=0x286cf4 "Func=") at dynamic_parser.c:860
#1  0x000acc3c in dynamic_LOAD_PARSER_FUNCTIONS (which=1000, pFmt=0x7618bee8) at dynamic_parser.c:911
#2  0x00090268 in LoadOneFormat (idx=idx@entry=1000, pFmt=0x7618bee8) at dynamic_fmt.c:7712
#3  0x000ab16c in dynamic_Register_formats (ptr=0x3c5d48 <__stack_chk_guard@@GLIBC_2.4>) at dynamic_fmt.c:7832
#4  0x0022321c in john_register_all () at john.c:374
#5  0x002268d8 in john_init (name=0x7efff86c "john", argc=2, argv=0x7efff734) at john.c:1449
#6  0x00227894 in main (argc=2, argv=0x7efff734) at john.c:1899

I installed lldb but am less familiar with it than I am with gdb which is not saying much. I am failing to get any useful info out of it. But if you can give me the right syntax I can run it.

pi@control ~/JohnTheRipper/run $ lldb ./john
Current executable set to './john' (arm).
(lldb) run --test
Process 4278 launching
Segmentation fault

pi@control ~/JohnTheRipper/run $ lldb ./john
Current executable set to './john' (arm).
(lldb) breakpoint set -f dynamic_parser.c -l 860
Breakpoint 1: where = john`Count_Items + 12 at dynamic_parser.c:860, address = 0x000ab6b8
(lldb) r --test
Process 4300 launching
Segmentation fault
<!-- gh-comment-id:152288508 --> @thecommandline commented on GitHub (Oct 29, 2015): Yes I cloned the git repo from here right before the build. Here is the build info. ``` pi@control ~/JohnTheRipper/run $ ./john --list=build-info Version: 1.8.0-jumbo-1-4137-g1deee25 Build: linux-gnueabihf 32-bit NEON-ac MPI + OMP SIMD: NEON, interleaving: MD4:2 MD5:2 SHA1:1 SHA256:1 SHA512:1 $JOHN is ./ Format interface version: 13 Max. number of reported tunable costs: 3 Rec file version: REC4 Charset file version: CHR3 CHARSET_MIN: 1 (0x01) CHARSET_MAX: 255 (0xff) CHARSET_LENGTH: 24 SALT_HASH_SIZE: 1048576 Max. Markov mode level: 400 Max. Markov mode password length: 30 gcc version: 4.9.2 GNU libc version: 2.19 (loaded: 2.19) Crypto library: OpenSSL OpenSSL library version: 0100010bf OpenSSL 1.0.1k 8 Jan 2015 File locking: fcntl() fseek(): fseeko64 ftell(): ftello64 fopen(): fopen64 memmem(): System's ``` Sorry Im not very familiar with gdb. I was able to continue and get some more info. ``` pi@control ~/JohnTheRipper/run $ gdb ./john (gdb) run --test Starting program: /home/pi/JohnTheRipper/run/john --test [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". Cannot access memory at address 0x0 Program received signal SIGILL, Illegal instruction. 0x76e25d08 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0 (gdb) c Continuing. Could not find section [List.Generic:dynamic_1000] in the john.ini/conf file Program received signal SIGSEGV, Segmentation fault. 0x000ab6c4 in Count_Items (Key=Key@entry=0x286cf4 "Func=") at dynamic_parser.c:860 860 gen_line = gen_source->head; (gdb) c Continuing. Program terminated with signal SIGSEGV, Segmentation fault. The program no longer exists. (gdb) bt No stack. ``` Here is the backtrace after the "could not find section" error. ``` (gdb) c Continuing. Could not find section [List.Generic:dynamic_1000] in the john.ini/conf file Program received signal SIGSEGV, Segmentation fault. 0x000ab6c4 in Count_Items (Key=Key@entry=0x286cf4 "Func=") at dynamic_parser.c:860 860 gen_line = gen_source->head; (gdb) bt #0 0x000ab6c4 in Count_Items (Key=Key@entry=0x286cf4 "Func=") at dynamic_parser.c:860 #1 0x000acc3c in dynamic_LOAD_PARSER_FUNCTIONS (which=1000, pFmt=0x7618bee8) at dynamic_parser.c:911 #2 0x00090268 in LoadOneFormat (idx=idx@entry=1000, pFmt=0x7618bee8) at dynamic_fmt.c:7712 #3 0x000ab16c in dynamic_Register_formats (ptr=0x3c5d48 <__stack_chk_guard@@GLIBC_2.4>) at dynamic_fmt.c:7832 #4 0x0022321c in john_register_all () at john.c:374 #5 0x002268d8 in john_init (name=0x7efff86c "john", argc=2, argv=0x7efff734) at john.c:1449 #6 0x00227894 in main (argc=2, argv=0x7efff734) at john.c:1899 ``` I installed lldb but am less familiar with it than I am with gdb which is not saying much. I am failing to get any useful info out of it. But if you can give me the right syntax I can run it. ``` pi@control ~/JohnTheRipper/run $ lldb ./john Current executable set to './john' (arm). (lldb) run --test Process 4278 launching Segmentation fault pi@control ~/JohnTheRipper/run $ lldb ./john Current executable set to './john' (arm). (lldb) breakpoint set -f dynamic_parser.c -l 860 Breakpoint 1: where = john`Count_Items + 12 at dynamic_parser.c:860, address = 0x000ab6b8 (lldb) r --test Process 4300 launching Segmentation fault ```
Author
Owner

@magnumripper commented on GitHub (Oct 29, 2015):

That backtrace after the "could not find section" is just what we needed, thanks! I'll have a look at the code.

<!-- gh-comment-id:152289074 --> @magnumripper commented on GitHub (Oct 29, 2015): That backtrace after the "could not find section" is just what we needed, thanks! I'll have a look at the code.
Author
Owner

@magnumripper commented on GitHub (Oct 29, 2015):

@priorityinterrupt please try d194066. It doesn't fix the root issue (I have absolutely no idea what it is) but it adds some safety so you should not get that segfault.

@jfoug what the heck is going on here, how come it's looking for dynamic_1000 at all? There is no such thing in the entire source tree, yet it looks for it? I really can't see what would be different on an ARM system that causes this.

<!-- gh-comment-id:152293746 --> @magnumripper commented on GitHub (Oct 29, 2015): @priorityinterrupt please try d194066. It doesn't fix the root issue (I have absolutely no idea what it is) but it adds some safety so you should not get that segfault. @jfoug what the heck is going on here, how come it's looking for dynamic_1000 at all? There is no such thing in the entire source tree, yet it looks for it? I really can't see what would be different on an ARM system that causes this.
Author
Owner

@magnumripper commented on GitHub (Oct 29, 2015):

OK apparently it brute-forces all numbers from 0 to 4999. That is hideous, but OT - it shouldn't cause these problems.

<!-- gh-comment-id:152295409 --> @magnumripper commented on GitHub (Oct 29, 2015): OK apparently it brute-forces all numbers from 0 to 4999. That is hideous, but OT - it shouldn't cause these problems.
Author
Owner

@magnumripper commented on GitHub (Oct 29, 2015):

@jfoug I think the problem is this system defaults to unsigned char, and you are using char as a tristate with -1, 0 and 1.

<!-- gh-comment-id:152299374 --> @magnumripper commented on GitHub (Oct 29, 2015): @jfoug I think the problem is this system defaults to unsigned char, and you are using char as a tristate with -1, 0 and 1.
Author
Owner

@magnumripper commented on GitHub (Oct 29, 2015):

If I'm right about that, ff38778 hopefully fixes all problems.

<!-- gh-comment-id:152300462 --> @magnumripper commented on GitHub (Oct 29, 2015): If I'm right about that, ff38778 hopefully fixes all problems.
Author
Owner

@thecommandline commented on GitHub (Oct 29, 2015):

OK build d194066 runs now but before it runs it produces a lot of stderr output.

Could not find section [List.Generic:dynamic_1000] in the john.ini/conf file
Error invalid format dynamic_1000: The first command MUST be a clean of input 1 or input 2 OR a special key 2 input loader function
Could not find section [List.Generic:dynamic_1035] in the john.ini/conf file
Error invalid format dynamic_1035: The first command MUST be a clean of input 1 or input 2 OR a special key 2 input loader function
Could not find section [List.Generic:dynamic_1036] in the john.ini/conf file
Error invalid format dynamic_1036: The first command MUST be a clean of input 1 or input 2 OR a special key 2 input loader function
Could not find section [List.Generic:dynamic_1037] in the john.ini/conf file
Error invalid format dynamic_1037: The first command MUST be a clean of input 1 or input 2 OR a special key 2 input loader function
Could not find section [List.Generic:dynamic_1038] in the john.ini/conf file
Error invalid format dynamic_1038: The first command MUST be a clean of input 1 or input 2 OR a special key 2 input loader function
Could not find section [List.Generic:dynamic_1039] in the john.ini/conf file
Error invalid format dynamic_1039: The first command MUST be a clean of input 1 or input 2 OR a special key 2 input loader function
Could not find section [List.Generic:dynamic_1040] in the john.ini/conf file
Error invalid format dynamic_1040: The first command MUST be a clean of input 1 or input 2 OR a special key 2 input loader function
.
.
.
Error invalid format dynamic_4999: The first command MUST be a clean of input 1 or input 2 OR a special key 2 input loader function
Will run 4 OpenMP threads
<!-- gh-comment-id:152301629 --> @thecommandline commented on GitHub (Oct 29, 2015): OK build d194066 runs now but before it runs it produces a lot of stderr output. ``` Could not find section [List.Generic:dynamic_1000] in the john.ini/conf file Error invalid format dynamic_1000: The first command MUST be a clean of input 1 or input 2 OR a special key 2 input loader function Could not find section [List.Generic:dynamic_1035] in the john.ini/conf file Error invalid format dynamic_1035: The first command MUST be a clean of input 1 or input 2 OR a special key 2 input loader function Could not find section [List.Generic:dynamic_1036] in the john.ini/conf file Error invalid format dynamic_1036: The first command MUST be a clean of input 1 or input 2 OR a special key 2 input loader function Could not find section [List.Generic:dynamic_1037] in the john.ini/conf file Error invalid format dynamic_1037: The first command MUST be a clean of input 1 or input 2 OR a special key 2 input loader function Could not find section [List.Generic:dynamic_1038] in the john.ini/conf file Error invalid format dynamic_1038: The first command MUST be a clean of input 1 or input 2 OR a special key 2 input loader function Could not find section [List.Generic:dynamic_1039] in the john.ini/conf file Error invalid format dynamic_1039: The first command MUST be a clean of input 1 or input 2 OR a special key 2 input loader function Could not find section [List.Generic:dynamic_1040] in the john.ini/conf file Error invalid format dynamic_1040: The first command MUST be a clean of input 1 or input 2 OR a special key 2 input loader function . . . Error invalid format dynamic_4999: The first command MUST be a clean of input 1 or input 2 OR a special key 2 input loader function Will run 4 OpenMP threads ```
Author
Owner

@thecommandline commented on GitHub (Oct 29, 2015):

Compiling ff38778 now.

<!-- gh-comment-id:152302432 --> @thecommandline commented on GitHub (Oct 29, 2015): Compiling ff38778 now.
Author
Owner

@magnumripper commented on GitHub (Oct 29, 2015):

I'm willing to bet I nailed it but I'm not 100% sure I fixed all instances of it. It's kind of hard to search for this bug. I wonder if there's a compiler warning we could enable.

OTOH we could add -fsigned-char to the compiler flags... but that would be cheating, wouldn't it? Better fix all the (likely very few) cases like this one.

Note to self: The switches -funsigned-char and -fsigned-char do not refer to char *.

<!-- gh-comment-id:152303618 --> @magnumripper commented on GitHub (Oct 29, 2015): I'm willing to bet I nailed it but I'm not 100% sure I fixed all instances of it. It's kind of hard to search for this bug. I wonder if there's a compiler warning we could enable. OTOH we could add `-fsigned-char` to the compiler flags... but that would be cheating, wouldn't it? Better fix all the (likely very few) cases like this one. Note to self: The switches `-funsigned-char` and `-fsigned-char` do not refer to `char *`.
Author
Owner

@thecommandline commented on GitHub (Oct 29, 2015):

Awesome it looks like you got it. The benchmarks are running and there were no error or warning messages before it started.

Thank you!

<!-- gh-comment-id:152308397 --> @thecommandline commented on GitHub (Oct 29, 2015): Awesome it looks like you got it. The benchmarks are running and there were no error or warning messages before it started. Thank you!
Author
Owner

@magnumripper commented on GitHub (Oct 29, 2015):

Cool. Please report any failures from full --test (as separate issues), there might be similar bugs in some formats although it should be rare.

BTW for just self-test with no benchmark, a --test=0 is a whole lot quicker.

<!-- gh-comment-id:152309819 --> @magnumripper commented on GitHub (Oct 29, 2015): Cool. Please report any failures from full `--test` (as separate issues), there might be similar bugs in some formats although it should be rare. BTW for just self-test with no benchmark, a `--test=0` is a whole lot quicker.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#1238
No description provided.