unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Kristoffer Grönlund" <krig@koru.se>
To: 12266@debbugs.gnu.org
Subject: bug#12266: 24.1; c-looking-at-inexpr-block: wrong type argument
Date: Thu, 23 May 2013 06:34:53 +0200	[thread overview]
Message-ID: <CAEFqW5q3F5_aBPKbFRYHJSKTRZ9+QSjMSsRcE42AfXueaD99qg@mail.gmail.com> (raw)
In-Reply-To: <m24nnttlhd.fsf@boostpro.com>


[-- Attachment #1.1: Type: text/plain, Size: 319 bytes --]

This just happened to me in a nightly build:

GNU Emacs 24.3.50.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
 of 2013-03-20 on bob.porkrind.org

I get this error once in a while when editing C or C++ code. This time it
happened while  reading SICP chapter 5 and scribbling, source attached.
Unsure how to debug it.

[-- Attachment #1.2: Type: text/html, Size: 479 bytes --]

[-- Attachment #2: backtrace.txt --]
[-- Type: text/plain, Size: 5407 bytes --]

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p (2193 . 2446))
  c-looking-at-inexpr-block((2193 . 2446) (2193 . 2446))
  c-inside-bracelist-p(2466 ((2193 . 2446) 2466 (1759 . 1803) (2193 . 2446) 2466 (1759 . 1803) (2193 . 2446) 2466 (1759 . 1803) (2193 . 2446) 2466 (1759 . 1803) (2193 . 2446) 2466 (1759 . 1803) (2193 . 2446) 2466 (1759 . 1803) (2193 . 2446) 2466 (1759 . 1803) (2193 . 2446) 2466 (1759 . 1803) (2193 . 2446) 2466 (1759 . 1803) (2193 . 2446) 2466 (1759 . 1803) (2193 . 2446) 2466 (1759 . 1803) (2193 . 2446) 2466 (1759 . 1803) (2193 . 2446) 2466 (1759 . 1803) (2193 . 2446)))
  c-guess-basic-syntax()
  #[(&optional syntax quiet ignore-point-pos) "\212\306\x7f\210`Sf)\307=\b\306\211\x19\x1a\x18^[\f\204C\0\212\310 \210\311\v\203\"\0\312\202#\0\313!)\203C\0`\314\225X\203C\0
\204<\0\212\315\225b\210iS\x12)`\315\225|\210\316\x10\x0e\x1f\203\273\0\306\x0e \206V\0\317\320!\205V\0\x0e\x10\x1e\x10\x1e!\321 \x1e\"\316\211\x1e#\x1e$\316\x1e%\306\211\x1e&\x1e'\306\211\x1e(\x1e)\306\211\x1e*\x1e+\322\216\x0e\x10\204\204\0\323 \x16\x10\324\x0e\x10!\x16+\325\x0e,!\204\236\0\x0e-\203\236\0\326\327\x0e\x10\x0e+#\210\x0e+\330 Z\x11.\v\331	!\210\332\333!\210\x0e!*\206\266\0\x0e!\x16!\202\334\0\315\x1e+\212\334y\315U\203\320\0\311\335!\204\277\0\330 \x16+)\x0e+\330 Z\x11\331	!\210)\b\203\376\0\v\203\376\0\n\203\363\0\212\nj\210\307c\210)\202\376\0
\203\376\0\336``\306\316$\210	,\207" [c-fix-backslashes shift-amt bs-col line-cont-backslash ignore-point-pos c-auto-align-backslashes nil 92 beginning-of-line looking-at "\\([ 	]*\\)\\\\$" "\\([ 	]*\\)$" 1 0 t boundp c-syntactic-context buffer-modified-p ((byte-code "\b\204
\0\301 \203
\0\302\303!\210\303\207" [modified buffer-modified-p set-buffer-modified-p nil] 2)) c-guess-basic-syntax c-get-syntactic-indentation c-echo-parsing-error message "syntax: %s, indent: %d" current-indentation c-shift-line-indentation run-hooks c-special-indent-hook -1 "\\s *\\\\?$" c-backslash-region c-syntactic-indentation syntax c-parsing-error modified buffer-undo-list inhibit-read-only inhibit-point-motion-hooks before-change-functions after-change-functions deactivate-mark buffer-file-name buffer-file-truename indent quiet c-echo-syntactic-information-p] 6 ("/Applications/Emacs.app/Contents/Resources/lisp/progmodes/cc-cmds.elc" . 683)](nil nil nil)
  ad-Advice-c-indent-line(#[(&optional syntax quiet ignore-point-pos) "\212\306\x7f\210`Sf)\307=\b\306\211\x19\x1a\x18^[\f\204C\0\212\310 \210\311\v\203\"\0\312\202#\0\313!)\203C\0`\314\225X\203C\0
\204<\0\212\315\225b\210iS\x12)`\315\225|\210\316\x10\x0e\x1f\203\273\0\306\x0e \206V\0\317\320!\205V\0\x0e\x10\x1e\x10\x1e!\321 \x1e\"\316\211\x1e#\x1e$\316\x1e%\306\211\x1e&\x1e'\306\211\x1e(\x1e)\306\211\x1e*\x1e+\322\216\x0e\x10\204\204\0\323 \x16\x10\324\x0e\x10!\x16+\325\x0e,!\204\236\0\x0e-\203\236\0\326\327\x0e\x10\x0e+#\210\x0e+\330 Z\x11.\v\331	!\210\332\333!\210\x0e!*\206\266\0\x0e!\x16!\202\334\0\315\x1e+\212\334y\315U\203\320\0\311\335!\204\277\0\330 \x16+)\x0e+\330 Z\x11\331	!\210)\b\203\376\0\v\203\376\0\n\203\363\0\212\nj\210\307c\210)\202\376\0
\203\376\0\336``\306\316$\210	,\207" [c-fix-backslashes shift-amt bs-col line-cont-backslash ignore-point-pos c-auto-align-backslashes nil 92 beginning-of-line looking-at "\\([ 	]*\\)\\\\$" "\\([ 	]*\\)$" 1 0 t boundp c-syntactic-context buffer-modified-p ((byte-code "\b\204
\0\301 \203
\0\302\303!\210\303\207" [modified buffer-modified-p set-buffer-modified-p nil] 2)) c-guess-basic-syntax c-get-syntactic-indentation c-echo-parsing-error message "syntax: %s, indent: %d" current-indentation c-shift-line-indentation run-hooks c-special-indent-hook -1 "\\s *\\\\?$" c-backslash-region c-syntactic-indentation syntax c-parsing-error modified buffer-undo-list inhibit-read-only inhibit-point-motion-hooks before-change-functions after-change-functions deactivate-mark buffer-file-name buffer-file-truename indent quiet c-echo-syntactic-information-p] 6 ("/Applications/Emacs.app/Contents/Resources/lisp/progmodes/cc-cmds.elc" . 683)])
  apply(ad-Advice-c-indent-line #[(&optional syntax quiet ignore-point-pos) "\212\306\x7f\210`Sf)\307=\b\306\211\x19\x1a\x18^[\f\204C\0\212\310 \210\311\v\203\"\0\312\202#\0\313!)\203C\0`\314\225X\203C\0
\204<\0\212\315\225b\210iS\x12)`\315\225|\210\316\x10\x0e\x1f\203\273\0\306\x0e \206V\0\317\320!\205V\0\x0e\x10\x1e\x10\x1e!\321 \x1e\"\316\211\x1e#\x1e$\316\x1e%\306\211\x1e&\x1e'\306\211\x1e(\x1e)\306\211\x1e*\x1e+\322\216\x0e\x10\204\204\0\323 \x16\x10\324\x0e\x10!\x16+\325\x0e,!\204\236\0\x0e-\203\236\0\326\327\x0e\x10\x0e+#\210\x0e+\330 Z\x11.\v\331	!\210\332\333!\210\x0e!*\206\266\0\x0e!\x16!\202\334\0\315\x1e+\212\334y\315U\203\320\0\311\335!\204\277\0\330 \x16+)\x0e+\330 Z\x11\331	!\210)\b\203\376\0\v\203\376\0\n\203\363\0\212\nj\210\307c\210)\202\376\0
\203\376\0\336``\306\316$\210	,\207" [c-fix-backslashes shift-amt bs-col line-cont-backslash ignore-point-pos c-auto-align-backslashes nil 92 beginning-of-line looking-at "\\([ 	]*\\)\\\\$" "\\([ 	]*\\)$" 1 0 t boundp c-syntactic-context buffer-modified-p ((byte-code "\b\204
\0\301 \203
\0\302\303!\210\303\207" [modified buffer-modified-p set-buffer-modified-p nil] 2)) c-guess-basic-syntax c-get-syntactic-indentation c-echo-parsing-error message "syntax: %s, indent: %d" current-indentation c-shift-line-indentation run-hooks c-special-indent-hook -1 "\\s *\\\\?$" c-backslash-region c-syntactic-indentation syntax c-parsing-error modified buffer-undo-list inhibit-read-only inhibit-point-motion-hooks before-change-functions after-change-functions deactivate-mark buffer-file-name buffer-file-truename indent quiet c-echo-syntactic-information-p] 6 ("/Applications/Emacs.app/Contents/Resources/lisp/progmodes/cc-cmds.elc" . 683)] nil)
  c-indent-line()
  indent-according-to-mode()
  newline-and-indent()
  call-interactively(newline-and-indent nil nil)
  command-execute(newline-and-indent)

[-- Attachment #3: blah.c --]
[-- Type: text/x-csrc, Size: 2078 bytes --]

#define TAG_MASK 0x3
#define PAIR_TAG 0
#define FIXNUM_TAG 1
#define OBJECT_TAG 2

struct pair_t;
struct object_t;
struct vtable_t;

typedef union cell_t {
	struct pair_t* p;
	ptrdiff_t n;
	struct object_t* o;
} cell;

struct pair_t {
	cell car;
	cell cdr;
};

struct object_t {
	struct vtable_t* meta;
};

#define OBJECT_META struct vtable_t* meta

struct gc_stackroot {
	void** root;
	struct gc_stackroot* next;
};

extern struct gc_stackroot* gc_stack_roots;

#define GC_PUSH_PAIR(v) struct gc_stackroot _gcsr_##v;  _gcsr_##v.root = (void**)&v;  _gcsr_##v.next = gc_stack_roots;
#define GC_PUSH_OBJ(v) struct gc_stackroot _gcsr_##v;  _gcsr_##v.root = (void**)((unsigned char*)&v + OBJECT_TAG); _gcsr_##v.next = gc_stack_roots;
#define GC_POP(v)  gc_stack_roots = _gcsr_##v.next;

void* gc_alloc(size_t size);

void error(const char* msg);

struct vtable_t {
	OBJECT_META;
};

struct method_t {
	OBJECT_META;
	struct object_t* name;
};

enum registers {
};

struct machine_t {
	cell reg[NUM_REGISTERS];
};

void error(const char* msg) {
	fprintf(stderr, "%s\n", msg);
	exit(1);
}



/* GC implementation */

#define GC_HEAPSIZE 1024*1024
#define GC_TOO_BIG  (GC_HEAPSIZE/8)

void gc_collect();

struct gc_stackroot* gc_stack_roots = 0;

void* gc_broken_heart = 0; /* if first word in x points to gc_broken_heart, second word points to the actual object */

unsigned char* gc_heap = 0;
unsigned char* gc_new  = 0;
unsigned char* gc_top = 0;

void* gc_alloc(size_t size) {
	void* ret;
	if (size < sizeof(struct pair_t))
		error("allocation too small");
	else if (size > GC_TOO_BIG)
		error("allocation too big");
	else if (gc_top + size > gc_heap + GC_HEAPSIZE)
		gc_collect();
	ret = gc_top;
	gc_top += size;
	return ret;
}

void gc_collect() {
	unsigned char* scan;
	unsigned char* free;
	unsigned char* old;
	struct gc_stackroot* root;
	scan = gc_new;
	free = gc_new;

	/* step 1: relocate all roots */
	for (root = gc_stack_roots; root; root = root->next) {
		if (IS_PAIR(root->root)) {
		}
		else {
		}
	}

	/* step 2: scan new */
	{
	}

	/* step 3: flip */

	gc_heap = 
}

  parent reply	other threads:[~2013-05-23  4:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-23 20:13 bug#12266: 24.1; c-looking-at-inexpr-block: wrong type argument Dave Abrahams
2012-11-19 22:47 ` Julian Stecklina
2013-05-23  4:34 ` Kristoffer Grönlund [this message]
2021-08-23 14:51   ` Lars Ingebrigtsen
     [not found]     ` <76ba613d-8982-4a72-8137-f38093b09748@www.fastmail.com>
2021-08-23 15:17       ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEFqW5q3F5_aBPKbFRYHJSKTRZ9+QSjMSsRcE42AfXueaD99qg@mail.gmail.com \
    --to=krig@koru.se \
    --cc=12266@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).