Bug#540571: Backtrace

2009-08-22 Thread Michael Gold
On Fri, Aug 21, 2009 at 10:35:51 +0300, Peter Pentchev wrote:
> I've fixed it in my Subversion repository, and I'll release hexer-0.1.5
> (adopting the upstream) soon.  In the meantime, could you try dropping
> the attached file into debian/patches/ and adding it to "series" to
> see if it helps?

I no longer see the problem after applying that patch -- I was able to
open and edit a file normally.

Thanks,
-- Michael


signature.asc
Description: Digital signature


Processed: Re: Bug#540571: Backtrace

2009-08-21 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> package hexer
Limiting to bugs with field 'package' containing at least one of 'hexer'
Limit currently set to 'package':'hexer'

> tag 540571 + confirmed pending
Bug #540571 [hexer] crashes when ':' typed
Added tag(s) confirmed and pending.
> thanks
Stopping processing here.

Please contact me if you need assistance.

Debian bug tracking system administrator
(administrator, Debian Bugs database)


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#540571: Backtrace

2009-08-21 Thread Peter Pentchev
package hexer
tag 540571 + confirmed pending
thanks

On Sun, Aug 09, 2009 at 08:09:52PM -0400, Michael Gold wrote:
> Here's the gdb output after rebuilding it with debug symbols:
> 
> Program received signal SIGSEGV, Segmentation fault.
[snip]
> #3  0x00407cdc in tio_vprintf (fmt=0x42ab95 "%s", ap=0x7fffe4c0)
> at tio.c:2098
> #4  0x00407c86 in tio_printf (fmt=0x42ab95 "%s") at tio.c:2078

I think I found it; thanks for the bug report, it would never have
crossed my mind to examine this particular piece of the hexer code
to see what devilish magic it does behind the curtain!

I've fixed it in my Subversion repository, and I'll release hexer-0.1.5
(adopting the upstream) soon.  In the meantime, could you try dropping
the attached file into debian/patches/ and adding it to "series" to
see if it helps?

Once again, thanks for the bug report and the backtrace!

G'luck,
Peter

-- 
Peter Pentchev  r...@ringlet.netr...@space.bgr...@freebsd.org
PGP key:http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
This sentence contradicts itself - or rather - well, no, actually it doesn't!
The v*printf() routines may NOT be invoked a second time over the same
varargs list.  Avoid undefined behavior by simply using vasprintf()
which has been available on Linux, among other systems, for a long time.

A more portable fix will be included in hexer-0.1.5.

--- a/tio.c
+++ b/tio.c
@@ -542,6 +542,7 @@
 }
 /* tio_isprint */
 
+#if 0
 #if USE_STDARG
   int
 nprintf(const char *fmt, ...)
@@ -580,6 +581,7 @@
   return vfprintf(null, fmt, ap);
 }
 /* vnprintf */
+#endif
 
 #if USE_STDARG
   static void
@@ -2092,11 +2094,11 @@
*/
 {
   char *s;
-  int rval, len;
+  int rval;
 
-  len = vnprintf(fmt, ap);
-  rval = vsprintf(s = (char *)malloc(len + 1), fmt, ap);
-  s[len] = 0;
+  rval = vasprintf(&s, fmt, ap);
+  if (rval == -1)
+return rval;
   tio_display(s, 0);
   free((char *)s);
   return rval;
@@ -2135,11 +2137,11 @@
*/
 {
   char *s;
-  int rval, len;
+  int rval;
 
-  len = vnprintf(fmt, ap);
-  rval = vsprintf(s = (char *)malloc(len + 1), fmt, ap);
-  s[len] = 0;
+  rval = vasprintf(&s, fmt, ap);
+  if (rval == -1)
+return rval;
   tio_puts(s);
   free((char *)s);
   return rval;
--- a/tio.h
+++ b/tio.h
@@ -113,6 +113,7 @@
   extern
 tio_isprint( /* int x */ );
 
+#if 0
   extern
 #if USE_STDARG
 nprintf( const char *fmt, ... );
@@ -125,6 +126,7 @@
   /* Returns the number of output characters a call to a printf-like function
* would pruduce.
*/
+#endif
 
   extern
 tio_init( /* char *program_name */ );


pgpqzeh8YW8nc.pgp
Description: PGP signature


Bug#540571: Backtrace

2009-08-09 Thread Michael Gold
Here's the gdb output after rebuilding it with debug symbols:

Program received signal SIGSEGV, Segmentation fault.
strlen () at ../sysdeps/x86_64/strlen.S:48
48  ../sysdeps/x86_64/strlen.S: No such file or directory.
~   in ../sysdeps/x86_64/strlen.S
Current language:  auto; currently asm
(gdb) bt
#0  strlen () at ../sysdeps/x86_64/strlen.S:48
#1  0x7760e42e in _IO_vfprintf_internal (s=0x7fffe360, 
format=, ap=0x7fffe4c0) at vfprintf.c:1602
#2  0x7762d239 in __IO_vsprintf (string=0x669c10 "", 
format=0x42ab95 "%s", args=0x7fffe4c0) at iovsprintf.c:43
#3  0x00407cdc in tio_vprintf (fmt=0x42ab95 "%s", ap=0x7fffe4c0)
at tio.c:2098
#4  0x00407c86 in tio_printf (fmt=0x42ab95 "%s") at tio.c:2078
#5  0x00412ff8 in readline (prompt=0x42ab5b ":", 
default_val=0x7fffe740 "", context=0) at readline.c:1102
#6  0x0040f2d3 in he_query_command (prompt=0x42ab5b ":", 
dfl=0x7fffe740 "", context=0) at hexer.c:556
#7  0x0040ffaa in hexer () at hexer.c:911
#8  0x0040dfe0 in main (argc=1, argv=0x7fffe978) at main.c:251
(gdb) 


signature.asc
Description: Digital signature