Skip to contentSkip to conversation

Fix bc segmentation fault.

PATCH In review Kai Kang 2 participants 7 messages Aug 20, 2013 – Aug 26, 2013

lore
Share & tools
lore

Kai Kang

author
#0 lore raw

cover Fix bc segmentation fault.

The following changes since commit 6382979cca1d1c57467f983ba9611f91555b20a9:

cronie: fix out of tree build (2013-08-19 11:25:23 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib kangkai/bc
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/bc

Kai Kang (1):
bc: fix segmentation fault

 meta/recipes-extended/bc/bc_1.06.bb                |  3 ++-
 .../bc/files/fix-segment-fault.patch               | 28 ++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-extended/bc/files/fix-segment-fault.patch
Signature · 1 line
1.8.1.2
author
#1 lore raw

PATCH 1/1 bc: fix segmentation fault

When run 'bc -l', it segmentation faults. Apply patch from BLFS to fix it.

Ref:
http://www.mail-archive.com/[email protected]/msg04601.html

---
 meta/recipes-extended/bc/bc_1.06.bb                |  3 ++-
 .../bc/files/fix-segment-fault.patch               | 28 ++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-extended/bc/files/fix-segment-fault.patch
meta/recipes-extended/bc/bc_1.06.bb +2 -1
index fe9c3f4..4b28fad 100644
@@ -13,7 +13,8 @@ SECTION = "base"
 DEPENDS = "flex"
 PR = "r2"
 
-SRC_URI = "${GNU_MIRROR}/bc/bc-${PV}.tar.gz"
+SRC_URI = "${GNU_MIRROR}/bc/bc-${PV}.tar.gz \
+           file://fix-segment-fault.patch "
 
 SRC_URI[md5sum] = "d44b5dddebd8a7a7309aea6c36fda117"
 SRC_URI[sha256sum] = "4ef6d9f17c3c0d92d8798e35666175ecd3d8efac4009d6457b5c99cea72c0e33"
meta/recipes-extended/bc/files/fix-segment-fault.patch new file +28 -0
new file mode 100644
index 0000000..20c0da2
@@ -0,0 +1,28 @@
+Upstream-Status: Pending
+
+when run command such as 'echo "a = 13" | bc -l', it segmentation faults.
+This patch is from http://www.mail-archive.com/[email protected]/msg04602.html.
+
+Signed-off-by: Kai Kang <[email protected]>
+
+--- bc-1.06/lib/number.c.orig	2003-09-26 21:14:02.000000000 +0000
++++ bc-1.06/lib/number.c	2003-09-26 21:14:26.000000000 +0000
+@@ -34,6 +34,7 @@
+ #include <number.h>
+ #include <assert.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <ctype.h>/* Prototypes needed for external utility routines. */
+ 
+ #define bc_rt_warn rt_warn
+--- bc-1.06/bc/load.c.orig	2003-09-26 21:14:14.000000000 +0000
++++ bc-1.06/bc/load.c	2003-09-26 21:14:26.000000000 +0000
+@@ -156,7 +156,7 @@
+   long  label_no;
+   long  vaf_name;	/* variable, array or function number. */
+   long  func;
+-  program_counter save_adr;
++  static program_counter save_adr;
+ 
+   /* Initialize. */
+   str = code;
Signature · 1 line
1.8.1.2
#2 lore raw

Re: [PATCH 1/1] bc: fix segmentation fault

Quoted 36 lines · Kai Kang

When run 'bc -l', it segmentation faults. Apply patch from BLFS to fix it.

Ref:
http://www.mail-archive.com/[email protected]/msg04601.html

---
meta/recipes-extended/bc/bc_1.06.bb | 3 ++-
.../bc/files/fix-segment-fault.patch | 28 ++++++++++++++++++++++

2 files changed, 30 insertions(+), 1 deletion(-)

create mode 100644 meta/recipes-extended/bc/files/fix-segment-fault.patch

meta/recipes-extended/bc/bc_1.06.bb +0 -0
index fe9c3f4..4b28fad 100644
@@ -13,7 +13,8 @@ SECTION = "base"

DEPENDS = "flex"
PR = "r2"

meta/recipes-extended/bc/bc_1.06.bb +2 -1
-SRC_URI = "${GNU_MIRROR}/bc/bc-${PV}.tar.gz"
+SRC_URI = "${GNU_MIRROR}/bc/bc-${PV}.tar.gz \
+           file://fix-segment-fault.patch "

SRC_URI[md5sum] = "d44b5dddebd8a7a7309aea6c36fda117"
SRC_URI[sha256sum] = "4ef6d9f17c3c0d92d8798e35666175ecd3d8efac4009d6457b5c99cea72c0e33"

meta/recipes-extended/bc/files/fix-segment-fault.patch new file +4 -0
new file mode 100644
index 0000000..20c0da2
@@ -0,0 +1,28 @@
+Upstream-Status: Pending
+
+when run command such as 'echo "a = 13" | bc -l', it segmentation faults.
+This patch is from http://www.mail-archive.com/[email protected]/msg04602.html.

meta/recipes-extended/bc/files/fix-segment-fault.patch line 14

Quoted 10 lines
meta/recipes-extended/bc/files/fix-segment-fault.patch new file +10 -0
+
+Signed-off-by: Kai Kang <[email protected]>
+
+--- bc-1.06/lib/number.c.orig	2003-09-26 21:14:02.000000000 +0000
++++ bc-1.06/lib/number.c	2003-09-26 21:14:26.000000000 +0000
+@@ -34,6 +34,7 @@
+ #include <number.h>
+ #include <assert.h>
+ #include <stdlib.h>
++#include <string.h>

what does adding this include file fix ?

Quoted 21 lines
meta/recipes-extended/bc/files/fix-segment-fault.patch new file +14 -0
+ #include <ctype.h>/* Prototypes needed for external utility routines. */
+ 
+ #define bc_rt_warn rt_warn
+--- bc-1.06/bc/load.c.orig	2003-09-26 21:14:14.000000000 +0000
++++ bc-1.06/bc/load.c	2003-09-26 21:14:26.000000000 +0000
+@@ -156,7 +156,7 @@
+   long  label_no;
+   long  vaf_name;	/* variable, array or function number. */
+   long  func;
+-  program_counter save_adr;
++  static program_counter save_adr;
+ 
+   /* Initialize. */
+   str = code;
Signature · 6 lines
1.8.1.2

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
author
#3 lore raw

Re: [PATCH 1/1] bc: fix segmentation fault

Quoted 41 lines · Khem Raj
Quoted 39 lines · Kai Kang

When run 'bc -l', it segmentation faults. Apply patch from BLFS to fix it.

Ref:
http://www.mail-archive.com/[email protected]/msg04601.html

---
meta/recipes-extended/bc/bc_1.06.bb | 3 ++-
.../bc/files/fix-segment-fault.patch | 28 ++++++++++++++++++++++

2 files changed, 30 insertions(+), 1 deletion(-)

create mode 100644 meta/recipes-extended/bc/files/fix-segment-fault.patch

meta/recipes-extended/bc/bc_1.06.bb +0 -0
index fe9c3f4..4b28fad 100644
@@ -13,7 +13,8 @@ SECTION = "base"

DEPENDS = "flex"
PR = "r2"

meta/recipes-extended/bc/bc_1.06.bb +2 -1
-SRC_URI = "${GNU_MIRROR}/bc/bc-${PV}.tar.gz"
+SRC_URI = "${GNU_MIRROR}/bc/bc-${PV}.tar.gz \
+           file://fix-segment-fault.patch "

SRC_URI[md5sum] = "d44b5dddebd8a7a7309aea6c36fda117"
SRC_URI[sha256sum] = "4ef6d9f17c3c0d92d8798e35666175ecd3d8efac4009d6457b5c99cea72c0e33"

meta/recipes-extended/bc/files/fix-segment-fault.patch new file +7 -0
new file mode 100644
index 0000000..20c0da2
@@ -0,0 +1,28 @@
+Upstream-Status: Pending
+
+when run command such as 'echo "a = 13" | bc -l', it segmentation faults.
+This patch is from http://www.mail-archive.com/[email protected]/msg04602.html.
+
+Signed-off-by: Kai Kang <[email protected]>
+
Quoted 8 lines

meta/recipes-extended/bc/files/fix-segment-fault.patch line 14

Quoted 7 lines
meta/recipes-extended/bc/files/fix-segment-fault.patch new file +7 -0
+--- bc-1.06/lib/number.c.orig	2003-09-26 21:14:02.000000000 +0000
++++ bc-1.06/lib/number.c	2003-09-26 21:14:26.000000000 +0000
+@@ -34,6 +34,7 @@
+ #include <number.h>
+ #include <assert.h>
+ #include <stdlib.h>
++#include <string.h>

what does adding this include file fix ?

To be honest, I am not sure why add this include. After build it is harmless, so I didn't want to modify it because I think LFS is trustable.

Regards,
Kai

Quoted 24 lines
Quoted 22 lines
meta/recipes-extended/bc/files/fix-segment-fault.patch new file +14 -0
+ #include <ctype.h>/* Prototypes needed for external utility routines. */
+
+ #define bc_rt_warn rt_warn
+--- bc-1.06/bc/load.c.orig	2003-09-26 21:14:14.000000000 +0000
++++ bc-1.06/bc/load.c	2003-09-26 21:14:26.000000000 +0000
+@@ -156,7 +156,7 @@
+   long  label_no;
+   long  vaf_name;	/* variable, array or function number. */
+   long  func;
+-  program_counter save_adr;
++  static program_counter save_adr;
+
+   /* Initialize. */
+   str = code;
Signature · 6 lines
1.8.1.2

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 2 lines
Regards,
Neil | Kai Kang
#4 lore raw

Re: [PATCH 1/1] bc: fix segmentation fault

Kai

Quoted 4 lines · Kang Kai
Quoted 1 line

what does adding this include file fix ?

To be honest, I am not sure why add this include. After build it is harmless, so I didn't want to modify it because I think LFS is trustable.

Its matter of understanding the change and may be explaining a bit better what it fixes and make the patch better for upstream too so try to build it without this include added and see if you get some warnings/errors that it fixes and then add that information to patch header.

Quoted 2 lines

Regards,
Kai

author
#5 lore raw

Re: [PATCH 1/1] bc: fix segmentation fault

Quoted 8 lines · Khem Raj

Kai

Quoted 3 lines · Kang Kai
Quoted 1 line

what does adding this include file fix ?

To be honest, I am not sure why add this include. After build it is harmless, so I didn't want to modify it because I think LFS is trustable.

Its matter of understanding the change and may be explaining a bit better what it fixes and make the patch better for upstream too so try to build it without this include added and see if you get some warnings/errors that it fixes and then add that information to patch header.

Thanks.
I'll check it and be more careful next time.

Regards,
Kai

Quoted 5 lines
Quoted 3 lines

Regards,
Kai

Signature · 2 lines
Regards,
Neil | Kai Kang
author
#6 lore raw

Re: [PATCH 1/1] bc: fix segmentation fault

Quoted 8 lines · Kang Kai
Quoted 7 lines · Khem Raj

Kai

Quoted 3 lines · Kang Kai
Quoted 1 line

what does adding this include file fix ?

To be honest, I am not sure why add this include. After build it is harmless, so I didn't want to modify it because I think LFS is trustable.

Hi Raj,

Quoted 1 line
Quoted 1 line

Its matter of understanding the change and may be explaining a bit better what it fixes and make the patch better for upstream too so try to build it without this include added and see if you get some warnings/errors that it fixes and then add that information to patch header.

It is no warning shows without the include patch. But the patch is merged.

Sorry again.
Kai

Quoted 14 lines

Thanks.
I'll check it and be more careful next time.

Regards,
Kai

Quoted 5 lines
Quoted 3 lines

Regards,
Kai

Signature · 2 lines
Regards,
Neil | Kai Kang