Menu

#2 sigsegv on version 2.30 using Linux

open
nobody
None
5
2024-11-13
2009-01-12
No

I'm using a Slackware 12.2 system kernel 2.6.27.7

After compiling and installing bwbasic 2.30 it failed every time I tried to run it with a sigsegv.

I debugged it by running bwbasic under gdb.

The failing line was line 2518 of bwb_var.c in function
var_islocal().

Line 2518 is:

for ( v = CURTASK excs[ CURTASK exsc ].local_variable; v != NULL; v = v->next )

It turns out that variable exsc is -1 and an invalid table index.

To fix the problem I test variable exsc and if it is less than zero then make the function return with a NULL value.

Attached is a patch file that should fix the problem.

Discussion

  • Richard Narron

    Richard Narron - 2009-01-12

    patch to fix sigsegv from bwb_var.c

     
  • Paul Edwards

    Paul Edwards - 2024-11-13

    The code shown disappeared in a revamp by another developer. If you're still having a problem, I will need a fresh patch.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.