bug-apl
[Top][All Lists]
Advanced

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

Re: libapl with fpc (free pascal)


From: Dr . Jürgen Sauermann
Subject: Re: libapl with fpc (free pascal)
Date: Sat, 11 Jun 2022 19:29:14 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

Hi,

I have no immediate answer what is going wrong.
Possibly the parallel execution subsystem is not properly initialized.

Did you call init_libapl() before using libapl?

I also fixed a few issues in the parallel execution (which is used even if
no parallel execution takes place). Maybe the behaviour is different
now (SVN 1562).

Best Regards,
Jürgen


On 6/11/22 1:34 AM, enztec@gmx.com wrote:
Hi,

thank you for this information about how )copy works.

since it was such a simple idea to get )copy working with libapl i went back to my libapl with fpc (free pascal) coding to get it working there.

i was able to write a sinple file reading procedure in fpc to have a copy procedure for my libapl with fpc
i'll leave writing the file reading code for libapl with c and libapl with python to others

i wrote a freepascal library unit that allows everything i want to run with libapl with fpc (especiall your apl_exec('rs←(a,¨b)⌷¨⊂ar'); code with no problems so i was very surprised when demoing my code that the folloing simple code runtime exceptions resulted

there are only 2 problem apl code locations for these errors

just to clarify these errors only occur (along with the ⎕pw divide by zero error which i resolved in src/UCS_string.cc a few years ago with your help) with libapl with fpc - the only problems with libapl c and python were the )copy problem

-

libapl.pas  +1 and 1+1 and (1 2 3)=1 2 3

An unhandled exception occurred at $B7639BE7:
EAccessViolation: Access violation
  $B7639BE7
  $B763A33A
  $B76415DB
  $B75A1C76
  $B76448B4
  $B7551D0C
  $B75527E2
  $B7551698
  $080489EB  main,  line 86 of libapl.pas

gdb libapl

(gdb) run
Program received signal SIGSEGV, Segmentation fault.
Parallel_job_list<PJob_scalar_B, false>::start (loc=0xb7ef29a3 "ScalarFunction.cc:157", first_job=..., this=0x2c) at PJob.hh:261
261        /// set current job. CAUTION: jobs may be modified by the

(gdb) where
#0  0xb7e38be7 in Parallel_job_list<PJob_scalar_B, false>::start(PJob_scalar_B const&, char const*)
    (loc=0xb7ef29a3 "ScalarFunction.cc:157", first_job=..., this=0x2c) at PJob.hh:261
#1  0xb7e38be7 in ScalarFunction::do_scalar_B(ErrorCode&, Value const&, ErrorCode (Cell::*)(Cell*) const) const
    (this=0xb7f81420 <Bif_F12_PLUS::_fun>, ec=@0xbfffefa8: E_NO_ERROR, B=..., fun=<optimized out>) at ScalarFunction.cc:157
#2  0xb7e3933a in ScalarFunction::eval_scalar_B(Value const&, ErrorCode (Cell::*)(Cell*) const) const
    (this=0xb7f81420 <Bif_F12_PLUS::_fun>, B=..., fun=&virtual table offset 156) at ScalarFunction.cc:130
#3  0xb7e405db in Bif_F12_PLUS::eval_B(Value_P) const (this=0xb7f81420 <Bif_F12_PLUS::_fun>, B=...) at ScalarFunction.hh:800
#4  0xb7d9f364 in Prefix::reduce_MISC_F_B_() (this=0x80f3a68) at Prefix.cc:975
#5  0xb7da0c76 in Prefix::reduce_statements() (this=<optimized out>) at Prefix.cc:706
#6  0xb7e438b4 in StateIndicator::run() (this=0x80f3448) at StateIndicator.cc:357
#7  0xb7d5dcdb in Executable::execute_body() const (this=0x80ee5e0) at Executable.cc:261
#8  0xb7d50d0c in Command::finish_context() () at Command.cc:343
#9  0xb7d517e2 in Command::do_APL_expression(UCS_string&) (line=...) at Command.cc:331
#10 0xb7d50698 in Command::process_line(UCS_string&) (line=...) at Command.cc:141
#11 0xb7ec298b in apl_exec(char const*) (line=0x809edca <_$LIBAPL$_Ld33+2> "") at libapl.cc:363
#12 0x080489eb in main () at libapl.pas:86

-

libapl.pas  a[⍳4]+.=b[⍳4] and a+.=b

An unhandled exception occurred at $B7512726:
EAccessViolation: Access violation
  $B7512726

(gdb) run
Program received signal SIGSEGV, Segmentation fault.
0xb7d1a726 in Bif_OPER2_INNER::PF_scalar_inner_product (tctx=...) at Bif_OPER2_INNER.cc:250
250     ShapeItem z = tctx.get_N() * slice_len;

(gdb) where
#0  0xb7d1a726 in Bif_OPER2_INNER::PF_scalar_inner_product(Thread_context&) (tctx=...) at Bif_OPER2_INNER.cc:250
#1  0xb7d1c22d in Bif_OPER2_INNER::scalar_inner_product() const (this=0xbffff058) at Bif_OPER2_INNER.cc:235
#2  0xb7d1c22d in Bif_OPER2_INNER::eval_ALRB(Value_P, Token&, Token&, Value_P) const
    (this=0xb7f74200 <Bif_OPER2_INNER::_fun>, A=..., _LO=..., _RO=..., B=...) at Bif_OPER2_INNER.cc:141
#3  0xb7d5a939 in DerivedFunction::eval_AB(Value_P, Value_P) const (this=0x80f3448, A=..., B=...) at DerivedFunction.cc:216
#4  0xb7d9e163 in Prefix::reduce_A_F_B_() (this=0x80f3a68) at Prefix.cc:1177
#5  0xb7da0c76 in Prefix::reduce_statements() (this=<optimized out>) at Prefix.cc:706
#6  0xb7e438b4 in StateIndicator::run() (this=0x80f3448) at StateIndicator.cc:357
#7  0xb7d5dcdb in Executable::execute_body() const (this=0x80ee510) at Executable.cc:261
#8  0xb7d50d0c in Command::finish_context() () at Command.cc:343
#9  0xb7d517e2 in Command::do_APL_expression(UCS_string&) (line=...) at Command.cc:331
#10 0xb7d50698 in Command::process_line(UCS_string&) (line=...) at Command.cc:141
#11 0xb7ec298b in apl_exec(char const*) (line=0x809ede1 <_$LIBAPL$_Ld36+17> "") at libapl.cc:363
#12 0x08048a60 in main () at libapl.pas:104

---





reply via email to

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