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

32 bit issues #44

Closed
sans-sense opened this issue Dec 10, 2012 · 1 comment
Closed

32 bit issues #44

sans-sense opened this issue Dec 10, 2012 · 1 comment

Comments

@sans-sense
Copy link

building on 32 bit ubuntu 12.04 complains about unavailable values at intr.c:694 and generates core dump at dt_module.c:992.

I am not an expert, but the below patch works for me.

The code seems to declare gate_t as gate64 or gate32, but this block uses gate64 fields which are not available on my 32 bit machine. If I patch
--- a/driver/intr.c
+++ b/driver/intr.c
@@ -694,10 +694,14 @@ dtrace_write_idt_entry2(int vec)

info[0].vector = vec;
info[0].address = gate_offset(*val);
  • // AN we do not have these for 32 bits
    +#ifndef __i386
    info[0].cs = gate_segment(*val);
    info[0].flags = val->dpl;
    if (val->type == GATE_INTERRUPT)
    info[0].flags |= 1 << 2;
    +#endif

It works.

I am also seeing coredumps from dt_module.c as dm_aslen seems to be 0, so when it enters the for loop, the first run with 0 gives problems, introducing a length check prevents this issue.

--- a/libdtrace/dt_module.c
+++ b/libdtrace/dt_module.c

@@ -992,9 +992,12 @@ asmap[i]->st_size);_/
}
} else {
Elf32_Sym *_asmap = dmp->dm_asmap;

  •   for (i = 0; i < dmp->dm_aslen-1; i++) {
    
  •    // AN no values for dmp->dm_aslen
    
  •    if (dmp->dm_aslen > 0) {
    
  •      for (i = 0; i < dmp->dm_aslen-1; i++) {
        asmap[i]->st_size = asmap[i+1]->st_value - asmap[i]->st_value;
    
  •   }
    
  •      }
    
  •    }
    

I am running with the latest code and the last commit was commit 21b5732

@dtrace4linux
Copy link
Owner

Thanks Apurba for these two fixes. The second fix is suboptimal, so have
put in the same fix i did for x86_64; the first one I could not reproduce
on my 12.04 VM, but I have put it in anyhow.

Thanks for pointing out the latter issue - I was wondering why it was core
dumping during the usdt test.

On 10 December 2012 05:43, Apurba notifications@github.com wrote:

building on 32 bit ubuntu 12.04 complains about unavailable values at
intr.c:694 and generates core dump at dt_module.c:992.

I am not an expert, but the below patch works for me.

The code seems to declare gate_t as gate64 or gate32, but this block uses
gate64 fields which are not available on my 32 bit machine. If I patch
--- a/driver/intr.c
+++ b/driver/intr.c
@@ -694,10 +694,14 @@ dtrace_write_idt_entry2(int vec)

info[0].vector = vec;
info[0].address = gate_offset(*val);

  • // AN we do not have these for 32 bits +#ifndef __i386 info[0].cs =
    gate_segment(*val); info[0].flags = val->dpl; if (val->type ==
    GATE_INTERRUPT) info[0].flags |= 1 << 2; +#endif +

It works.

I am also seeing coredumps from dt_module.c as dm_aslen seems to be 0, so
when it enters the for loop, the first run with 0 gives problems,
introducing a length check prevents this issue.

--- a/libdtrace/dt_module.c
+++ b/libdtrace/dt_module.c
@@ -992,9 +992,12 @@ asmap[i]->st_size);_/
}
} else {
Elf32_Sym *_asmap = dmp->dm_asmap;

  • for (i = 0; i < dmp->dm_aslen-1; i++) {
  • // AN no values for dmp->dm_aslen
  • if (dmp->dm_aslen > 0) {
  • for (i = 0; i < dmp->dm_aslen-1; i++) { asmap[i]->st_size =
    asmap[i+1]->st_value - asmap[i]->st_value;
  • }
  • }
  • }

I am running with the latest code and the last commit was commit 21b573221b5732
21b573221b5732


Reply to this email directly or view it on GitHubhttps://github.com//issues/44.

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

2 participants