bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-apl] Crash when trying to run illegal code


From: Elias Mårtenson
Subject: [Bug-apl] Crash when trying to run illegal code
Date: Tue, 5 Dec 2017 18:46:03 +0800

I made a typo and was presented with an APL stack trace which suggests a bug in GNU APL.
The reduced test case is as follows:

      (2 2⍴1) +⍤1 0 1 1

Which presents the following:

Incomplete value at Symbol.cc:128
Addr:    0x55891db89770
Rank:    1
Shape:   ⊏1⊐
Flags:   --
First:   1 
Dynamic: DynamicObject: 0x55891db89778 (Value: 0x55891db89778) :
    prev:      0x55891db89948
    next:      0x55891db895a8
    allocated: Bif_OPER2_RANK.cc:403
value history disabled


==============================================================================
Assertion failed: 0
in Function:      assign
in file:          Symbol.cc:131

Call stack:

----------------------------------------
-- Stack trace at Symbol.cc:131
----------------------------------------
0x7FCC546B1F6A __libc_start_main
0x55891BD3B595  main
0x55891BEBE96D   Workspace::immediate_execution(bool)
0x55891BD917AF    Command::process_line()
0x55891BD92057     Command::do_APL_expression(UCS_string&)
0x55891BD91867      Command::finish_context()
0x55891BD9D39D       Executable::execute_body() const
0x55891BE57764        StateIndicator::run()
0x55891BDE0E6E         Prefix::reduce_statements()
0x55891BDDBAA8          Prefix::reduce_A_F_B_()
0x55891BDA6543           DerivedFunction::eval_AB(Value_P, Value_P)
0x55891BD6C03A            Bif_OPER2_RANK::eval_ALRB(Value_P, Token&, Token&, Value_P)
0x55891BD6A9C2             Bif_OPER2_RANK::do_ALyXB(Value_P, int, Token&, Value_P, Value_P, int)
0x55891BEA228D              UserFunction::eval_ALXB(Value_P, Token&, Value_P, Value_P)
0x55891BE67C55               Symbol::push_value(Value_P)
0x55891BE6A301                Symbol::assign(Value_P, bool, char const*)
0x55891BD4F82C                 do_Assert(char const*, char const*, char const*, int)
========================================

SI stack:

Depth:      21
Exec:       0x55891db4c920
Safe exec:  0
Pmode:      ∇ μ-Z__A_LO_RANK_X7_B[1]
PC:         0 (114) 'μ-X7
Stat:       (X7 LA rho_A LB rho_B LZ rho_Z)←X7
err_code:   0x0

Depth:      20
Exec:       0x55891db79e70
Safe exec:  0
Pmode:      ◊  (2 2⍴1) +⍤1 0 1 1
PC:         8 (10) ENDL
Stat:       (2 2⍴1) +⍤1 0 1 1
err_code:   0x0

Depth:      19
Exec:       0x55891db683c0
Safe exec:  0
Pmode:      ◊  (2 2⍴1) +⍤1 0 1
PC:         9 (10) RETURN_STATS
Stat:       (2 2⍴1) +⍤1 0 1
err_code:   0x20002
thrown at:  Prefix.cc:1780
e_msg_1:    'SYNTAX ERROR'
e_msg_2:    '      (2 2⍴1)+⍤1 0 1'
e_msg_3:    '      ^      ^'

Depth:      18
Exec:       0x55891db4c920
Safe exec:  0
Pmode:      ∇ μ-Z__A_LO_RANK_X7_B[1]
PC:         0 (114) 'μ-X7
Stat:       (X7 LA rho_A LB rho_B LZ rho_Z)←X7
err_code:   0xA01
thrown at:  Symbol.cc:131
e_msg_1:    'Assertion failed'
e_msg_2:    ''
e_msg_3:    ''

