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

Server crashed when run the program on armv5 board? #381

Closed
wufengyi opened this issue Mar 10, 2016 · 3 comments
Closed

Server crashed when run the program on armv5 board? #381

wufengyi opened this issue Mar 10, 2016 · 3 comments

Comments

@wufengyi
Copy link

Recently,I want to port iperf3 to armv5 board,But when I run the program ,It crashed(the error message is Segmentation fault).

After I investigate this problem using core dumped and arm-linux-objdump,I find that this arm assembly command cause the problem:

815c: e7961002 ldr r1, [r6, r2]

Below is the function which lead to the crash and corresponding arm assembly code:

iprintf(test, report_bw_format, sp->socket, st, et, ubuf, nbuf, irp->omitted?report_omitted:"");

8134: e59a303c ldr r3, [sl, #60]
8138: e59b000c ldr r0, [fp, #12]
813c: e3530000 cmp r3, #0 ; 0x0
8140: 0a000042 beq 8250 <iperf_print_intermediate+0x540>
8144: e59f3488 ldr r3, [pc, #1160] ; 85d4 <iperf_print_intermediate+0x8c4>
8148: e59d6050 ldr r6, [sp, #80]
814c: e796e003 ldr lr, [r6, r3]
8150: e59f243c ldr r2, [pc, #1084] ; 8594 <iperf_print_intermediate+0x884>
8154: e59d6050 ldr r6, [sp, #80]
8158: e59dc074 ldr ip, [sp, #116]
815c: e7961002 ldr r1, [r6, r2]
8160: e59d3070 ldr r3, [sp, #112]
8164: e1a02000 mov r2, r0
8168: e1a00009 mov r0, r9
816c: e98d0030 stmib sp, {r4, r5}
8170: e58d800c str r8, [sp, #12]
8174: e58d7010 str r7, [sp, #16]
8178: e58de014 str lr, [sp, #20]
817c: e58dc000 str ip, [sp]
8180: ebfff258 bl 4ae8 <_init+0x608>
8184: eaffff75 b 7f60 <iperf_print_intermediate+0x250>
So,can anyone kindly tell me what is wrong with this c function?

@HelioCampos
Copy link

Hi Wu,

  • The header format for the function iprintf is the following:

iprintf(struct iperf_test test, const char format, ...)

Where:
iperf_test: structure describing deveral options you passed. Including
the "role" with says if you are running as a client "c" or as a sender "s".
format: is an array of chars definning the format of the list of
variables defined after it. It seems the all the variables defined after
the format should has the same type.

  • I recomend you to put a printf before the line "iprintf(test,
    report_bw_format, sp->socket, st, et, ubuf, nbuf,
    irp->omitted?report_omitted:"");", see the values passed and make sure all
    types are the same for sp->socket, st, et, ubuf, nbuf, and
    irp->omitted?report_omitted:"".
  • If all the types are correct, there could be a problem with iprintf and
    it is necessary do debug it more.
  • It would help if you pass the arguments you are passing as well all
    version of OS and hardware.

2016-03-10 2:45 GMT-03:00 wu notifications@github.com:

Recently,I want to port iperf3 to armv5 board,But when I run the program
,It crashed(the error message is Segmentation fault).

After I investigate this problem using core dumped and arm-linux-objdump,I
find that this arm assembly command cause the problem:

815c: e7961002 ldr r1, [r6, r2]

Below is the function which lead to the crash and corresponding arm
assembly code:

iprintf(test, report_bw_format, sp->socket, st, et, ubuf, nbuf,
irp->omitted?report_omitted:"");

8134: e59a303c ldr r3, [sl, #60 https://github.com//issues/60
]
8138: e59b000c ldr r0, [fp, #12 https://github.com//issues/12
]
813c: e3530000 cmp r3, #0 ; 0x0
8140: 0a000042 beq 8250
8144: e59f3488 ldr r3, [pc, #1160] ; 85d4
8148: e59d6050 ldr r6, [sp, #80 https://github.com//issues/80
]
814c: e796e003 ldr lr, [r6, r3]
8150: e59f243c ldr r2, [pc, #1084] ; 8594
8154: e59d6050 ldr r6, [sp, #80 https://github.com//issues/80
]
8158: e59dc074 ldr ip, [sp, #116
https://github.com//issues/116]
815c: e7961002 ldr r1, [r6, r2]
8160: e59d3070 ldr r3, [sp, #112
https://github.com//issues/112]
8164: e1a02000 mov r2, r0
8168: e1a00009 mov r0, r9
816c: e98d0030 stmib sp, {r4, r5}
8170: e58d800c str r8, [sp, #12 https://github.com//issues/12
]
8174: e58d7010 str r7, [sp, #16 https://github.com//issues/16
]
8178: e58de014 str lr, [sp, #20 https://github.com//issues/20
]
817c: e58dc000 str ip, [sp]
8180: ebfff258 bl 4ae8 <_init+0x608>
8184: eaffff75 b 7f60
So,can anyone kindly tell me what is wrong with this c function?


Reply to this email directly or view it on GitHub
#381.

Helio Campos Mello de Andrade
Administrador de sistemas/Infraestrutura

mobile: +55 11 969292828
desk: +55 11 30482927
skype: heliocamposmello
helio.andrade@titansgroup.com.br

@bmah888
Copy link
Contributor

bmah888 commented Apr 14, 2017

Not sure if there's a bug here...???...

@bmah888
Copy link
Contributor

bmah888 commented May 31, 2017

Timeout due to inactivity and lack of additional information. Closing.

@bmah888 bmah888 closed this as completed May 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants