avrdude-dev
[Top][All Lists]
Advanced

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

Re: [avrdude-dev] avrdude r1160 Segmentation fault


From: René Liebscher
Subject: Re: [avrdude-dev] avrdude r1160 Segmentation fault
Date: Sat, 04 May 2013 22:16:54 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

Hi,

ok, maybe not overwritten memory, but at least it writes (and reads) data using an uninitialized file descriptor. This brings then the strange output that I see on my terminal.

It obviously writes to fd 0 which is stdin, and that I see in terminal, 0>/dev/null lets disappear it. I never tried before to write something in stdin, I did not even know that could work.


René


On 04.05.2013 21:49, René Liebscher wrote:
Hi,

could you try to revert main.c to version 1159. I moved the display of the programmer before the open command, to see their pin outputs before they try to open, so I could see what they had read from the config file and internally processed with the new pin definitions. (I did this testing without having actually the hardware connected, so open always ended the program. And originally I did not intend to check in the file.)

It seems jtagmkii_display needs you to call jtagmkii_open beforehand. At least I get there some problems (with Ubuntu 12.10), and it looks as would be overwritten somewhere some memory. This might be the reason for the problem. reverting the file should make disappear the segfault. On the other hand, if this really overwrites some memory then there must be some other problem in the code of jtagmkii too, as normally some checking of return values or error codes should reveal the fact that the progammer was not opened beforehand.

René


On 04.05.2013 18:36, Joerg Wunsch wrote:
As Enoch wrote:

No surprise, I am here with Debian and its our of sync libs
while you are riding on FreeBSD :-)
OK, tried it on an Ubuntu, and can confirm the segfault:

Writing | ################################################## | 100% 0.04s

avrdude: 336 bytes of flash written

Program received signal SIGSEGV, Segmentation fault.
0x0000000000433f93 in jtagmkII_open (pgm=0x6db9c0, port=0x1 <Address 0x1 out of bounds>) at jtagmkII.c:1555
1555      if (strncmp(port, "usb", 3) == 0) {
(gdb) bt
#0 0x0000000000433f93 in jtagmkII_open (pgm=0x6db9c0, port=0x1 <Address 0x1 out of bounds>) at jtagmkII.c:1555 #1 0x000000000041b756 in do_op (pgm=0x6db9c0, p=0x834100, upd=0x663430, flags=UF_NONE) at update.c:322 #2 0x0000000000404408 in main (argc=<optimized out>, argv=<optimized out>) at main.c:1241

So "port" is given as 0x01 here.  Stack frame #1 is:

pgm->vfy_led(pgm, ON);

No idea offhand why that triggers a jtagmkII_open() with bogus
arguments.


_______________________________________________
avrdude-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/avrdude-dev




reply via email to

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