Depth:      17
Exec:       0x55891db6dcc0
Safe exec:  0
Pmode:      ◊  (2 2⍴1) +⍤1 0 1 2
PC:         8 (10) ENDL
Stat:       (2 2⍴1) +⍤1 0 1 2
err_code:   0x0

Depth:      16
Exec:       0x55891db4c920
Safe exec:  0
Pmode:      ∇ μ-Z__A_LO_RANK_X7_B[1]
PC:         0 (114) 'μ-X7
Stat:       (X7 LA rho_A LB rho_B LZ rho_Z)←X7
err_code:   0xA01
thrown at:  Symbol.cc:131
e_msg_1:    'Assertion failed'
e_msg_2:    ''
e_msg_3:    ''

Depth:      15
Exec:       0x55891db7fda0
Safe exec:  0
Pmode:      ◊  (2 2⍴1) +⍤1 0 1 2 3
PC:         8 (10) ENDL
Stat:       (2 2⍴1) +⍤1 0 1 2 3
err_code:   0x0

Depth:      14
Exec:       0x55891db75660
Safe exec:  0
Pmode:      ◊  (2 2⍴1) +⍤1 1 1
PC:         9 (10) RETURN_STATS
Stat:       (2 2⍴1) +⍤1 1 1
err_code:   0x20002
thrown at:  Prefix.cc:1780
e_msg_1:    'SYNTAX ERROR'
e_msg_2:    '      (2 2⍴1)+⍤1 1 1'
e_msg_3:    '      ^      ^'

Depth:      13
Exec:       0x55891db6b970
Safe exec:  0
Pmode:      ◊  (2 2⍴1) +⍤1 2 3
PC:         9 (10) RETURN_STATS
Stat:       (2 2⍴1) +⍤1 2 3
err_code:   0x20002
thrown at:  Prefix.cc:1780
e_msg_1:    'SYNTAX ERROR'
e_msg_2:    '      (2 2⍴1)+⍤1 2 3'
e_msg_3:    '      ^      ^'

Depth:      12
Exec:       0x55891db74ee0
Safe exec:  0
Pmode:      ◊  (2 2⍴1) +⍤1 2 3 4 5
PC:         8 (10) ENDL
Stat:       (2 2⍴1) +⍤1 2 3 4 5
err_code:   0x50002
thrown at:  ScalarFunction.cc:315
e_msg_1:    'RANK ERROR'
e_msg_2:    '      (2 2⍴1)+⍤1 2 3 4 5'
e_msg_3:    '      ^     ^'

Depth:      11
Exec:       0x55891db4c920
Safe exec:  0
Pmode:      ∇ μ-Z__A_LO_RANK_X7_B[1]
PC:         0 (114) 'μ-X7
Stat:       (X7 LA rho_A LB rho_B LZ rho_Z)←X7
err_code:   0xA01
thrown at:  Symbol.cc:131
e_msg_1:    'Assertion failed'
e_msg_2:    ''
e_msg_3:    ''

Depth:      10
Exec:       0x55891db79fd0
Safe exec:  0
Pmode:      ◊  z +⍤1 0 2 1 (⊢ 100 200 300)
PC:         8 (10) ENDL
Stat:       z +⍤1 0 2 1 (⊢ 100 200 300)
err_code:   0x0

Depth:      9
Exec:       0x55891db7fe80
Safe exec:  0
Pmode:      ◊  z +⍤(1 0 ⊢ 100 200 300)
PC:         9 (10) RETURN_STATS
Stat:       z +⍤(1 0 ⊢ 100 200 300)
err_code:   0x20002
thrown at:  Prefix.cc:1780
e_msg_1:    'SYNTAX ERROR'
e_msg_2:    '      z+⍤(1 0⊢100 200 300)'
e_msg_3:    '      ^^'

Depth:      8
Exec:       0x55891db4c920
Safe exec:  0
Pmode:      ∇ μ-Z__A_LO_RANK_X7_B[3]
PC:         63 (114) ⊂
Stat:       LOOP:Z[N]←⊂(rho_A⍴A[N;]) LO rho_B⍴B[N;]
err_code:   0x50003
thrown at:  ScalarFunction.cc:315
e_msg_1:    'LENGTH ERROR'
e_msg_2:    'μ-Z__A_LO_RANK_X7_B[3]  μ-Z[μ-N]←⊂(μ-rho_A⍴μ-A[μ-N;])μ-LO μ-rho_B⍴μ-B[μ-N;]'
e_msg_3:    '                                  ^                       ^'

Depth:      7
Exec:       0x55891db800f0
Safe exec:  0
Pmode:      ◊  z +⍤1 (0 ⊢ 100 200 300)
PC:         9 (11) ENDL
Stat:       z +⍤1 (0 ⊢ 100 200 300)
err_code:   0x0

Depth:      6
Exec:       0x55891db4c920
Safe exec:  0
Pmode:      ∇ μ-Z__A_LO_RANK_X7_B[1]
PC:         0 (114) 'μ-X7
Stat:       (X7 LA rho_A LB rho_B LZ rho_Z)←X7
err_code:   0xA01
thrown at:  Symbol.cc:131
e_msg_1:    'Assertion failed'
e_msg_2:    ''
e_msg_3:    ''

Depth:      5
Exec:       0x55891db6b720
Safe exec:  0
Pmode:      ◊  z +⍤1 0 100 200 300
PC:         4 (6) ENDL
Stat:       z +⍤1 0 100 200 300
err_code:   0x0

Depth:      4
Exec:       0x55891db4c920
Safe exec:  0
Pmode:      ∇ μ-Z__A_LO_RANK_X7_B[3]
PC:         63 (114) ⊂
Stat:       LOOP:Z[N]←⊂(rho_A⍴A[N;]) LO rho_B⍴B[N;]
err_code:   0x50003
thrown at:  ScalarFunction.cc:315
e_msg_1:    'LENGTH ERROR'
e_msg_2:    'μ-Z__A_LO_RANK_X7_B[3]  μ-Z[μ-N]←⊂(μ-rho_A⍴μ-A[μ-N;])μ-LO μ-rho_B⍴μ-B[μ-N;]'
e_msg_3:    '                                  ^                       ^'

Depth:      3
Exec:       0x55891db75720
Safe exec:  0
Pmode:      ◊  z (+⍤1 1) 100 200 300
PC:         7 (9) ENDL
Stat:       z (+⍤1 1) 100 200 300
err_code:   0x0

Depth:      2
Exec:       0x55891db686a0
Safe exec:  0
Pmode:      ◊  200 300 400 + z
PC:         3 (5) ENDL
Stat:       200 300 400 + z
err_code:   0x50002
thrown at:  ScalarFunction.cc:315
e_msg_1:    'RANK ERROR'
e_msg_2:    '      200 300 400+z'
e_msg_3:    '      ^           ^'

Depth:      1
Exec:       0x55891db68f90
Safe exec:  0
Pmode:      ◊  100 200 300 400 +[1] z
PC:         6 (8) ENDL
Stat:       100 200 300 400 +[1] z
err_code:   0x50003
thrown at:  ScalarFunction.cc:804
e_msg_1:    'LENGTH ERROR'
e_msg_2:    '      100 200 300 400+[1]z'
e_msg_3:    '      ^                  ^'

Depth:      0
Exec:       0x55891db62d70
Safe exec:  0
Pmode:      ◊  a+(⍴z)⍴100 200 300 400
PC:         7 (10) 'a
Stat:       a+(⍴z)⍴100 200 300 400
err_code:   0x30001
thrown at:  Symbol.cc:683
e_msg_1:    'VALUE ERROR'
e_msg_2:    '      a+(⍴z)⍴100 200 300 400'
e_msg_3:    '      ^'


==============================================================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]