Ticket #89 (closed defect: fixed)

Opened 7 weeks ago

Last modified 6 weeks ago

Libmjollnir fails to analyse multiple files at the same time

Reported by: may Owned by: thorkill
Priority: major Milestone: v0.81
Component: libmjollnir Version:
Severity: High Keywords: mjollnir analyse multifile
Cc: thorkill

Description

I discovered that problem when trying to test the flowjack feature on multiple files in the same script.

The "analyse" command cannot be run multiple times in a single session. This will lead to a segfault. It is to be discussed if the reg_containers[] array of libmjollnir should be global or local to a context.

testsuite/static_instrumentation/flowjack/patch-both.esh

Will trigger the bug (dont forget to do make before executing the script)

Change History

Changed 6 weeks ago by thorkill

  • status changed from new to assigned

Changed 6 weeks ago by thorkill

Actually, mjollnir will fail to analyse 2 or more objects loaded in one session. It seems that this bug has been introduced in commit r1084.

 [D] curaddr analyzed: 0x08048692 (dstaddr = 0x08048680, retaddr = 0x08048694)
 ******** NO EMPTYING FUNC STACK -- ANALYZING MAIN ****** 

Breakpoint 1, mjr_analyse_section (sess=0x282849e4, 
    section_name=0x83eb1a6 "80486D1_inputs") at src/core.c:264
264           sess->cur->func_stack = elist_empty(sess->cur->func_stack->name);
(gdb) 
Continuing.

Program received signal SIGSEGV, Segmentation fault.
hash_get_head (h=0x8105040, backup=0x0) at libhash.c:358
358       for (index = 0; *backup; backup++)

#4  0x281a7611 in mjr_analyse_section (sess=0x282849e4, 
    section_name=0x83eb1a6 "80486D1_inputs") at src/core.c:264
264           sess->cur->func_stack = elist_empty(sess->cur->func_stack->name);
(gdb) p sess->cur->func_stack->name
$6 = 0x0

I will hunt it down.

Changed 6 weeks ago by thorkill

  • status changed from assigned to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.