Skip to content
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

pike8: segfault on invalid source code input #54

Open
mknos opened this issue Feb 11, 2025 · 0 comments
Open

pike8: segfault on invalid source code input #54

mknos opened this issue Feb 11, 2025 · 0 comments

Comments

@mknos
Copy link

mknos commented Feb 11, 2025

I don't have a Current version of pike installed. I have two different versions of Pike8 installed on arm64 and armv7. I am reporting this in case the problem also exists in the current version.

I select an invalid input file. In this case it is a perl script. The download link is:
https://raw.githubusercontent.com/briandfoy/PerlPowerTools/refs/heads/master/bin/morse

After printing a few syntax errors, pike fails with a Segmentation fault. This should not happen. Possibly pike should give up on this input file earlier. The line number for pike_types.c is slightly different for the two pike versions I tested.

  1. arm64
%pike morse
morse:3:syntax error, unexpected '='
morse:17:syntax error, unexpected TOK_COLON_COLON, expecting '('
morse:19:syntax error, unexpected '('
morse:19:Illegal character '$' (0x24)
morse:21:syntax error, unexpected '%'
morse:37:syntax error, unexpected '%'
morse:39:syntax error, unexpected '%'
morse:44:syntax error, unexpected '%'
morse:45:syntax error, unexpected '('
morse:45:Illegal character '\' (0x5c)
morse:46:Illegal character '$' (0x24)
morse:47:Illegal character '$' (0x24)
morse:48:Missing ';'.
morse:49:Illegal character '$' (0x24)
morse:49:Missing ';'.
morse:50:Illegal character '$' (0x24)
morse:50:Missing ';'.
morse:51:Illegal character '$' (0x24)
morse:51:Missing ';'.
morse:52:syntax error, unexpected '}'
morse:52:Missing ';'.
./src/pike_types.c:709: Fatal error:
Type mark stack underflow
Segmentation fault

%pike
Pike v8.0 release 1738 running Hilfe v3.5 (Incremental Pike Frontend)
> System.uname();
(1) Result: ([ /* 5 elements */
              "machine": "aarch64",
              "nodename": "raspberrypi",
              "release": "6.6.51+rpt-rpi-v8",
              "sysname": "Linux",
              "version": "#1 SMP PREEMPT Debian 1:6.6.51-1+rpt3 (2024-10-08)"
            ])
> Pike.get_runtime_info();
(2) Result: ([ /* 6 elements */
              "abi": 64,
              "auto_bignum": 1,
              "bytecode_method": "default",
              "float_size": 64,
              "int_size": 64,
              "native_byteorder": 1234
            ])
Terminal closed.
  1. armv7
%pike morse
morse:3:syntax error, unexpected '='
morse:17:syntax error, unexpected TOK_COLON_COLON, expecting '('
morse:19:syntax error, unexpected '('
morse:19:Illegal character '$' (0x24)
morse:21:syntax error, unexpected '%'
morse:37:syntax error, unexpected '%'
morse:39:syntax error, unexpected '%'
morse:44:syntax error, unexpected '%'
morse:45:syntax error, unexpected '('
morse:45:Illegal character '\' (0x5c)
morse:46:Illegal character '$' (0x24)
morse:47:Illegal character '$' (0x24)
morse:48:Missing ';'.
morse:49:Illegal character '$' (0x24)
morse:49:Missing ';'.
morse:50:Illegal character '$' (0x24)
morse:50:Missing ';'.
morse:51:Illegal character '$' (0x24)
morse:51:Missing ';'.
morse:52:syntax error, unexpected '}'
morse:52:Missing ';'.
./src/pike_types.c:707: Fatal error:
Type mark stack underflow
Segmentation fault

%pike
Pike v8.0 release 1116 running Hilfe v3.5 (Incremental Pike Frontend)
> System.uname();
(1) Result: ([ /* 5 elements */
              "machine": "armv7l",
              "nodename": "raspberrypi",
              "release": "5.10.63-v7+",
              "sysname": "Linux",
              "version": "#1459 SMP Wed Oct 6 16:41:10 BST 2021"
            ])
> Pike.get_runtime_info();
(2) Result: ([ /* 6 elements */
              "abi": 32,
              "auto_bignum": 1,
              "bytecode_method": "default",
              "float_size": 32,
              "int_size": 32,
              "native_byteorder": 1234
            ])
Terminal closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant